Does O_NDELAY shred read(2)?

Jon Boede jon at walt.cc.utexas.edu
Sat Nov 11 06:52:50 AEST 1989


If I have two processes communicating through a named pipe, and if the process
that is read(2)ing has O_NDELAY set on the file descriptor so that it will
return if nothing is on the pipe...

If a write(fd,buf,X) is made, will a read(fd2,buf2,X) == X?  In other words, I
know that the write will be atomic... will the read also be?  Is there a
certain buffer size past which I'll start running into trouble?  I'm thinking
of using a buffer that's about 2,000 bytes in length.

Also, with a named pipe, how much (byte-wise) can be written before the writer
will be suspended?  Does setting O_NDELAY on the write end do anything?

Thanks,
Jon
-- -  -   -    -     -      -       -        -         -          -
Jon Boede					jon at bodedo.ucm.org
7117 Wood Hollow #726		...!{uunet,texbell}!cs.utexas.edu!bodedo!jon
Austin, TX  78731-2548				+1 512 346-3142
	"People who are incapable of making decisions are
	 the ones that hit those barrels at freeway exits"



More information about the Comp.lang.c mailing list