Unblocking filedescriptor(s)

Eliot Moss moss at cs.umass.edu
Sun Jan 27 07:08:01 AEST 1991


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 at cs.umass.edu



More information about the Comp.unix.internals mailing list