home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / linux / 16454 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  1.2 KB

  1. Path: sparky!uunet!mcsun!uknet!brunel!cs89rdb
  2. From: cs89rdb@brunel.ac.uk (Roger D Binns)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: Possible 0.98.3 bug (in fs mounting)
  5. Message-ID: <BxLrI8.D5I@brunel.ac.uk>
  6. Date: 12 Nov 92 12:18:06 GMT
  7. References: <1992Nov8.195649.16470@klaava.Helsinki.FI>
  8. Organization: Brunel University, Uxbridge, UK
  9. Lines: 21
  10. X-Newsreader: TIN [version 1.1 PL6]
  11.  
  12. I have also found a bug in the open call.  If you do an open, but do not give
  13. read or write flags, subsequent reads or writes fail with EBADF.  Example code
  14. is:
  15.  
  16. int fd;
  17.  
  18. fd=open("/tmp/testing", O_CREAT|O_TRUNC, 0666);
  19. write(fd, "  ", 2);
  20. perror("this is it");
  21.  
  22. According to SVID, O_TRUNC implies O_WRITE.  Indeed, it still implies write
  23. even if the file is created, and the mode is 0000.
  24.  
  25. Roger
  26. -- 
  27. +=============================================================================+
  28. | cs89rdb@brunel.ac.uk     Roger Binns    Brunel University - UK              |
  29. |:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::|
  30. | Do your bit to destroy the American economy by overwhelming their legal     |
  31. | system - buy an Intel chip to run your Lotus software TODAY.                |
  32. +=============================================================================+
  33.