[libc-commits] [libc] [libc] implement sigsetjmp/siglongjmp for x86-64 (PR #136072)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Thu Apr 17 09:32:56 PDT 2025


================
@@ -0,0 +1,21 @@
+//===-- Implementation of siglongjmp --------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/setjmp/siglongjmp.h"
+#include "src/__support/common.h"
+#include "src/setjmp/longjmp.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+// siglongjmp is the same as longjmp. The additional recovery work is done in
+// the epilogue of the sigsetjmp function.
+LLVM_LIBC_FUNCTION(void, siglongjmp, (jmp_buf buf, int val)) {
+  return longjmp(buf, val);
----------------
michaelrj-google wrote:

this shouldn't call the public libc function, it should call a shared internal function.

https://github.com/llvm/llvm-project/pull/136072


More information about the libc-commits mailing list