From manpage of signal()
http://man7.org/linux/man-pages/man2/signal.2.html
NAME top
signal - ANSI C signal handling
SYNOPSIS top
#include <signal.h> typedef void (*sighandler_t)(int); sighandler_t signal(int signum, sighandler_t handler);
The situation on Linux is as follows:
* The kernel's signal() system call provides System V semantics. * By default, in glibc 2 and later, the signal() wrapper function does not invoke the kernel system call. Instead, it calls sigaction(2) using flags that supply BSD semantics. This default behavior is provided as long as a suitable feature test macro is defined: _BSD_SOURCE on glibc 2.19 and earlier or _DEFAULT_SOURCE in glibc 2.19 and later. (By default, these macros are defined; see feature_test_macros(7) for details.) If such a feature test macro is not defined, then signal() provides System V semantics.
The quote seems to me that signal()
is not a system call but a wrapper function implemented based on system call sigaction()
, except "The kernel's signal() system call".
So is signal()
a system call function or not on Linux?