Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 812 - unistd.h fails to define pid_t
Summary: unistd.h fails to define pid_t
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: glibc
Version: 1.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Cristian Gafton
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-01-13 04:08 UTC by Michael K. Johnson
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-03-18 22:10:57 UTC

Attachments (Terms of Use)

Description Michael K. Johnson 1999-01-13 04:08:15 UTC
unistd.h is supposed to define pid_t.  It doesn't.
Here's a test case.

$ cat test.c
#include <unistd.h>

main() {
  pid_t pid;
  pid = getpid();
  return 0;
$ make test
cc     test.c   -o test
test.c: In function `main':
test.c:5: `pid_t' undeclared (first use this function)
test.c:5: (Each undeclared identifier is reported only once
test.c:5: for each function it appears in.)
test.c:5: parse error before `pid'
test.c:6: `pid' undeclared (first use this function)
make: *** [test] Error 1

Comment 1 stewart 1999-01-13 04:31:59 UTC
Add -D_GNU_SOURCE to your compile line.  Then it works for me, on the

Looking at unistd.h the pid_t define is wrapped around: __USE_XOPEN

Note You need to log in before you can comment on or make changes to this bug.