home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!sgigate!odin!xanadu.wpd.sgi.com!pal
- From: pal@xanadu.wpd.sgi.com (Anil Pal)
- Newsgroups: comp.sys.sgi
- Subject: Re: C++ signal problem
- Message-ID: <1992Nov23.212938.15119@odin.corp.sgi.com>
- Date: 23 Nov 92 21:29:38 GMT
- References: <1992Nov18.220409.12513@eagle.lerc.nasa.gov>
- Sender: news@odin.corp.sgi.com (Net News)
- Reply-To: pal@wpd.sgi.com
- Organization: Silicon Graphics, Inc.
- Lines: 30
- Nntp-Posting-Host: xanadu.wpd.sgi.com
-
- In article <1992Nov18.220409.12513@eagle.lerc.nasa.gov>, xxbja@bonsai.lerc.nasa.gov (Betty Jo Armstead) writes:
- |> Subject: C++ signal problem
- |> I am trying to compile a C++ program that contains signals.
- |>
- |> Gets the following error:
- |>
- |> "display.C" line 520 error: bad argument 2 for signal(): void (*)(int)
- |> ( void (*)(int...)expected)
-
- According to the definition of signal, contained in the header file
- /usr/include/sys/signal.h, and described in the man page for signal(2),
- the handler function (called termstop in your case) passed to signal is
- expected to be declared as
-
- void termstop(int, ...)
- {
- // Body of signal handler
- }
-
- It is invoked as
-
- termstop(int sig, int code, struct sigcontext *sc);
-
- If your application does not make use of the additional arguments to
- the handler, the simply adding the ellipsis to the definition of
- termstop, as shown above, should suffice.
-
- --
- Anil A. Pal
- pal@sgi.com (415)-390-5279
-