Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!ai-lab!ai.mit.edu!sundar From: sundar@ai.mit.edu (Sundar Narasimhan) Newsgroups: comp.unix.programmer Subject: question about non-blocking I/O and SIGPIPE Message-ID: <14318@life.ai.mit.edu> Date: 24 Mar 91 22:23:43 GMT Article-I.D.: life.14318 Sender: news@ai.mit.edu Reply-To: sundar@ai.mit.edu Followup-To: comp.unix.programmer Organization: MIT Artificial Intelligence Laboratory Lines: 18 Hi: I have a server that is writing data on a socket to a client. The socket has been marked for non-blocking I/O using the FIONBIO ioctl. Now, what I need to know is exactly under what conditions will a SIGPIPE be generated on the server. I've read the man pages, but this info is not found anywhere. They say that write() will return -1 and errno will be set to EWOULDBLOCK when the buffers are full. write() can return a value less than the bc passed to it, in case the operation would block, in which case, the manual says the write should be tried again. (I'm reading this on a Sparc (Sun OS 4.1.1) and my code is to run on a Pyramid SysV Unix -- which makes it even more confusing since FIONBIO works differently under SysV). I know all this sounds kinda vague but I'll be happy to explain it in more detail -- you see I have this server that's dying with SIGPIPE's and I'd like to know how to fix it right (instead of just patching it).