home *** CD-ROM | disk | FTP | other *** search
- From: rabin@osf.org
-
- I am looking for an informal interpretation of IEEE Std 1003.1-1988.
-
- Section 6.5.3.4 specifies that lseek() returns EINVAL if the resulting
- file offset would be invalid, but it doesn't say which file offsets
- are invalid. The rationale (B.6.5.3) says:
-
- An illegal file offset that would cause [EINVAL] to be
- returned may be both implementation defined and device
- dependent (for example, memory may have few illegal values).
- A negative file offset may be legal for some devices in
- some implementations.
-
- The standard does not specify an error for I/O operations attempted at
- an illegal offset. It _seems_ that the intent is for an offset to be legal
- only if some I/O operation is possible at that offset, and for it to be
- impossible to set an illegal offset. This is not changed in the 1990
- revision of the standard or in the P1003.1b supplement.
-
- XPG3 is not too clear on this point, but it looks like its intent is to
- permit setting illegal file offsets. Optional [ENXIO] errors are added to
- all I/O interfaces and an _optional_ [EINVAL] is added to fseek() in the
- case that the resulting file offset is negative.
-
- Some implementations do permit lseek() to set "illegal" file offsets,
- and some applications take advantage of this. Does anyone know whether
- the original members of the 1003.1 working group intended to permit this?
- Does anyone have an implementation that returns [EINVAL] if the
- file offset resulting from lseek() is negative, or positive and "too
- large"? Are file offsets represented in your kernel by a signed or an
- unsigned type?
-
- Thanks!
-
- Paul Rabin
- Open Software Foundation
- rabin@osf.org or uunet!osf.org!rabin
- (617) 621-8873
-
- Volume-Number: Volume 20, Number 47
-
-