home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.31 / text0092.txt < prev    next >
Encoding:
Text File  |  1993-07-15  |  1.4 KB  |  39 lines

  1. Submitted-by: mib@geech.gnu.ai.mit.edu (Michael I Bushnell)
  2.  
  3. In article <20t4bcINN5jb@rodan.UU.NET> ericb@sierra.com (Eric Blood) writes:
  4. >The documentation for errno (in the same document) is as follows:
  5. >
  6. >"The value of this variable ['errno'] shall be defined only after a
  7. >call to a function for which it is explicitly stated to be set and
  8. >until it is changed by the next function call.  The variable 'errno'
  9. >should only be examined when it is indicated to be valid by a
  10. >function's return value.  No function defined in this part of ISO/IEC
  11. >9945 sets errno to zero to indicate an error."
  12. >
  13. >Does this mean I'm allowed to set the errno variable or not?  If I'm
  14. >able to, then I can use the example code with pathconf().  Otherwise,
  15. >what should I do?
  16.  
  17. Pedantic answer:
  18.  
  19. You have to call a function that will set errno to zero (something
  20. like `kill (getpid (), 0)', and then immediately call pathconf.
  21. Pathconf documents that it might or might not set errno, so now you
  22. can look at it.
  23.  
  24. Real answer: 
  25.  
  26. You have to set errno anyway to write a correct signal handler;
  27. therefore it's OK to set it here.
  28.  
  29.     -mib
  30. --
  31. +1 617 628 6197 (H)      |     Offer to God a sacrifice of thanksgiving
  32. +1 617 253 8568 (W)     -+-      and make good your vows to the Most High.
  33. 14 Paulina Street        |     Call upon me in the day of trouble;
  34. Somerville, MA 02144     |       I will deliver you, and you shall honor me.
  35.  
  36.  
  37. Volume-Number: Volume 31, Number 94
  38.  
  39.