missing "unistd.h"

ossslab

2002-09-05 15:09:00

Hi all,

Last week, I started to use MacOSX, and I tried to
build kernel(XNU).
But I have a serious problem.
When I try to build cctools, I get following error message.

%sudo make RC_OS=macos kld_build
cc -g -I.. -I../../include -I. -Wall -Wno-precomp -Wno-long-double -static -DRLD -DKLD -fno-builtin -finline -fno-keep-inline-functions -fsigned-bitfields -force_cpusubtype_ALL -msoft-float -nostdinc -I/System/Library/Frameworks/Kernel.framework/Headers/libsa -I/System/Library/Frameworks/Kernel.framework/Headers/bsd -I/System/Library/Frameworks/Kernel.framework/Headers -DKERNEL -DKERNEL_PRIVATE -DAPPLE -DNeXT -DLIBSA_PRIVATE -O -c -MD \
-dependency-file ./pass1.d -o ./pass1.o ../pass1.c
/System/Library/Frameworks/Kernel.framework/Headers/sys/file.h:63: header file 'sys/unistd.h' not found
cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
make[1]: *** [pass1.o] Error 1
make: *** [kld_build] Error 2

Truely, there is no such a header file.
How can I get the file? Please help me.

apex

2002-09-10 07:46:00

I have unistd.h in 10.2. Make sure you install the BSD subsytem and the latest version of dev tools.
<blockquote><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><hr><pre>
/usr/include/sys/unistd.h
/usr/include/unistd.h
</pre>[/quote]

ossslab

2002-09-11 08:00:00

I have installed the latest version of DeveloperTools.
I have /usr/include/sys/unistd.h and /usr/include/unistd.h.
I think cctools requires
/System/Library/Frameworks/Kernel.framework/Headers/sys/unistd.h.
Do you have this one? If you have, did you do something special?

>Make sure you install the BSD subsystem
I don't know what is the BSD subsystem and where to get that.

DMCrimson

2002-10-04 08:35:00

BSD subsystem is part of OS X...it's on the install CD.

jpm

2002-12-20 22:10:00

unfortunately it was errantly not included in the kernel framework. you can resolve this issue with: <blockquote><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><hr><pre>% sudo cp /usr/include/sys/unistd.h \
/System/Library/Frameworks/Kernel.framework/Headers/sys/
</pre>[/quote]

additionally, i have thrown together some of my notes into a doc for building xnu -- this might be helpful: http://www.opendarwin.org/~jpm/xnu.html