xref: /llvm-project/libc/src/signal/linux/__restore.cpp (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
166d00febSPaula Toth //===-- Linux implementation of __restore_rt ------------------------------===//
24d350556SAlex Brachet //
34d350556SAlex Brachet // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44d350556SAlex Brachet // See https://llvm.org/LICENSE.txt for license information.
54d350556SAlex Brachet // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
64d350556SAlex Brachet //
74d350556SAlex Brachet //===----------------------------------------------------------------------===//
84d350556SAlex Brachet 
90570de73SKazuaki Ishizaki // This file is implemented separately from sigaction.cpp so that we can
104d350556SAlex Brachet // strongly control the options this file is compiled with. __restore_rt cannot
114d350556SAlex Brachet // make any stack allocations so we must ensure this.
124d350556SAlex Brachet 
133cc2161cSSiva Chandra Reddy #include "src/__support/OSUtil/syscall.h"
14*5ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
154d350556SAlex Brachet 
16f6259d9bSPetr Hosek #include <sys/syscall.h>
17f6259d9bSPetr Hosek 
18*5ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
19255e634bSAlex Brachet 
204d350556SAlex Brachet extern "C" void __restore_rt()
21e66a1a5aSAlex Brachet     __attribute__((no_sanitize("all"),
224d350556SAlex Brachet                    hidden));
234d350556SAlex Brachet 
24f0a3954eSMichael Jones extern "C" void __restore_rt() {
25b6bc9d72SGuillaume Chatelet   LIBC_NAMESPACE::syscall_impl<long>(SYS_rt_sigreturn);
26f0a3954eSMichael Jones }
27255e634bSAlex Brachet 
28*5ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
29