home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.23 / text0061.txt < prev    next >
Encoding:
Text File  |  1991-06-15  |  1.1 KB  |  38 lines

  1. Submitted-by: ro@thp.uni-koeln.de (Rainer Orth)
  2.  
  3. Recently while working on the command sources of Andy Tanenbaums Minix 1.6
  4. (currently in beta and trying to become fully P1003.1 and .2 compatible),
  5. there appeared the question whether code like
  6.  
  7.     #include <pwd.h>
  8.     
  9.     int main (void)
  10.     {
  11.     }
  12.  
  13. is required to work in a strictly conforming POSIX.1 implementation with
  14. Standard C Bindings. 
  15.  
  16. The problem is as follows:
  17.  
  18.     <pwd.h> contains a prototype for struct passwd *getpwuid (uid_t)
  19.     and doesn't include <sys/types.h> by itself. I'm not shure if the
  20.     above program needs to #include <sys/types.h> itself or <pwd.h> is
  21.     wrong. From P1003.1-1988 <sys/types.h> needs to be included only if
  22.     the program uses getpwuid().
  23.  
  24. The same problem occurs in several other headers: e.g. <signal.h>, <grp.h>,
  25. <unistd.h>, <sys/wait.h>.
  26.  
  27. Does P1003.1-1990 specify the correct behaviour?
  28.  
  29.     Rainer
  30. --
  31. -----------------------------------------------------------------------------
  32. Rainer Orth, Institute of Theoretical Physics, University of Cologne
  33.  
  34. Internet: ro@thp.Uni-Koeln.DE
  35.  
  36. Volume-Number: Volume 23, Number 65
  37.  
  38.