posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
POSIX_SIGNAL_JUMP

POSIX Signal Jump option group. More...

Data Structures

struct  __sigjmp_buf
 Jump buffer for sigsetjmp() and siglongjmp() More...
 

Typedefs

typedef struct __sigjmp_buf sigjmp_buf[1]
 Jump buffer for sigsetjmp() and siglongjmp()
 

Functions

int sigsetjmp (sigjmp_buf env, int savemask)
 Save the calling environment and, optionally, the signal mask.
 
FUNC_NORETURN void siglongjmp (sigjmp_buf env, int val)
 Restore the environment saved by sigsetjmp().
 

Detailed Description

POSIX Signal Jump option group.

Typedef Documentation

◆ sigjmp_buf

typedef struct __sigjmp_buf sigjmp_buf[1]

Jump buffer for sigsetjmp() and siglongjmp()

Holds the saved calling environment and, when requested, the saved signal mask.

Function Documentation

◆ siglongjmp()

FUNC_NORETURN void siglongjmp ( sigjmp_buf  env,
int  val 
)

Restore the environment saved by sigsetjmp().

Control returns from the corresponding sigsetjmp() invocation with return value val (or 1 when val is 0). When the environment was saved with a non-zero savemask, the saved signal mask is restored first.

Parameters
envBuffer holding the environment saved by sigsetjmp()
valValue for the corresponding sigsetjmp() invocation to return
See also
siglongjmp

◆ sigsetjmp()

int sigsetjmp ( sigjmp_buf  env,
int  savemask 
)

Save the calling environment and, optionally, the signal mask.

When savemask is non-zero, the calling thread's signal mask is saved in env and siglongjmp() restores it. sigsetjmp() is a macro, as permitted by POSIX, so that the environment is saved in the caller's stack frame.

Parameters
envBuffer in which the calling environment is saved
savemaskSave the signal mask in env when non-zero
Return values
0when returning directly from the sigsetjmp() invocation
non-zerowhen returning via siglongjmp()
See also
sigsetjmp