home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / linux / 23170 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.6 KB  |  36 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!cs.utexas.edu!uwm.edu!daffy!spock.cs.wisc.edu!quale
  3. From: quale@spock.cs.wisc.edu (Doug Quale)
  4. Subject: Re: Library 4.1 bug/feature?  fopen("fifo","a") fails
  5. Message-ID: <1993Jan8.053556.24868@daffy.cs.wisc.edu>
  6. Sender: news@daffy.cs.wisc.edu (The News)
  7. Organization: University of Wisconsin -- Madison
  8. References: <1igs2mINNdpp@nz12.rz.uni-karlsruhe.de> <1993Jan7.104939.10424@serval.net.wsu.edu>
  9. Date: Fri, 8 Jan 1993 05:35:56 GMT
  10. Lines: 24
  11.  
  12. In article <1993Jan7.104939.10424@serval.net.wsu.edu> hlu@luke.eecs.wsu.edu (H.J. Lu) writes:
  13. >In article <1igs2mINNdpp@nz12.rz.uni-karlsruhe.de> ig25@rz.uni-karlsruhe.de writes:
  14. >>Is it a bug or a feature that fopen("fifo","a"), where "fifo" is a named
  15. >>pipe, fails with an 'illegal lseek' in the 4.1 version of the library?
  16. >>The opinion on comp.std.unix seems to be that there should be no
  17. >>problem...
  18. >
  19. >That is a feature of stdio/kernel. I was told that according to ANSI
  20. >standard, fopen ("foo", "a") should do a lseek () to the end after
  21. >calling open (). But linux kernel refuses to any lseek () on
  22. >non-regular files.
  23. >
  24.  
  25. If iostream works this way, it is broken, because fopen ("foo", "a")
  26. is *not* an open followed by an lseek.  The open must be in O_APPEND mode
  27. or files writen by several processes will lose horribly.
  28.  
  29. To the specific point asked, I believe that lseeks are not permitted on
  30. pipes, named or otherwise, and so it is not a bug that Linux disallows
  31. O_APPEND mode on pipes.  But if iostream really does an lseek for
  32. fopen ("foo", "a") that should be fixed.
  33. -- 
  34. Doug Quale
  35. quale@saavik.cs.wisc.edu
  36.