summaryrefslogtreecommitdiffstats
path: root/sys/sys/pipe.h
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2012-07-31 02:00:37 +0000
committerdavidxu <davidxu@FreeBSD.org>2012-07-31 02:00:37 +0000
commitd2b97b91930a11e100e21262dc3c08cb93b7e415 (patch)
tree9bbb35e29abb7acba493b444f512a83ed00f2db0 /sys/sys/pipe.h
parentcf6d705d5b2f458f6a07c3c33eac90bca667108a (diff)
downloadFreeBSD-src-d2b97b91930a11e100e21262dc3c08cb93b7e415.zip
FreeBSD-src-d2b97b91930a11e100e21262dc3c08cb93b7e415.tar.gz
When a thread is blocked in direct write state, it only sets PIPE_DIRECTW
flag but not PIPE_WANTW, but FIFO pipe code does not understand this internal state, when a FIFO peer reader closes the pipe, it wants to notify the writer, it checks PIPE_WANTW, if not set, it skips calling wakeup(), so blocked writer never noticed the case, but in general, the writer should return from the syscall with EPIPE error code and may get SIGPIPE signal. Setting the PIPE_WANTW fixed problem, or you can turn off direct write, it should fix the problem too. This bug is found by PR/170203. Another bug in FIFO pipe code is when peer closes the pipe, another end which is being blocked in select() or poll() is not notified, it missed to call pipeselwakeup(). Third problem is found in poll regression test, the existing code can not pass 6b,6c,6d tests, but FreeBSD-4 works. This commit does not fix the problem, I still need to study more to find the cause. PR: 170203 Tested by: Garrett Copper &lt; yanegomi at gmail dot com &gt;
Diffstat (limited to 'sys/sys/pipe.h')
-rw-r--r--sys/sys/pipe.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h
index d60185a..f0029a8 100644
--- a/sys/sys/pipe.h
+++ b/sys/sys/pipe.h
@@ -143,5 +143,5 @@ struct pipepair {
void pipe_dtor(struct pipe *dpipe);
int pipe_named_ctor(struct pipe **ppipe, struct thread *td);
-
+void pipeselwakeup(struct pipe *cpipe);
#endif /* !_SYS_PIPE_H_ */
OpenPOWER on IntegriCloud