[Gllug] 'sigset' function
Nix
nix at esperi.demon.co.uk
Tue Mar 25 08:28:39 UTC 2003
On Mon, 24 Mar 2003, t. clarke uttered the following:
> Hi
> I am converting some SCO software over to linux and one of the programs uses
> the sigset function.
OK.
> The program compiles and links, but with a warning about not casting a pointer
> from an integer. This appears to be due to a call along the lines of:
> a=sigset(......) where a is defined as a pointer to a function.
> I assume that this error occurs because there is no prototype for sigset within
> the <signal.h> header file and the compiler accordingly assumes a default int
> return from the sigset function.
Yes, it exists --- but it's intentionally undocumented by the glibc
folks, because sigaction() is the preferred function; sigaction() lets
you specify what happens to the signal disposition when the signal
handler is invoked, and much else.
> I cannot find any manual page within the linux software (Redhat 7.1) that
> mentions sigset -
No, the *link* would fail.
The canonical reference is POSIX.1:
<http://www.opengroup.org/onlinepubs/007904975/functions/sigset.html>.
> but presumably the function actually exists otherwise the
> compile would fail completely !
It does. You aren't specifying what standard you're writing against, so glibc
assumes POSIX 1003.1c-1995, which does *not* include sigset() and friends.
You'll want to #define _XOPEN_SOURCE 500 (at least) for sigset().
(See `info libc Feature' and the top of /usr/include/features.h.)
> I am reluctant to amend the code to use
> 'signal' as I understand this mechanism is unreliable. Sigaction gave me a few
> problems with SCO which is why I used sigset (simpler calling sequence anyway!).
Bleah, SCO. I'd autoconf up a test for whatever the SCO problem was and
work around it only on SCO, myself...
Anyway,
#define _XOPEN_SOURCE 500
should fix your immediate problems.
--
#ifdef USE_ISPTS_FLAG
} else { /* else pty, not pts */
#endif
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list