In C language process signal set related operation functions

  • 2020-04-02 03:21:25
  • OfStack

C language sigismember() function: test whether a signal has been added to the signal
Header: #include < Signal. H >

Function: int sigismember(const sigset_t *set, int signum);

Sigismember () is used to test whether the signal represented by the parameter signum has been added to the parameter set signal set.

Return value: if the signal is in the signal set, return 1; if not, return 0. If there is an error, return -1.

Error code:
1. The address of the EFAULT parameter set pointer cannot be accessed.
2. Illegal signal number of EINVAL parameter signum.

C language sigfillset() function: to add all signals to the signal set
Header: #include < Signal. H >

Function: int sigfillset(sigset_t * set);

Sigfillset () is used to initialize the parameter set signal set and then add all the signals to the signal set.

Return value: 0 on success or -1 on error.

Note: the EFAULT parameter set pointer address cannot be accessed.

C language sigemptyset() function: initializes the signal set
Header: #include < Signal. H >

Function: int sigemptyset(sigset_t *set);

Sigemptyset () is used to initialize and empty the set signal set.

Return value: 0 on success or -1 on error.

Error code: the EFAULT parameter set pointer address cannot be accessed.


Related articles: