home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: eric@mks.com (Eric Gisin)
-
- I have POSIX 1003.1-1988 and 1990 in front of me.
- Section 8.2.3 (Interaction with C stream functions) has some major changes.
-
- Why was the requirement that fclose() set the file descriptor offset
- to the stream offset removed? Note the 1990 rational is wrong.
- This means applications have to do it themselves with
- fflush(fp);
- fseek(fp, 0L, SEEK_CUR);
-
- I understand why fflush is no longer required to invalidate input buffers,
- but is a 1990 implementation required to leave input buffers untouched
- on non-seekable files? For example, can I write
- fgetc(stdin); /* first byte */
- fflush(stdin);
- [fork(), child does not use stdin but does exit()]
- fgetc(stdin); /* second byte */
- without concern that stdin may be a pipe?
- Or do I have to conditionalize the fflush with
- if (!seekable(fileno(stdin))
- If so, how can I write seekable(), allowing for implementations
- that have non-seekable devices other that ttys and pipes?
-
- Or, when using fork(), is it required to use _exit() and explicit fflush()s?
-
- Eric Gisin, eric@mks.com
-
-
- Volume-Number: Volume 24, Number 87
-
-