Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setjmp(3C) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

signal(3)




setjmp(3C) setjmp(3C)
NAME setjmp, longjmp - provide non-local goto SYNOPSIS #include <setjmp.h> int setjmp(env) jmp_buf env; void longjmp(env, val) jmp_buf env; int val; DESCRIPTION These functions are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program. setjmp saves its stack environment in env for later use by longjmp. The environment type jmp_buf is defined in the <setjmp.h> header file. STATUS MESSAGES AND VALUES When setjmp has been called by the calling process, it returns 0. The longjmp program restores the environment saved by the last call of setjmp with the corresponding env argument. After longjmp is completed, program execution continues as if the corresponding call of setjmp (which must not itself have returned in the interim) had just returned the value val. longjmp cannot cause setjmp to return the value 0. If longjmp is invoked with a second argument of 0, setjmp will return 1. All accessible data have values as of the time longjmp was called. WARNINGS longjmp fails if it is called when env was never primed by a call to setjmp or when the last such call is in a function that has since returned. SEE ALSO signal(3) January 1992 1

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026