From 008f737ddf5de815ef7e26d195767d927c8c8e76 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 23 Jun 2024 20:52:53 -0400 Subject: siglongjmp: document why this function just calls longjmp --- src/signal/siglongjmp.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/signal/siglongjmp.c b/src/signal/siglongjmp.c index bc317acc..53789b23 100644 --- a/src/signal/siglongjmp.c +++ b/src/signal/siglongjmp.c @@ -5,5 +5,10 @@ _Noreturn void siglongjmp(sigjmp_buf buf, int ret) { + /* If sigsetjmp was called with nonzero savemask flag, the address + * longjmp will return to is inside of sigsetjmp. The signal mask + * will then be restored in the returned-to context instead of here, + * which matters if the context we are returning from may not have + * sufficient stack space for signal delivery. */ longjmp(buf, ret); } -- cgit v1.2.1