Signal-management APIs

Applications are provided with various APIs for managing signals; we shall take a look at few of the important ones:

  1. Sigaction(): User-mode processes use the POSIX API sigaction() to examine or change the disposition of a signal. This API provides a variety of attribute flags that can further define the behavior of a signal:
 #include <signal.h> int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); The sigaction structure is defined as something like: struct sigaction { void (*sa_handler)(int); void (*sa_sigaction)(int, siginfo_t *, void *); sigset_t sa_mask; int sa_flags; void (*sa_restorer)(void); };
  • int signum is the identifier number of a recognized signal. sigaction() examines and ...

Get Mastering Linux Kernel Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.