Re: [PATCH] 0-byte read()/write() behaviour

2000-10-23 Thread Pavel Machek
Hi! > > I suspect SUS only talks about regular files. > > As I'm reading it, they're talking about every read() call, even those with > an invalid fd. I'd say _they_ are broken in such case. read(invalid_fd, NULL, 0) should give error, not pretend success. -- Philips Velo 1: 1"x4"x8", 300gram

Re: [PATCH] 0-byte read()/write() behaviour

2000-10-20 Thread Philipp Rumpf
On Fri, Oct 20, 2000 at 10:47:45AM -0700, Linus Torvalds wrote: > On Fri, 20 Oct 2000, Philipp Rumpf wrote: > > > > Single Unix specifies that 0-byte reads, as well as 0-byte writes, should > > "return 0 and have no other results". Our current implementation violates > > the first requirement and

Re: [PATCH] 0-byte read()/write() behaviour

2000-10-20 Thread Linus Torvalds
On Fri, 20 Oct 2000, Philipp Rumpf wrote: > > Single Unix specifies that 0-byte reads, as well as 0-byte writes, should > "return 0 and have no other results". Our current implementation violates > the first requirement and makes it very easy to violate the second one. Note that there _are_ ca

[PATCH] 0-byte read()/write() behaviour

2000-10-20 Thread Philipp Rumpf
Single Unix specifies that 0-byte reads, as well as 0-byte writes, should "return 0 and have no other results". Our current implementation violates the first requirement and makes it very easy to violate the second one. read(page_cache_fd, invalid_ptr, 0) returns -EFAULT; IMHO, this is a clear