Does O_NDELAY shred read(2)?

Rich Skrenta skrenta at blekko.UUCP
Sun Nov 12 04:06:21 AEST 1989


In article <20764 at ut-emx.UUCP> jon at walt.cc.utexas.edu (Jon Boede) writes:
> 
> If a write(fd,buf,X) is made, will a read(fd2,buf2,X) == X?

An instructor at Usenix in Baltimore said that as long as you write less
bytes than the total size of the buffer, your writes won't be split.

Someone else told me that the buffer size is guaranteed to be a multiple
of 2.  If your writes are fixed size and also a multiple of 2, the buffer
will fill up exactly on its boundary, and no writes will be split.

These both seem reasonable; the second is safer, but a hassle if it's
not necessary.

Rich



More information about the Comp.lang.c mailing list