1raise(3)                   Library Functions Manual                   raise(3)
2
3
4

NAME

6       raise - send a signal to the caller
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <signal.h>
13
14       int raise(int sig);
15

DESCRIPTION

17       The  raise()  function sends a signal to the calling process or thread.
18       In a single-threaded program it is equivalent to
19
20           kill(getpid(), sig);
21
22       In a multithreaded program it is equivalent to
23
24           pthread_kill(pthread_self(), sig);
25
26       If the signal causes a handler to be called, raise() will  return  only
27       after the signal handler has returned.
28

RETURN VALUE

30       raise() returns 0 on success, and nonzero for failure.
31

ATTRIBUTES

33       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
34       tributes(7).
35
36       ┌────────────────────────────────────────────┬───────────────┬─────────┐
37Interface                                   Attribute     Value   
38       ├────────────────────────────────────────────┼───────────────┼─────────┤
39raise()                                     │ Thread safety │ MT-Safe │
40       └────────────────────────────────────────────┴───────────────┴─────────┘
41

STANDARDS

43       C11, POSIX.1-2008.
44

HISTORY

46       POSIX.1-2001, C89.
47
48       Since glibc 2.3.3, raise() is implemented by calling tgkill(2), if  the
49       kernel  supports  that  system  call.  Older glibc versions implemented
50       raise() using kill(2).
51

SEE ALSO

53       getpid(2), kill(2), sigaction(2), signal(2), pthread_kill(3), signal(7)
54
55
56
57Linux man-pages 6.04              2023-03-30                          raise(3)
Impressum