Path: utzoo!attcan!uunet!ogicse!littlei!intelisc!joel From: joel@isc.intel.com (Joel Clark) Newsgroups: comp.unix.programmer Subject: Re: Hey, what about SIGIO? Message-ID: <941@intelisc.isc.intel.com> Date: 28 Sep 90 00:51:52 GMT References: <1990Sep26.184409.10155@athena.mit.edu> Distribution: comp Organization: Intel Scientific Computers, Beaverton, OR Lines: 37 In article <1990Sep26.184409.10155@athena.mit.edu> jik@athena.mit.edu (Jonathan I. Kamens) writes: >In article , lush@EE.MsState.Edu (Edward Luke) writes: >|> I would like to get a signal when new data arrives on an >|> input file descriptor, or when an output file descriptor is free to be >|> filled again. Is it possible for me to do this without using fork() >|> Just what is the SIGIO signal for? > > See the man page fcntl(2). You want to use the F_SETOWN fcntl call on the >..... > Oh, you'll also get SIGURG when there is an "urgent condition" on a socket; ^^^^^^^^^^^^^^^^ >I'm not completely sure what an "urgent condition" is, perhaps that's what >they call a premature closing of the other end of the socket or something. >-- >Jonathan Kamens USnail: >MIT Project Athena 11 Ashford Terrace >jik@Athena.MIT.EDU Allston, MA 02134 >Office: 617-253-8495 Home: 617-782-0710 An "urgent condition" is when Out Of Band data arrives. This is data sent with the MSG_OOB flag set. i.e. "send(fd,buf,buflen,MSG_OOB)" This is generally used to send signals such as interrupt when a DEL key is hit. Thus the receiving process can handle the SIGURG signal by reading and tossing all the data in the socket upto the MSG_OOB data if this is what it needs to do. Joel Clark Intel Scientific Computers joel@isc.intel.com line fodder