x86_64: Fix missing wcsncat function definition without multiarch (x86-64-v4)
[glibc.git] / nptl / cleanup.c
blobb0c403b80f2a1cfc074937458dc8eb4adbc3054a
1 /* Copyright (C) 2002-2024 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
18 #include <stdlib.h>
19 #include "pthreadP.h"
20 #include <shlib-compat.h>
22 void
23 __cleanup_fct_attribute
24 ___pthread_register_cancel (__pthread_unwind_buf_t *buf)
26 struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
27 struct pthread *self = THREAD_SELF;
29 /* Store old info. */
30 ibuf->priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf);
31 ibuf->priv.data.cleanup = THREAD_GETMEM (self, cleanup);
33 /* Store the new cleanup handler info. */
34 THREAD_SETMEM (self, cleanup_jmp_buf, (struct pthread_unwind_buf *) buf);
36 versioned_symbol (libc, ___pthread_register_cancel,
37 __pthread_register_cancel, GLIBC_2_34);
38 libc_hidden_ver (___pthread_register_cancel, __pthread_register_cancel)
40 #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_34)
41 compat_symbol (libpthread, ___pthread_register_cancel,
42 __pthread_register_cancel, GLIBC_2_3_3);
43 #endif
46 void
47 __cleanup_fct_attribute
48 ___pthread_unregister_cancel (__pthread_unwind_buf_t *buf)
50 struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
52 THREAD_SETMEM (THREAD_SELF, cleanup_jmp_buf, ibuf->priv.data.prev);
54 versioned_symbol (libc, ___pthread_unregister_cancel,
55 __pthread_unregister_cancel, GLIBC_2_34);
56 libc_hidden_ver (___pthread_unregister_cancel, __pthread_unregister_cancel)
58 #if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_34)
59 compat_symbol (libpthread, ___pthread_unregister_cancel,
60 __pthread_unregister_cancel, GLIBC_2_3_3);
61 #endif