[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: fclose() - still broken?



On Wed, Aug 19, 1998 at 04:50:08AM +0200, Quant-X Alpha Linux Support wrote:

>   rc = read(0, NULL, 10);
> 
>   returns 6 here (Linux 2.1.113 i586) (no errno, no core) 
>   when entering "hello<CR>"
> 
> Is this valid, or not ? ;-0

If you have a writable page at 0x0, then yes.

A stickier question is what happens you you try to read a 10 byte
file using read(fd,&buffer,8192) when the buffer is only 4k is size.

2.0.x will return EFAULT because it knows the entire range is not
valid (the high 4k is bad), but 2.1.x will succeed because it can
read 10 bytes without failing.

Which is correct? (Btw, different OSs take one or other approach).




-cw



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []