home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!olivea!charnel!rat!zeus!kwang
- From: kwang@zeus.calpoly.edu (Kevin Wang aka The Scarecrow)
- Newsgroups: comp.unix.programmer
- Subject: RS6000 aix 3.2x & signals
- Message-ID: <1992Nov05.215739.186245@zeus.calpoly.edu>
- Date: 5 Nov 92 21:57:39 GMT
- Followup-To: poster
- Organization: The Outland Riders
- Lines: 46
-
- NOTE: I DO NOT READ THIS NEWSGROUP REGULARLY. PLEASE EMAIL ME DIRECTLY
-
- Apparently, the sigvec() either doesn't work right, or SIGIO is
- specifically broken... can anyone confirm/deny this?
-
- The fd's that I should be getting input are internet stream sockets.
-
- Also, a similar symptom is when using just signal() (different program)
- accept() does not return EINTR when interrupted by a SIGALRM, but then
- again, it isn't listed on the man pages either (how bass ackwards CAN
- ibm get?).
-
- Here's the code that uses the SIGIO:
-
- FUNCTION int WhosNext(int sock, inetfulladdr *addr, int *addrlen, int *insock)
- { /* insock=-1 for interrupted accept & returns CLIENT, else returns REMOTE */
- /* look for new client, or wait for SIGIO from existing clients */
- struct sigvec sigctrl;
-
- sigctrl.sv_handler = AlarmHandler;
- sigctrl.sv_mask = SIGIO;
- sigctrl.sv_flags = 0;
- sigvec(SIGIO, &sigctrl, NULL);
- puts("Waiting for new");
- *insock = AcceptConnect(sock, addr, addrlen);
- puts("going...");
- sigctrl.sv_handler = SIG_IGN;
- sigctrl.sv_mask = 0;
- sigvec(SIGIO, &sigctrl, NULL);
- if (-1 != *insock)
- { /* if not interrupted by SIGIO */
- if (REMOTE == RecvHeader(*insock, DEFAULT_TIMEOUT))
- return(REMOTE);
- }
- /* else 1: sigio interrupted, and not remote 2: normal accept, not remote */
- return(CLIENT);
- }
-
- - kevin Wang
- ...And now, for your local station identification, on the hour, every hour...
- kwang@nike.calpoly.edu or kwang@gauss.elee.calpoly.edu
- ---
- "The angle of the dangle,
- is inversely proportional
- to the heat of the meat,
- while the mass of the ass is constant."
-