home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.11 / text0082.txt < prev    next >
Encoding:
Internet Message Format  |  1987-07-18  |  1.6 KB

  1. From: andrew@lemming.gwd.tek.com (Andrew Klossner)
  2.  
  3. [With regard to programs that inadvertantly do close(-1):]
  4.  
  5.     "Programs that are not that pessimistic are broken.  I see no
  6.     reason to reject this proposal out of hand merely because it
  7.     would expose bugs in programs such as these ..."
  8.  
  9. One of the major goals of a standardization effort is to "do no harm":
  10. not to invalidate facilities which are commonly available and upon
  11. which many programs may depend (even if such dependence is
  12. inadvertant).  The requested facility, to close all open files, could
  13. just as easily be implemented with a new function, e.g., "closeall()".
  14. There is no reason to go out of our way to overload an existing
  15. function, one whose semantics have been fixed for over a decade.
  16.  
  17. A much more extreme example of this philosophy appears when Unix
  18. vendors go out of their way to place zeros at location 0, so that
  19. programs developed on VAXes which "expect" to find 0 when dereferencing
  20. a 0 pointer will work.  No, I'm not suggesting that POSIX or X3J11
  21. mandate this, but vendors such as my employer do this for marketability
  22. reasons.  Imagine that a potential customer has one of my workstations
  23. and one of yours; on yours their VAX application compiles and runs just
  24. fine, while on mine it crashes with "bus error".  No amount of my
  25. explaining that their program shouldn't dereference a null pointer is
  26. going to get me the sale unless my machine stands out in other ways.
  27.  
  28.   -=- Andrew Klossner   (decvax!tektronix!tekecs!andrew)       [UUCP]
  29.                         (andrew%tekecs.tek.com@relay.cs.net)   [ARPA]
  30.  
  31. Volume-Number: Volume 11, Number 83
  32.  
  33.