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

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