home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.20 / text0020.txt < prev    next >
Encoding:
Internet Message Format  |  1990-08-02  |  1.2 KB

  1. From:  Andy Tanenbaum <ast@cs.vu.nl>
  2.  
  3. We have gone through this before, but I still haven't gotten an unambiguous
  4. answer.  Let me try a specific example to make it clearer.
  5.  
  6. Suppose you want to write a routine raise() that is ANSI conformant and also
  7. POSIX conformant.  Raise calls the POSIX kill function, so it includes
  8. <signal.h>.  The <signal.h> header contains the prototype for kill(), which
  9. uses pid_t, a type defined in <sys/types.h>.  POSIX mandates <sys/types.h>
  10. but ANSI does not require it.  Thus it is probably not ANSI-legal to put
  11.  
  12. #include <sys/types.h>
  13.  
  14. in raise(), since an ANSI routine cannot depend on something that ANSI
  15. doesn't require.  The raise routine would not be portable then, and maybe
  16. not even conformant.  On the other hand, putting the #include in <signal.h>
  17. probably isn't legal either, and certainly not portable to non POSIX
  18. systems.  
  19.  
  20. The question is: it has to go somewhere, but where?  I have thought about
  21. putting it in <signal.h> but protected by #ifdef _POSIX_SOURCE, just as
  22. the prototype for kill is.  However, our earlier discussion in this group
  23. suggested that this wasn't legal either.  Does anybody know what the story
  24. is?
  25.  
  26. Andy Tanenbaum (ast@cs.vu.nl)
  27.  
  28. Volume-Number: Volume 20, Number 20
  29.  
  30.