Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!samsung!crackers!m2c!umvlsi!dime!dime.cs.umass.edu!moss From: moss@cs.umass.edu (Eliot Moss) Newsgroups: comp.unix.internals Subject: Re: Unblocking filedescriptor(s) Message-ID: Date: 26 Jan 91 20:08:01 GMT References: <1991Jan25.235221.21868@odin.diku.dk> Sender: news@dime.cs.umass.edu Reply-To: moss@cs.umass.edu Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst) Lines: 19 In-reply-to: cthulhu@freja.diku.dk's message of 25 Jan 91 23:52:21 GMT Note that the arguments to fcntl are bit encoded, so to clear FNDELAY simply do fctnl(fd, F_SETFL, 0). If the file may have other properties you want to preserve, then do something like this: int i = fcntl (fd, F_GETFL); /* get properties */ i &= ~FNDELAY; /* clear FNDELAY */ fcntl (fd, F_SETFL, i); /* set properties */ Note that you can just as well use an ioctl (FIONBIO). Perhaps the set/clear effects are more obvious here. Both routes eventually end up in the same code in the kernel .... Eliot -- J. Eliot B. Moss, Assistant Professor Department of Computer and Information Science Lederle Graduate Research Center University of Massachusetts Amherst, MA 01003 (413) 545-4206, 545-1249 (fax); Moss@cs.umass.edu