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

  1. From:  rabin@osf.org
  2.  
  3. I am looking for an informal interpretation of IEEE Std 1003.1-1988.
  4.  
  5. Section 6.5.3.4 specifies that lseek() returns EINVAL if the resulting 
  6. file offset would be invalid, but it doesn't say which file offsets
  7. are invalid. The rationale (B.6.5.3) says:
  8.  
  9.     An illegal file offset that would cause [EINVAL] to be
  10.     returned may be both implementation defined and device
  11.     dependent (for example, memory may have few illegal values).
  12.     A negative file offset may be legal for some devices in
  13.     some implementations.
  14.  
  15. The standard does not specify an error for I/O operations attempted at
  16. an illegal offset. It _seems_ that the intent is for an offset to be legal
  17. only if some I/O operation is possible at that offset, and for it to be
  18. impossible to set an illegal offset.  This is not changed in the 1990
  19. revision of the standard or in the P1003.1b supplement.
  20.  
  21. XPG3 is not too clear on this point, but it looks like its intent is to
  22. permit setting illegal file offsets. Optional [ENXIO] errors are added to 
  23. all I/O interfaces and an _optional_ [EINVAL] is added to fseek() in the
  24. case that the resulting file offset is negative.
  25.  
  26. Some implementations do permit lseek() to set "illegal" file offsets,
  27. and some applications take advantage of this.  Does anyone know whether
  28. the original members of the 1003.1 working group intended to permit this?
  29. Does anyone have an implementation that returns [EINVAL] if the
  30. file offset resulting from lseek() is negative, or positive and "too
  31. large"?  Are file offsets represented in your kernel by a signed or an
  32. unsigned type?
  33.  
  34. Thanks!
  35.  
  36.     Paul Rabin
  37.     Open Software Foundation
  38.     rabin@osf.org or uunet!osf.org!rabin
  39.     (617) 621-8873
  40.  
  41. Volume-Number: Volume 20, Number 47
  42.  
  43.