siglongjmp

å称
     sigsetjmp, siglongjmp, setjmp, longjmp, _setjmp, _longjmp, longjmperror —
     éå±æåå²

ã©ã¤ãã©ãª
     Standard C Library (libc, -lc)

æ¸å¼
     <setjmp.h> int sigsetjmp(sigjmp_buf env, int savemask) void
     siglongjmp(sigjmp_buf env, int val) int setjmp(jmp_buf env) void
     longjmp(jmp_buf env, int val) int _setjmp(jmp_buf env) void
     _longjmp(jmp_buf env, int val) void longjmperror(void)

解説
     sigsetjmp(), setjmp() ããã³ _setjmp() é¢æ°ã¯ãå¼ã³åºãåã®ç°å¢ã env ã«ä¿å‐
     ãã¾ãããããã®é¢æ°ã¯ã©ãã 0 ãè¿ãã¾ãã

     対å¿ãã longjmp() é¢æ°ã¯ãããããæãæ°ãã setjmp() é¢æ°å¼ã³åºãã«ãã£ã¦ä¿å‐
     ãããç°å¢ã復åãã¾ãã longjmp() é¢æ°ã¯ãã®å¾ã§å¾©å¸°ããã®ã§ã対å¿ãã setjmp()
     å¼ã³åºããã0 ã§ã¯ãªã val ã§æå®ãããå¤ãè¿ããã°ããã§ãããã®ããã« ãã‐
     ã°ã©ã ã®å®è¡ãç¶ç¶ãã¾ãã

     å¼ã³åºãã®ãã¢ã¯ãäºãã«æ··åã§ãã¾ããããªãã¡ã sigsetjmp() 㨠siglongjmp() ããã³
     setjmp() 㨠longjmp() ã®åçµã¿åããã¯ãåãããã°ã©ã åã§ä½¿ç¨ã§ãã¾ãã
     ããããåãã®å¼ã³åºãã¯æ··åãããã¨ã¯ã§ãã¾ããã ãã¨ãã°ã setjmp() ã«æ¸¡ããã env å¼æ°ã¯
     siglongjmp() ã«æ¸¡ããã¨ã¯ã§ãã¾ããã

     longjmp() ã«ã¼ãã³ã¯ã setjmp() ãå¼ã³åºããã«ã¼ãã³ãã復帰ããå¾ã§ã¯
     å¼ã³åºããã¨ã¯ã§ãã¾ããã

     ã¢ã¯ã»ã¹å¯è½ãªãªãã¸ã§ã¯ãã¯ãã¹ã¦ longjmp()
     ã«ã¼ãã³ãå¼ã³åºãããæç¹ã§ã®å¤ãæã¡ã¾ãã
     ãã ãä¾å¤ã¨ãã¦ãèªåè¨æ¶åæéç¶ç¶ãããªãã¸ã§ã¯ãã§ããã volatile åã§ã¯ãªãããã¤
     setjmp() å¼ã³åºã㨠longjmp() å¼ã³åºãã¨ã®éã§å¤æ´ããããã®ã«ã¤ãã¦ã
     ãã®å¤ãä¸å®ã«ãªããã¨ã¯é¤ãã¾ãã

     setjmp()/longjmp() ã®ãã¢ã¯ã·ã°ãã«ãã¹ã¯ãä¿åã復åãã¾ããã
     _setjmp()/_longjmp() ã®ãã¢ã¯ã¬ã¸ã¹ã¿ã»ããã¨ã¹ã¿ãã¯ããä¿åããã³å¾©åãã¾ãã (
     sigprocmask(2) ãåç§ ) ã

     sigsetjmp()/siglongjmp() é¢æ°ã®ãã¢ã¯ãå¼æ° savemask ã 0
     ã§ãªãå ´åãã·ã°ãã«ãã¹ã¯ãä¿åããã³å¾©åãã¾ãã 0
     ã§ããå ´åã¯ãã¬ã¸ã¹ã¿ã»ããã¨ã¹ã¿ãã¯ã®ã¿ãä¿åããã¾ãã

ã¨ã©ã¼
     env ã®å容ãç ´å£ããã¦ããå ´åãã¾ãã¯æ¢ã«å¾©å¸°ããç°å¢ã«å¯¾å¿ãã¦ããå ´åã
     longjmp() ã«ã¼ãã³ã¯ã longjmperror(3) ãå¼ã³åºãã¾ãã longjmperror()
     ãã復帰ããã¨ãããã°ã©ã ã¯ä¸æ¢ãã¾ã ( abort(3) ãåç§ ) ã longjmperror()
     ã®ããã©ã«ããã¼ã¸ã§ã³ã§ã¯ “longjmp botch” ã¡ãã»ã¼ã¸ãæ¨æºã¨ã©ã¼åºåã«å°å‐
     ãã¦å¾©å¸°ãã¾ãã ã¦ã¼ã¶ããã°ã©ã ããã£ã¨è¡åããè±åºãããã¨ãæããªãã ç¬èªãã¼ã¸ã§ã³ã®
     longjmperror() ãæ¸ãã¹ãã§ãã

é¢é£é ç®
     sigaction(2), sigaltstack(2), signal(3)

è¦æ ¼
     setjmp() é¢æ°ã¨ longjmp() é¢æ°ã¯ ISO/IEC 9899:1990 (“ISO C90”)
     ã«é©åãã¦ãã¾ãã sigsetjmp() é¢æ°ã¨ siglongjmp() é¢æ°ã¯ IEEE Std 1003.1-1988
     (“POSIX.1”) ã«é©åãã¦ãã¾ãã