Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
posix_signal.h File Reference
#include <zephyr/toolchain.h>
#include <zephyr/sys/util.h>
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  timespec
struct  sigset_t
struct  pthread_attr_t
struct  sigevent_t
union  sigval
struct  sigaction
struct  mcontext_t
struct  ucontext_t
struct  stack_t
struct  siginfo_t

Macros

#define SIG_HOLD   ((void *)-2)
#define SIGRTMIN   32
#define SIGRTMAX   (SIGRTMIN + CONFIG_POSIX_RTSIG_MAX)
#define SIGEV_NONE   1
#define SIGEV_SIGNAL   2
#define SIGEV_THREAD   3
#define SIG_BLOCK   1
#define SIG_UNBLOCK   2
#define SIG_SETMASK   0
#define SA_NOCLDSTOP   0x00000001
#define SA_ONSTACK   0x00000002
#define SA_RESETHAND   0x00000004
#define SA_RESTART   0x00000008
#define SA_SIGINFO   0x00000010
#define SA_NOCLDWAIT   0x00000020
#define SA_NODEFER   0x00000040
#define SS_ONSTACK   0x00000001
#define SS_DISABLE   0x00000002
#define MINSIGSTKSZ   4096
#define SIGSTKSZ   4096
#define SIGHUP   1
 Hangup.
#define SIGINT   2
 Interrupt.
#define SIGQUIT   3
 Quit.
#define SIGILL   4
 Illegal instruction.
#define SIGTRAP   5
 Trace/breakpoint trap.
#define SIGABRT   6
 Aborted.
#define SIGBUS   7
 Bus error.
#define SIGFPE   8
 Arithmetic exception.
#define SIGKILL   9
 Killed.
#define SIGUSR1   10
 User-defined signal 1.
#define SIGSEGV   11
 Invalid memory reference.
#define SIGUSR2   12
 User-defined signal 2.
#define SIGPIPE   13
 Broken pipe.
#define SIGALRM   14
 Alarm clock.
#define SIGTERM   15
 Terminated.
#define SIGCHLD   17
 Child status changed.
#define SIGCONT   18
 Continued.
#define SIGSTOP   19
 Stop executing.
#define SIGTSTP   20
 Stopped.
#define SIGTTIN   21
 Stopped (read)
#define SIGTTOU   22
 Stopped (write)
#define SIGURG   23
 Urgent I/O condition.
#define SIGXCPU   24
 CPU time limit exceeded.
#define SIGXFSZ   25
 File size limit exceeded.
#define SIGVTALRM   26
 Virtual timer expired.
#define SIGPROF   27
 Profiling timer expired.
#define SIGPOLL   29
 Pollable event occurred.
#define SIGSYS   31
 Bad system call.
#define ILL_ILLOPC   1
 Illegal opcode.
#define ILL_ILLOPN   2
 Illegal operand.
#define ILL_ILLADR   3
 Illegal addressing mode.
#define ILL_ILLTRP   4
 Illegal trap.
#define ILL_PRVOPC   5
 Privileged opcode.
#define ILL_PRVREG   6
 Privileged register.
#define ILL_COPROC   7
 Coprocessor error.
#define ILL_BADSTK   8
 Internal stack error.
#define FPE_INTDIV   9
 Integer divide by zero.
#define FPE_INTOVF   10
 Integer overflow.
#define FPE_FLTDIV   11
 Floating-point divide by zero.
#define FPE_FLTOVF   12
 Floating-point overflow.
#define FPE_FLTUND   13
 Floating-point underflow.
#define FPE_FLTRES   15
 Floating-point inexact result.
#define FPE_FLTINV   16
 Invalid floating-point operation.
#define FPE_FLTSUB   17
 Subscript out of range.
#define SEGV_MAPERR   18
 Address not mapped to object.
#define SEGV_ACCERR   19
 Invalid permissions for mapped object.
#define BUS_ADRALN   20
 Invalid address alignment.
#define BUS_ADRERR   21
 Nonexistent physical address.
#define BUS_OBJERR   22
 Object-specific hardware error.
#define TRAP_BRKPT   23
 Process breakpoint.
#define TRAP_TRACE   24
 Process trace trap.
#define CLD_EXITED   25
 Child has exited.
#define CLD_KILLED   26
 Child has terminated abnormally and did not create a core file.
#define CLD_DUMPED   27
 Child has terminated abnormally and created a core file.
#define CLD_TRAPPED   28
 Traced child has trapped.
#define CLD_STOPPED   29
 Child has stopped.
#define CLD_CONTINUED   30
 Stopped child has continued.
#define POLL_IN   31
 Data input available.
#define POLL_OUT   32
 Output buffers available.
#define POLL_MSG   33
 Input message available.
#define POLL_ERR   34
 I/O error.
#define POLL_PRI   35
 High priority input available.
#define POLL_HUP   36
 Device disconnected.
#define SI_USER   37
 Signal sent by kill()
#define SI_QUEUE   38
 Signal sent by sigqueue()
#define SI_TIMER   39
 Signal generated by expiration of a timer set by timer_settime()
#define SI_ASYNCIO   40
 Signal generated by completion of an asynchronous I/O request.
#define SI_MESGQ   41
 Signal generated by arrival of a message on an empty message queue.

Typedefs

typedef unsigned int pthread_t
typedef int uid_t
typedef long time_t
typedef long pid_t
typedef void(* sighandler_t) (int sig)

Functions

int kill (pid_t pid, int sig)
int killpg (pid_t pgrp, int sig)
void psiginfo (const siginfo_t *info, const char *message)
void psignal (int sig, const char *message)
int pthread_kill (pthread_t thread, int sig)
int pthread_sigmask (int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset)
 TOOLCHAIN_DISABLE_WARNING (TOOLCHAIN_WARNING_SHADOW)
int sigaction (int sig, const struct sigaction *ZRESTRICT act, struct sigaction *ZRESTRICT oact)
 TOOLCHAIN_ENABLE_WARNING (TOOLCHAIN_WARNING_SHADOW)
int sigaddset (sigset_t *set, int sig)
int sigaltstack (const stack_t *ZRESTRICT ss, stack_t *ZRESTRICT oss)
int sigdelset (sigset_t *set, int sig)
int sigemptyset (sigset_t *set)
int sigfillset (sigset_t *set)
int sighold (int sig)
int sigignore (int sig)
int siginterrupt (int sig, int flag)
int sigismember (const sigset_t *set, int sig)
int sigpause (int sig)
int sigpending (sigset_t *set)
int sigprocmask (int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset)
int sigqueue (pid_t pid, int sig, union sigval value)
int sigrelse (int sig)
sighandler_t sigset (int sig, sighandler_t disp)
int sigsuspend (const sigset_t *set)
int sigtimedwait (const sigset_t *ZRESTRICT set, siginfo_t *ZRESTRICT info, const struct timespec *ZRESTRICT timeout)
int sigwait (const sigset_t *ZRESTRICT set, int *ZRESTRICT sig)
int sigwaitinfo (const sigset_t *ZRESTRICT set, siginfo_t *ZRESTRICT info)

Macro Definition Documentation

◆ BUS_ADRALN

#define BUS_ADRALN   20

Invalid address alignment.

◆ BUS_ADRERR

#define BUS_ADRERR   21

Nonexistent physical address.

◆ BUS_OBJERR

#define BUS_OBJERR   22

Object-specific hardware error.

◆ CLD_CONTINUED

#define CLD_CONTINUED   30

Stopped child has continued.

◆ CLD_DUMPED

#define CLD_DUMPED   27

Child has terminated abnormally and created a core file.

◆ CLD_EXITED

#define CLD_EXITED   25

Child has exited.

◆ CLD_KILLED

#define CLD_KILLED   26

Child has terminated abnormally and did not create a core file.

◆ CLD_STOPPED

#define CLD_STOPPED   29

Child has stopped.

◆ CLD_TRAPPED

#define CLD_TRAPPED   28

Traced child has trapped.

◆ FPE_FLTDIV

#define FPE_FLTDIV   11

Floating-point divide by zero.

◆ FPE_FLTINV

#define FPE_FLTINV   16

Invalid floating-point operation.

◆ FPE_FLTOVF

#define FPE_FLTOVF   12

Floating-point overflow.

◆ FPE_FLTRES

#define FPE_FLTRES   15

Floating-point inexact result.

◆ FPE_FLTSUB

#define FPE_FLTSUB   17

Subscript out of range.

◆ FPE_FLTUND

#define FPE_FLTUND   13

Floating-point underflow.

◆ FPE_INTDIV

#define FPE_INTDIV   9

Integer divide by zero.

◆ FPE_INTOVF

#define FPE_INTOVF   10

Integer overflow.

◆ ILL_BADSTK

#define ILL_BADSTK   8

Internal stack error.

◆ ILL_COPROC

#define ILL_COPROC   7

Coprocessor error.

◆ ILL_ILLADR

#define ILL_ILLADR   3

Illegal addressing mode.

◆ ILL_ILLOPC

#define ILL_ILLOPC   1

Illegal opcode.

◆ ILL_ILLOPN

#define ILL_ILLOPN   2

Illegal operand.

◆ ILL_ILLTRP

#define ILL_ILLTRP   4

Illegal trap.

◆ ILL_PRVOPC

#define ILL_PRVOPC   5

Privileged opcode.

◆ ILL_PRVREG

#define ILL_PRVREG   6

Privileged register.

◆ MINSIGSTKSZ

#define MINSIGSTKSZ   4096

◆ POLL_ERR

#define POLL_ERR   34

I/O error.

◆ POLL_HUP

#define POLL_HUP   36

Device disconnected.

◆ POLL_IN

#define POLL_IN   31

Data input available.

◆ POLL_MSG

#define POLL_MSG   33

Input message available.

◆ POLL_OUT

#define POLL_OUT   32

Output buffers available.

◆ POLL_PRI

#define POLL_PRI   35

High priority input available.

◆ SA_NOCLDSTOP

#define SA_NOCLDSTOP   0x00000001

◆ SA_NOCLDWAIT

#define SA_NOCLDWAIT   0x00000020

◆ SA_NODEFER

#define SA_NODEFER   0x00000040

◆ SA_ONSTACK

#define SA_ONSTACK   0x00000002

◆ SA_RESETHAND

#define SA_RESETHAND   0x00000004

◆ SA_RESTART

#define SA_RESTART   0x00000008

◆ SA_SIGINFO

#define SA_SIGINFO   0x00000010

◆ SEGV_ACCERR

#define SEGV_ACCERR   19

Invalid permissions for mapped object.

◆ SEGV_MAPERR

#define SEGV_MAPERR   18

Address not mapped to object.

◆ SI_ASYNCIO

#define SI_ASYNCIO   40

Signal generated by completion of an asynchronous I/O request.

◆ SI_MESGQ

#define SI_MESGQ   41

Signal generated by arrival of a message on an empty message queue.

◆ SI_QUEUE

#define SI_QUEUE   38

Signal sent by sigqueue()

◆ SI_TIMER

#define SI_TIMER   39

Signal generated by expiration of a timer set by timer_settime()

◆ SI_USER

#define SI_USER   37

Signal sent by kill()

◆ SIG_BLOCK

#define SIG_BLOCK   1

◆ SIG_HOLD

#define SIG_HOLD   ((void *)-2)

◆ SIG_SETMASK

#define SIG_SETMASK   0

◆ SIG_UNBLOCK

#define SIG_UNBLOCK   2

◆ SIGABRT

#define SIGABRT   6

Aborted.

◆ SIGALRM

#define SIGALRM   14

Alarm clock.

◆ SIGBUS

#define SIGBUS   7

Bus error.

◆ SIGCHLD

#define SIGCHLD   17

Child status changed.

◆ SIGCONT

#define SIGCONT   18

Continued.

◆ SIGEV_NONE

#define SIGEV_NONE   1

◆ SIGEV_SIGNAL

#define SIGEV_SIGNAL   2

◆ SIGEV_THREAD

#define SIGEV_THREAD   3

◆ SIGFPE

#define SIGFPE   8

Arithmetic exception.

◆ SIGHUP

#define SIGHUP   1

Hangup.

◆ SIGILL

#define SIGILL   4

Illegal instruction.

◆ SIGINT

#define SIGINT   2

Interrupt.

◆ SIGKILL

#define SIGKILL   9

Killed.

◆ SIGPIPE

#define SIGPIPE   13

Broken pipe.

◆ SIGPOLL

#define SIGPOLL   29

Pollable event occurred.

◆ SIGPROF

#define SIGPROF   27

Profiling timer expired.

◆ SIGQUIT

#define SIGQUIT   3

Quit.

◆ SIGRTMAX

#define SIGRTMAX   (SIGRTMIN + CONFIG_POSIX_RTSIG_MAX)

◆ SIGRTMIN

#define SIGRTMIN   32

◆ SIGSEGV

#define SIGSEGV   11

Invalid memory reference.

◆ SIGSTKSZ

#define SIGSTKSZ   4096

◆ SIGSTOP

#define SIGSTOP   19

Stop executing.

◆ SIGSYS

#define SIGSYS   31

Bad system call.

◆ SIGTERM

#define SIGTERM   15

Terminated.

◆ SIGTRAP

#define SIGTRAP   5

Trace/breakpoint trap.

◆ SIGTSTP

#define SIGTSTP   20

Stopped.

◆ SIGTTIN

#define SIGTTIN   21

Stopped (read)

◆ SIGTTOU

#define SIGTTOU   22

Stopped (write)

◆ SIGURG

#define SIGURG   23

Urgent I/O condition.

◆ SIGUSR1

#define SIGUSR1   10

User-defined signal 1.

◆ SIGUSR2

#define SIGUSR2   12

User-defined signal 2.

◆ SIGVTALRM

#define SIGVTALRM   26

Virtual timer expired.

◆ SIGXCPU

#define SIGXCPU   24

CPU time limit exceeded.

◆ SIGXFSZ

#define SIGXFSZ   25

File size limit exceeded.

◆ SS_DISABLE

#define SS_DISABLE   0x00000002

◆ SS_ONSTACK

#define SS_ONSTACK   0x00000001

◆ TRAP_BRKPT

#define TRAP_BRKPT   23

Process breakpoint.

◆ TRAP_TRACE

#define TRAP_TRACE   24

Process trace trap.

Typedef Documentation

◆ pid_t

typedef long pid_t

◆ pthread_t

typedef unsigned int pthread_t

◆ sighandler_t

typedef void(* sighandler_t) (int sig)

◆ time_t

typedef long time_t

◆ uid_t

typedef int uid_t

Function Documentation

◆ kill()

int kill ( pid_t pid,
int sig )

◆ killpg()

int killpg ( pid_t pgrp,
int sig )

◆ psiginfo()

void psiginfo ( const siginfo_t * info,
const char * message )

◆ psignal()

void psignal ( int sig,
const char * message )

◆ pthread_kill()

int pthread_kill ( pthread_t thread,
int sig )

◆ pthread_sigmask()

int pthread_sigmask ( int how,
const sigset_t *ZRESTRICT set,
sigset_t *ZRESTRICT oset )

◆ sigaction()

int sigaction ( int sig,
const struct sigaction *ZRESTRICT act,
struct sigaction *ZRESTRICT oact )

◆ sigaddset()

int sigaddset ( sigset_t * set,
int sig )

◆ sigaltstack()

int sigaltstack ( const stack_t *ZRESTRICT ss,
stack_t *ZRESTRICT oss )

◆ sigdelset()

int sigdelset ( sigset_t * set,
int sig )

◆ sigemptyset()

int sigemptyset ( sigset_t * set)

◆ sigfillset()

int sigfillset ( sigset_t * set)

◆ sighold()

int sighold ( int sig)

◆ sigignore()

int sigignore ( int sig)

◆ siginterrupt()

int siginterrupt ( int sig,
int flag )

◆ sigismember()

int sigismember ( const sigset_t * set,
int sig )

◆ sigpause()

int sigpause ( int sig)

◆ sigpending()

int sigpending ( sigset_t * set)

◆ sigprocmask()

int sigprocmask ( int how,
const sigset_t *ZRESTRICT set,
sigset_t *ZRESTRICT oset )

◆ sigqueue()

int sigqueue ( pid_t pid,
int sig,
union sigval value )

◆ sigrelse()

int sigrelse ( int sig)

◆ sigset()

sighandler_t sigset ( int sig,
sighandler_t disp )

◆ sigsuspend()

int sigsuspend ( const sigset_t * set)

◆ sigtimedwait()

int sigtimedwait ( const sigset_t *ZRESTRICT set,
siginfo_t *ZRESTRICT info,
const struct timespec *ZRESTRICT timeout )

◆ sigwait()

int sigwait ( const sigset_t *ZRESTRICT set,
int *ZRESTRICT sig )

◆ sigwaitinfo()

int sigwaitinfo ( const sigset_t *ZRESTRICT set,
siginfo_t *ZRESTRICT info )

◆ TOOLCHAIN_DISABLE_WARNING()

TOOLCHAIN_DISABLE_WARNING ( TOOLCHAIN_WARNING_SHADOW )

◆ TOOLCHAIN_ENABLE_WARNING()

TOOLCHAIN_ENABLE_WARNING ( TOOLCHAIN_WARNING_SHADOW )