Xref: utzoo comp.unix.programmer:2162 comp.unix.questions:32464 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!sarah!cs.albany.edu!crdgw1!uakari.primate.wisc.edu!samsung!think.com!snorkelwacker.mit.edu!bloom-picayune.mit.edu!news From: mlevin@jade.tufts.edu Newsgroups: comp.unix.programmer,comp.unix.questions Subject: why would a socket read() set errno to EWOULDBLOCK but still read? Message-ID: <1991Jun27.220701.21108@athena.mit.edu> Date: 27 Jun 91 22:07:01 GMT Sender: news@athena.mit.edu (News system) Distribution: usa Organization: Me, Myself, and I, inc. Lines: 10 I am doing a read() on a connected TCP socket (BSD 4.3) marked as non-blocking. For some reason, the read returns the proper number of characters read (or sometimes 0), but sets errno to EWOULDBLOCK. Why is this? My program never did this before; I was under the impression that if no data was available, it should return -1. Is this a possible event, or am I trashing memory somewhere? Please reply to mlevin@jade.tufts.edu. Mike Levin