Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Aug 2000 15:43:37 -0700
From:      Devin Butterfield <dbutter@wireless.net>
To:        Warner Losh <imp@village.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: /usr/include/sys/opt_posix.h missing...?
Message-ID:  <3999C799.79ED6343@wireless.net>
References:  <3998F562.C5B0B82A@wireless.net> <200008151852.MAA99835@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Warner Losh wrote:
> 
> In message <3998F562.C5B0B82A@wireless.net> 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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3999C799.79ED6343>