home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / sgi / 16796 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  1.4 KB

  1. Path: sparky!uunet!olivea!sgigate!odin!xanadu.wpd.sgi.com!pal
  2. From: pal@xanadu.wpd.sgi.com (Anil Pal)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: C++ signal problem
  5. Message-ID: <1992Nov23.212938.15119@odin.corp.sgi.com>
  6. Date: 23 Nov 92 21:29:38 GMT
  7. References: <1992Nov18.220409.12513@eagle.lerc.nasa.gov>
  8. Sender: news@odin.corp.sgi.com (Net News)
  9. Reply-To: pal@wpd.sgi.com
  10. Organization: Silicon Graphics, Inc.
  11. Lines: 30
  12. Nntp-Posting-Host: xanadu.wpd.sgi.com
  13.  
  14. In article <1992Nov18.220409.12513@eagle.lerc.nasa.gov>, xxbja@bonsai.lerc.nasa.gov (Betty Jo Armstead) writes:
  15. |> Subject: C++ signal problem
  16. |> I am trying to compile a C++ program that contains signals.
  17. |> 
  18. |> Gets the following error:
  19. |> 
  20. |>   "display.C" line 520 error: bad argument 2 for signal(): void (*)(int)
  21. |> ( void (*)(int...)expected)
  22.  
  23. According to the definition of signal, contained in the header file
  24. /usr/include/sys/signal.h, and described in the man page for signal(2),
  25. the handler function (called termstop in your case) passed to signal is
  26. expected to be declared as
  27.  
  28.     void termstop(int, ...)
  29.     {
  30.         // Body of signal handler
  31.     }
  32.  
  33. It is invoked as
  34.  
  35.     termstop(int sig, int code, struct sigcontext *sc);
  36.  
  37. If your application does not make use of the additional arguments to
  38. the handler, the  simply adding the ellipsis to the definition of
  39. termstop, as shown above, should suffice.
  40.  
  41. -- 
  42. Anil A. Pal
  43. pal@sgi.com    (415)-390-5279
  44.