Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!dgeorge From: dgeorge@svax.cs.cornell.edu (David George) Newsgroups: comp.sys.hp Subject: Enabling SIGIO interrupts on stream sockets Message-ID: <29216@cornell.UUCP> Date: 21 Jun 89 20:08:18 GMT Sender: nobody@cornell.UUCP Reply-To: dwg@terra.graphics.cornell.edu (David George) Distribution: comp.sys.hp Organization: Cornell Univ. Program of Computer Graphics, Ithaca NY Lines: 25 I'm trying to trap to a handler routine each time that data becomes available on a stream-type communication socket. I'm using HP-UX on a Series 800 machine (HP Release A.B3.00.5B). The HP manuals suggest the following sequence of commands: pid = getpid(); arg = 1; signal(SIGIO, my_handling_routine); ioctl(fildes, FIOSSAIOOWN, &pid); ioctl(fildes, FIOSSAIOSTAT, &arg); So now a SIGIO signal should be generated each time that data becomes available on socket fildes. Instead, I get an "Operation not supported on socket" error for the first ioctl() call. A 4.3BSD Tutorial gave the alternative solution: signal(SIGIO, my_handling_routine); fcntl(fildes, F_SETOWN, getpid()); fcntl(fildes, F_SETFL, FASYNC); But F_SETOWN and FASYNC are not defined on my system. Any ideas? Dave George