Subject: issue with unnamed pipe and kqueue
To: None <tech-kern@netbsd.org>
From: Jithesh Kaveetil <jitheshk@gmail.com>
List: tech-kern
Date: 05/15/2007 15:48:50
Hi,

I am facing an issue with pipe while using it with kqueue:

I have a process (say P1) which creates an unnamed pipe. It then forks
a new process (say P2).

P1 keeps the read end of the pipe and closes the write end. It
registers the read end of the pipe with kqueue and waits on it.
As soon as P2 starts, it closes the read end of the pipe. Once it is
done with a certain set ot actions, it closes the write end of the
pipe.

My intention is to get a notification on kqueue in P1 (since the last
writter of the pipe has closed it). However, no event comes in on the
kqueue. If I use 'select' instead of kqueue to wait for the event in
P1, it is getting notified.

Does pipe support notification of this event with kqueue? After some
initial analysis of the pipe related code, it seems that probably this
is not supported as of now. However, kqueue man page  is referring to
this scenario.

Any inputs on this will really help.

regards,
-Jithesh