home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / programm / 5174 < prev    next >
Encoding:
Internet Message Format  |  1992-11-06  |  1.9 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!olivea!charnel!rat!zeus!kwang
  2. From: kwang@zeus.calpoly.edu (Kevin Wang aka The Scarecrow)
  3. Newsgroups: comp.unix.programmer
  4. Subject: RS6000 aix 3.2x & signals
  5. Message-ID: <1992Nov05.215739.186245@zeus.calpoly.edu>
  6. Date: 5 Nov 92 21:57:39 GMT
  7. Followup-To: poster
  8. Organization: The Outland Riders
  9. Lines: 46
  10.  
  11. NOTE: I DO NOT READ THIS NEWSGROUP REGULARLY. PLEASE EMAIL ME DIRECTLY
  12.  
  13. Apparently, the sigvec() either doesn't work right, or SIGIO is
  14. specifically broken... can anyone confirm/deny this?
  15.  
  16. The fd's that I should be getting input are internet stream sockets.
  17.  
  18. Also, a similar symptom is when using just signal() (different program)
  19. accept() does not return EINTR when interrupted by a SIGALRM, but then
  20. again, it isn't listed on the man pages either (how bass ackwards CAN
  21. ibm get?).
  22.  
  23. Here's the code that uses the SIGIO:
  24.  
  25. FUNCTION int WhosNext(int sock, inetfulladdr *addr, int *addrlen, int *insock)
  26. {  /* insock=-1 for interrupted accept & returns CLIENT, else returns REMOTE */
  27.     /* look for new client, or wait for SIGIO from existing clients */
  28.     struct sigvec sigctrl;
  29.     
  30.     sigctrl.sv_handler = AlarmHandler;
  31.     sigctrl.sv_mask = SIGIO;
  32.     sigctrl.sv_flags = 0;
  33.     sigvec(SIGIO, &sigctrl, NULL);
  34.     puts("Waiting for new");
  35.     *insock = AcceptConnect(sock, addr, addrlen); 
  36.     puts("going...");
  37.     sigctrl.sv_handler = SIG_IGN;
  38.     sigctrl.sv_mask = 0;
  39.     sigvec(SIGIO, &sigctrl, NULL);
  40.     if (-1 != *insock)
  41.         {  /* if not interrupted by SIGIO */
  42.         if (REMOTE == RecvHeader(*insock, DEFAULT_TIMEOUT))
  43.             return(REMOTE);
  44.         }
  45. /* else 1: sigio interrupted, and not remote 2: normal accept, not remote */
  46.     return(CLIENT);
  47. }
  48.  
  49.    - kevin Wang
  50. ...And now, for your local station identification, on the hour, every hour...
  51. kwang@nike.calpoly.edu or kwang@gauss.elee.calpoly.edu
  52. ---
  53.    "The angle of the dangle,
  54.     is inversely proportional
  55.     to the heat of the meat,
  56.     while the mass of the ass is constant."
  57.