Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 812 - unistd.h fails to define pid_t
unistd.h fails to define pid_t
Product: Red Hat Raw Hide
Classification: Retired
Component: glibc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Cristian Gafton
Depends On:
  Show dependency treegraph
Reported: 1999-01-12 23:08 EST by Michael K. Johnson
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 1999-03-18 17:10:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Michael K. Johnson 1999-01-12 23:08:15 EST
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-12 23:31:59 EST
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.