Warner Losh wrote:
> 
> In message <[EMAIL PROTECTED]> Devin Butterfield writes:
> : In trying to compile driver code which includes unistd.h, the compiler
> : complains:
> 
> #include <unistd.h>
> 
> isn't supported for drivers.  You should not be including the
> -I/usr/include on the command line to compile the driver.  If you are
> building a module, you should be using the bsd.kmod.mk framework to
> build the modules.  include <sys/unistd.h> instead.
> 
> You will also need to create an opt_posix.h in your driver's Makefile:
> 
> KMOD=ifx
> SRCS=ifx.c device_if.h bus_if.h opt_posix.h
> 
> .include <bsd.kmod.mk>
> 
> should be all you need.  You may also need to define SYSDIR as well if
> you don't have it installed in /usr/src/sys.

You're right. I normally always do this as a module but was
experimenting with some other code not using an appropriate Makefile.

I still wonder why unistd.h (assuming it is not supported for drivers)
would make any reference to a file that does not exist where it was
looking?

Nevertheless, thanks again for your help. All is fine now...:-)
--
Regards, Devin.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to