sigset (2)
Leading comments
Copyright (c) 1983, 1991, 1993 The Regents of the University of California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the fol...
NAME
sighold sigignore sigpause sigrelse sigset - legacy interface for signal managementLIBRARY
Lb libcSYNOPSIS
In signal.h Ft int Fn sighold int sig Ft int Fn sigignore int sig Ft int Fn xsi_sigpause int sigmask Ft int Fn sigrelse int sig Ft void (*)(int) Fn sigset int void (*disp)(int) Ft int Fn sigpause int sigmaskDESCRIPTION
This interface is made obsolete by sigsuspend(2) and sigaction(2).The Fn sigset function modifies signal dispositions. The Fa sig argument specifies the signal, which may be any signal except SIGKILL and SIGSTOP The Fa disp argument specifies the signal's disposition, which may be SIG_DFL SIG_IGN or the address of a signal handler. If Fn sigset is used, and Fa disp is the address of a signal handler, the system adds Fa sig to the signal mask of the calling process before executing the signal handler; when the signal handler returns, the system restores the signal mask of the calling process to its state prior to the delivery of the signal. In addition, if Fn sigset is used, and Fa disp is equal to SIG_HOLD Fa sig is added to the signal mask of the calling process and Fa sig 's disposition remains unchanged. If Fn sigset is used, and Fa disp is not equal to SIG_HOLD Fa sig is removed from the signal mask of the calling process.
The Fn sighold function adds Fa sig to the signal mask of the calling process.
The Fn sigrelse function removes Fa sig from the signal mask of the calling process.
The Fn sigignore function sets the disposition of Fa sig to SIG_IGN
The Fn xsi_sigpause function removes Fa sig from the signal mask of the calling process and suspend the calling process until a signal is received. The Fn xsi_sigpause function restores the signal mask of the process to its original state before returning.
The Fn sigpause function assigns Fa sigmask to the set of masked signals and then waits for a signal to arrive; on return the set of masked signals is restored. The Fa sigmask argument is usually 0 to indicate that no signals are to be blocked.
RETURN VALUES
The Fn sigpause and Fn xsi_sigpause functions always terminate by being interrupted, returning -1 with errno set to Er EINTR .Upon successful completion, Fn sigset returns SIG_HOLD if the signal had been blocked and the signal's previous disposition if it had not been blocked. Otherwise, SIG_ERR is returned and errno set to indicate the error.
For all other functions, upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error:
- Bq Er EINVAL
- The Fa sig argument is not a valid signal number.
- Bq Er EINVAL
- For Fn sigset and Fn sigignore functions, an attempt was made to catch or ignore SIGKILL or SIGSTOP