Path: utzoo!utgpu!watserv1!watmath!att!cbnewsl!sar0 From: sar0@cbnewsl.att.com (stephen.a.rago) Newsgroups: comp.unix.wizards Subject: Re: But I don't wanna do non-blocking I/O... Message-ID: <1990Jun12.123606.16898@cbnewsl.att.com> Date: 12 Jun 90 12:36:06 GMT References: <397@minya.UUCP> Organization: AT&T Bell Laboratories Lines: 19 In article <397@minya.UUCP>, jc@minya.UUCP (John Chambers) writes: > Subject: But I don't wanna do non-blocking I/O... > Newsgroup: comp.unix.wizards > > Well, here's a little puzzle that has me stumped; ... > But fgets(buf,n,stdin) returns EOF immediately. ... > > The open() does include F_NDELAY, but > this is supposed to apply only to the open; it shouldn't > set non-blocking I/O permanently for the file (I hope ;-). Here's your problem. If you open with O_NDELAY, your file descriptor is in non-blocking mode until you explicitly turn it off with fcntl. O_NDELAY affects more than just the open. Steve Rago sar@attunix.att.com