www.delorie.com/djgpp/doc/libc-2.01/libc_451.html   search  
Go to the first, previous, next, last section, table of contents.


longjmp

Syntax

#include <setjmp.h>

void longjmp(jmp_buf env, int val);

Description

This function reverts back to a CPU state that was stored in env by setjmp (see section setjmp). The state includes all CPU registers, so any variable in a register when setjmp was called will be preserved, and all else will be indeterminate.

The value passed as val will be the return value of setjmp when it resumes processing there. If val is zero, the return value will be one.

Return Value

This function does not return.

Example

jmp_buf j;
if (setjmp(j))
  return;
do_something();
longjmp(j);


Go to the first, previous, next, last section, table of contents.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997