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

  1. From:  guy@auspex.uucp (Guy Harris)
  2.  
  3.  
  4. >I am having some difficulty following the above.  How can a portable
  5. >application do anything to vendor-defined fields?
  6.  
  7. That's precisely the problem.
  8.  
  9. >Isn't the application non-portable as soon as it does anything (read or write)
  10. >to a vendor-defined field?
  11.  
  12. Yup.  Unfortunately, the application is non-functional (at least not
  13. *correctly* functional) if it *doesn't* initialize the vendor-defined
  14. fields of a structure that's handed to the system, unless the system can
  15. somehow always figure out that they haven't been initialized - e.g., if
  16. there's some flag field in the structure that *is* specified by the
  17. standard, and you have to set some flag in that field *not* specified by
  18. the standard in order to get the system to look at the other fields not
  19. in the standard.
  20.  
  21. Unfortunately, in the case of "utime()", there's no such flag, so a
  22. portable application can, at best, only avoid setting the microseconds
  23. values of a file's accessed or modified times to some random value by
  24. "memset"ting the entire "utimbuf" structure to zero before filling it in
  25. and using it (or otherwise ensuring that the structure is zero before
  26. using it, e.g. using a static structure).
  27.  
  28.  
  29. Volume-Number: Volume 21, Number 20
  30.  
  31.