]>
git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/not-cancel.h
2c58d5ae2fb0637616e146f6e16673258f56c05d
1 /* Uncancelable versions of cancelable interfaces. Linux/NPTL version.
2 Copyright (C) 2003-2022 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
26 #include <sys/syscall.h>
30 /* Non cancellable open syscall. */
31 __typeof (open
) __open_nocancel
;
33 /* Non cancellable open syscall (LFS version). */
34 __typeof (open64
) __open64_nocancel
;
36 /* Non cancellable openat syscall. */
37 __typeof (openat
) __openat_nocancel
;
39 /* Non cacellable openat syscall (LFS version). */
40 __typeof (openat64
) __openat64_nocancel
;
42 /* Non cancellable read syscall. */
43 __typeof (__read
) __read_nocancel
;
45 /* Non cancellable pread syscall (LFS version). */
46 __typeof (__pread64
) __pread64_nocancel
;
48 /* Uncancelable write. */
49 __typeof (__write
) __write_nocancel
;
51 /* Uncancelable close. */
52 __typeof (__close
) __close_nocancel
;
54 /* Non cancellable close syscall that does not also set errno in case of
57 __close_nocancel_nostatus (int fd
)
59 __close_nocancel (fd
);
62 /* Non cancellable writev syscall that does not also set errno in case of
65 __writev_nocancel_nostatus (int fd
, const struct iovec
*iov
, int iovcnt
)
67 INTERNAL_SYSCALL_CALL (writev
, fd
, iov
, iovcnt
);
71 __getrandom_nocancel (void *buf
, size_t buflen
, unsigned int flags
)
73 return INTERNAL_SYSCALL_CALL (getrandom
, buf
, buflen
, flags
);
77 /* Uncancelable fcntl. */
78 __typeof (__fcntl
) __fcntl64_nocancel
;
80 #if IS_IN (libc) || IS_IN (rtld)
81 hidden_proto (__open_nocancel
)
82 hidden_proto (__open64_nocancel
)
83 hidden_proto (__openat_nocancel
)
84 hidden_proto (__openat64_nocancel
)
85 hidden_proto (__read_nocancel
)
86 hidden_proto (__pread64_nocancel
)
87 hidden_proto (__write_nocancel
)
88 hidden_proto (__close_nocancel
)
89 hidden_proto (__fcntl64_nocancel
)
92 #endif /* NOT_CANCEL_H */