The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
setjmp.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @file setjmp.h
5 * @brief non-local jumps.
6 *
7 * a jmp_buf keeps the registers a function call must keep (i686: ebx, esi,
8 * edi, ebp; x86_64: rbx, rbp, r12 to r15), the stack pointer and the return
9 * address.
10 */
11
12typedef unsigned long jmp_buf[8]; // the registers setjmp saves (arch/*/setjmp.asm)
13
14/**
15 * save the calling context.
16 * @return 0 when called; the value given to longjmp when it jumps here.
17 */
18int setjmp(jmp_buf env) __attribute__((returns_twice));
19
20/**
21 * go back to where setjmp saved env; setjmp then returns value (1 if
22 * value is 0).
23 */
24void longjmp(jmp_buf env, int value) __attribute__((noreturn));
25
26// the BSD names: setjmp here never saves the signal mask, so they are the
27// same calls
28#define _setjmp(env) setjmp(env)
29#define _longjmp(env, value) longjmp(env, value)
void longjmp(jmp_buf env, int value) __attribute__((noreturn))
go back to where setjmp saved env; setjmp then returns value (1 if value is 0).
int setjmp(jmp_buf env) __attribute__((returns_twice))
save the calling context.
unsigned long jmp_buf[8]
Definition setjmp.h:12
ELF32 file header.
Definition elf.h:51