The man page for fork shows that it needs the unistd.h header file. This should be changed to sys/types.h. A test compile shows this: #include <unistd.h> int bozo(void) { pid_t ret; ret = fork(); } The compile line is: gcc -D_POSIX_SOURCE -c foo.c > gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
Alternatively, use __pid_t instead of pid_t - fork itself doesn't need sys/types.h.
assigned to teg
Not a bug - fork needs only unistd.h. You don't need to use the type directly...