home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!bu.edu!cs!tasos
- From: tasos@cs.bu.edu (Anastasios Kotsikonas)
- Newsgroups: comp.unix.sys5.r3
- Subject: Re: how to get SIGIO
- Message-ID: <100856@bu.edu>
- Date: 6 Nov 92 17:34:53 GMT
- References: <100320@bu.edu> <Bx5yE7.DDn@flatlin.ka.sub.org>
- Sender: news@bu.edu
- Organization: Computer Science Department, Boston University, Boston, MA, USA
- Lines: 68
-
- In article <Bx5yE7.DDn@flatlin.ka.sub.org> bad@flatlin.ka.sub.org (Christoph Badura) writes:
- >In <100320@bu.edu> tasos@cs.bu.edu (Anastasios Kotsikonas) writes:
- >
- >>I am trying to write a client that does async socket I/O but I cannot grab the
- >>SIGIO signal:
- >>but I never get it; I only have this problem on certain SVR3 systems (SGI's
- >>system works as expected).
- >
- >You have to tell us more. Especially what version of UNIX you're
- >trying this on and what your code looks like.
- >
- >All that can be said now is that certain (in fact most) SVR3 systems
- >don't support SIGIO.
-
- Here are excerpts of the code:
-
- First catch the signals:
-
- signal (SIGIO, (void (*)()) urg_data);
- signal (SIGURG, (void (*)()) urg_data);
-
- then once I have the socket:
-
- #ifdef sco
- if (ioctl (sock_fd, I_SETSIG, S_INPUT) < 0) {
- perror ("Cannot set SIGIO");
- return -1;
- }
- #else
- # ifdef F_SETOWN
- if (fcntl (sock_fd, F_SETOWN, getpid()) < 0) {
- perror ("Cannot assign socket to process group");
- return -1;
- }
- # elif defined (SIOCSPGRP)
- value = -getpid();
- if (ioctl (sock_fd, SIOCSPGRP, (char *) &value) < 0) {
- perror ("Cannot assign socket to process group");
- return -1;
- }
- # else
- perror ("Cannot assign socket to process group");
- return -1;
- # endif
- # ifdef FASYNC
- if (fcntl (sock_fd, F_SETFL, (fcntl (sock_fd, F_GETFL, 0) | FASYNC)) < 0) {
- perror ("Cannot set asynchronous I/O for socket");
- return -1;
- }
- # elif defined (FIOASYNC)
- value = 1;
- if (ioctl (sock_fd, FIOASYNC, (char *) &value) < 0) {
- perror ("Cannot set asynchronous I/O for socket");
- return -1;
- }
- # else
- perror ("Cannot set asynchronous I/O for socket");
- return -1;
- # endif
- #endif
- return sock_fd;
-
-
- Any help will be greatly appreciated.
-
- Tasos
-
- PS: and BTW, I disagree with your .signature: AIX is the worst UNIX I have
-