The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
setjmp.h File Reference

non-local jumps. More...

Go to the source code of this file.

Macros

#define _setjmp(env)
#define _longjmp(env, value)

Typedefs

typedef unsigned long jmp_buf[8]

Functions

int setjmp (jmp_buf env) __attribute__((returns_twice))
 save the calling context.
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).

Detailed Description

non-local jumps.

a jmp_buf keeps the registers a function call must keep (i686: ebx, esi, edi, ebp; x86_64: rbx, rbp, r12 to r15), the stack pointer and the return address.

Macro Definition Documentation

◆ _setjmp

#define _setjmp ( env)
Value:
setjmp(env)
int setjmp(jmp_buf env) __attribute__((returns_twice))
save the calling context.

◆ _longjmp

#define _longjmp ( env,
value )
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).

Typedef Documentation

◆ jmp_buf

typedef unsigned long jmp_buf[8]

Function Documentation

◆ setjmp()

int setjmp ( jmp_buf env)

save the calling context.

Returns
0 when called; the value given to longjmp when it jumps here.

◆ longjmp()

void longjmp ( jmp_buf env,
int value )

go back to where setjmp saved env; setjmp then returns value (1 if value is 0).