Bug 812 - unistd.h fails to define pid_t
unistd.h fails to define pid_t
Status: CLOSED CURRENTRELEASE
Product: Red Hat Raw Hide
Classification: Retired
Component: glibc (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Cristian Gafton
:
Depends On:
Blocks:
  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:
Environment:
Last Closed: 1999-03-18 17:10:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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>

int
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
arm.

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.