Bug 812 - unistd.h fails to define pid_t
Summary: unistd.h fails to define pid_t
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: glibc
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Cristian Gafton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 1999-03-18 22:10:57 UTC
Embargoed:


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>

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-13 04:31:59 UTC
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.