home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / std_unix / archive / text0013.txt < prev    next >
Encoding:
Text File  |  1994-03-07  |  856 b   |  35 lines

  1. Submitted-by: srini@hpcuhe.cup.hp.com (Sreenivasa Rao Tellakula)
  2.  
  3. I have a doubt on _POSIX_SOURCE.
  4.  
  5. If I have two prototypes for the same function, one is posix version
  6. and one is non-posix and if I have to put them in the header file, what
  7. ifdef I have to use? Can I use _POSIX_SOURCE?
  8.  
  9. For example:
  10.  
  11. in example.h
  12.  
  13. #ifdef _POSIX_SOURCE
  14.         extern int getgroups (int, gid_t *);
  15. #else
  16.         extern int getgroups (int *, int *);
  17. #endif
  18.  
  19. is the above segment correct? If correct, this means all posix programs
  20. needs to be compiled with cc -D_POSIX_SOURCE and is this an acceptable
  21. constraint?
  22.  
  23. Whatever flags one has to specify with 'cc' to get a posix compliant
  24. program is implementaion defined or is there any posix specification on
  25. that?
  26.  
  27.  
  28. --
  29. srini@cup.hp.com
  30. (408)447-4199(W)          
  31. (408)447-5039 - Fax     
  32.  
  33. Volume-Number: Volume 34, Number 13
  34.  
  35.