Talk:IPC via named pipe: Difference between revisions

(→‎Tricky to open "out": Add link; we're stuck with this…)
 
Line 5:
 
:: You only want to have one end of each named pipe open in the process; using <code>O_RDWR</code> is opening both ends, and that's semantically wrong anyway (irrespective of whether or not it “works” with select()). It's irritating that O_NONBLOCK doesn't work for the pipe writer — POSIX [http://pubs.opengroup.org/onlinepubs/009604599/functions/open.html specifies that behavior] for reasons that are unclear to me, which scuppers the whole plan of using select() to wait for a reader, and the rationale doesn't go into enough depth — but at least it means that we can handle it with polling to give the right overall effect. (Sockets are nicer.) –[[User:Dkf|Donal Fellows]] 12:23, 3 October 2011 (UTC)
 
::: O_RDWR is semantically wrong, but POSIX specifically left it undefined instead of an error, which might be an intentional shortcut left to individual OS implementations. O_NONBLOCK|O_WRONLY behavior, as I vaguely understand it, has something to do with the pipe buffer management, though I'm very unsure about it. --[[User:Ledrug|Ledrug]] 00:43, 4 October 2011 (UTC)
 
== OpenBSD blocks the entire process ==
Anonymous user