sigvec()

examine and change signal action 

Function


SYNOPSIS

#include <signal.h>

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


DESCRIPTION

The sigvec() function examines and changes the signal action. Specifically, it allows the calling process to examine and/or specify the action that is taken when a specific signal is delivered.

sig specifies the signal and can be assigned any signal except SIGKILL or SIGSTOP.

If vec is not NULL, it points to a structure that specifies the new action associated with the specified signal. If vec is NULL, the sigvec() call does not change the signal handling and the call can be used to enquire about the current handling of a given signal. If ovec is not NULL, the action previously associated with the signal is stored in the location that ovec points to.

If sigvec() fails, no new signal handler is installed.

The sigvec structure contains the following members:

(*sv_handler)();   /* signal handler */
int sv_mask;                          /* signal mask to apply */ 
int sv_flags;                         /* see signal options */

sv_handler specifies the disposition of the signal, and may take either a pointer to a signal handler function, or may take the value SIG_DFL or SIG_IGN.

sv_mask specifies the set of signals to be blocked while the signal handler is active. On entry to the signal handler, that set of signals is added to the set of signals already being blocked when the signal is delivered. SIGSTOP and SIGKILL cannot be blocked (the system silently enforces this restriction.

The following bits may be set in sv_flags:

SV_ONSTACK  

Signal is to be delivered using signal stack.

SV_RESETHAND  

If set and the signal is caught, the disposition of the signal is reset to SIG_DFL and the signal is not blocked on entry to the signal handler.

SV_INTERRUPT  

If set and the signal is caught, a system call that is interrupted by the execution of this signal's handler returns -1 with errno set to EINTR. If this flag is not set, some system calls are transparently restarted when signals are delivered.

After a fork(), or vfork() the child inherits all signals, the signal mask, and the restart/interrupt and reset-signal-handler flags.

The exec() family of functions resets all caught signals to SIG_DFL. Ignored signals remain ignored; the signal mask remains the same; signals that interrupt system calls continue to do so.


PARAMETERS

sig 

Is the signal number.

vec 

Points to a structure that specifies a new signal action.

ovec 

Is a return pointer to a structure for holding the old signal action.


RETURN VALUES

If successful, sigvec() returns zero. On failure, sigvec() returns a value of -1 and sets errno to one of the following values:

EFAULT 

Either vec or ovec is an invalid pointer.

EINVAL 

sig is not a valid signal number. An attempt was made to ignore or supply a handler for SIGKILL or SIGSTOP.


CONFORMANCE

BSD 4.4, with exceptions.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

The SV_ONSTACK bit is silently ignored by the NuTCRACKER Platform.

Most system calls are not automatically restartable.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

api_intro

Functions:
_NutForkExecl(), _NutForkExecle(), _NutForkExeclp(), _NutForkExeclpe(), _NutForkExecv(), _NutForkExecve(), _NutForkExecvp(), _NutForkExecvpe(), execl(), execle(), execlp(), execlpe(), execv(), execve(), execvpe(), execvpe(), exit(), fork(), kill(), pause(), pthread_sigmask(), sigdelset(), sigemptyset(), sigfillset(), sigismember(), signal(), sigprocmask(), sigsuspend(), vfork(), wait(), waitpid()


PTC MKS Toolkit 10.4 Documentation Build 39.