Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sigaction(3) [ultrix man page]

sigaction(3)						     Library Functions Manual						      sigaction(3)

Name
       sigaction - software signal facilities (POSIX)

Syntax
       #include <signal.h>

       struct sigaction {
       void  (*sa_handler)();
       sigset_t sa_mask;
       int   sa_flags;
       };

       int sigaction(sig, vec, ovec)
       int sig;
       struct sigaction *vec, *ovec;

Description
       The sigaction call is the POSIX equivalent to the system call. This call behaves as described on the reference page with the following mod-
       ifications:

       o    The signal mask is manipulated using the functions.

       o    A process can suppress the generation of the SIGCHLD when a child stops by setting the SA_NOCLDSTOP bit in sa_flags.

       o    The SV_INTERRUPT flag is always set by the system when using in POSIX mode. The flag is set so that interrupted system calls will fail
	    with the EINTR error instead of getting restarted.

Return Values
       A  0  return value indicated that the call succeeded.  A -1 return value indicates an error occurred and errno is set to indicated the rea-
       son.

Diagnostics
       The system call fails and a new signal handler is not installed if one of the following occurs:

       [EFAULT]       Either vec or ovec points to memory which is not a valid part of the process address space.

       [EINVAL]       Sig is not a valid signal number.

       [EINVAL]       An attempt is made to ignore or supply a handler for SIGKILL or SIGSTOP.

See Also
       sigvec(2), sigsetops(3), sigprocmask(3), sigsuspend(3), sigpending(2), setjmp(3), siginterrupt(3), tty(4)

																      sigaction(3)

Check Out this Related Man Page

siginterrupt(3C)					   Standard C Library Functions 					  siginterrupt(3C)

NAME
siginterrupt - allow signals to interrupt functions SYNOPSIS
#include <signal.h> int siginterrupt(int sig, int flag); DESCRIPTION
The siginterrupt() function changes the restart behavior when a function is interrupted by the specified signal. The function siginter- rupt(sig, flag) has an effect as if implemented as: siginterrupt(int sig, int flag) { int ret; struct sigaction act; (void) sigaction(sig, NULL, &act); if (flag) act.sa_flags &= SA_RESTART; else act.sa_flags |= SA_RESTART; ret = sigaction(sig, &act, NULL); return ret; } RETURN VALUES
Upon successful completion, siginterrupt() returns 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The siginterrupt() function will fail if: EINVAL The sig argument is not a valid signal number. USAGE
The siginterrupt() function supports programs written to historical system interfaces. A standard-conforming application, when being writ- ten or rewritten, should use sigaction(2) with the SA_RESTART flag instead of siginterrupt(). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
sigaction(2), signal.h(3HEAD), attributes(5), standards(5) SunOS 5.11 1 Sep 2003 siginterrupt(3C)
Man Page