setjmp.3
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3 代码 · 共 87 行
3
87 行
.\" SCCSID: @(#)setjmp.3 2.2 8/10/87.TH setjmp 3 VAX.SH Namesetjmp, longjmp \- nonlocal goto.SH Syntax.nf.B #include <setjmp.h>.PP.B setjmp(env).B jmp_buf env;.PP.B longjmp(env, val).B jmp_buf env;.PP.B _setjmp(env).B jmp_buf env;.PP.B _longjmp(env, val).B jmp_buf env;.fi.SH Description.NXR "setjmp subroutine".NXR "longjmp subroutine".NXR "program" "debugging"These routines are useful for dealing with errors and interrupts encountered ina low-level subroutine of a program..PPThe.PN setjmp subroutinesaves its stack environment in.I envfor later use by.PN longjmp .It returns value 0..PPThe.PN longjmpsubroutinerestores the environment saved by the last call of.PN setjmp .It then returns in such a way that executioncontinues as if the call of .PN setjmphad just returned the value.I valto the function that invoked.PN setjmp ,which must not itself have returned in the interim.However, .PN longjmpcannot cause .PN setjmpto return the value 0. If .PN longjmpis invoked with a .I valof 0, .PN setjmpwill return 1.All accessible data have values as of the time.PN longjmpwas called. .PPThe.PN setjmpand.PN longjmpsubroutinessave and restore the signal mask sigsetmask(2),while.PN _setjmpand.PN _longjmpmanipulate only the C stack and registers..SH RestrictionsThe.PN setjmpsubroutinedoes not save current notion of whether the process isexecuting on the signal stack. The result is that alongjmp to some place on the signal stack leaves thesignal stack state incorrect..SH See Alsosigstack(2), sigvec(2), signal(3)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?