]>
Commit | Line | Data |
---|---|---|
2fbdf533 | 1 | /* Uncancelable versions of cancelable interfaces. Linux/NPTL version. |
04277e02 | 2 | Copyright (C) 2003-2019 Free Software Foundation, Inc. |
2c008571 UD |
3 | This file is part of the GNU C Library. |
4 | Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. | |
5 | ||
6 | The GNU C Library is free software; you can redistribute it and/or | |
7 | modify it under the terms of the GNU Lesser General Public | |
8 | License as published by the Free Software Foundation; either | |
9 | version 2.1 of the License, or (at your option) any later version. | |
10 | ||
11 | The GNU C Library is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | Lesser General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU Lesser General Public | |
59ba27a6 PE |
17 | License along with the GNU C Library; if not, see |
18 | <http://www.gnu.org/licenses/>. */ | |
2c008571 | 19 | |
34caaafd AZ |
20 | #ifndef NOT_CANCEL_H |
21 | # define NOT_CANCEL_H | |
22 | ||
c2284574 | 23 | #include <fcntl.h> |
2c008571 | 24 | #include <sysdep.h> |
34caaafd AZ |
25 | #include <errno.h> |
26 | #include <unistd.h> | |
27 | #include <sys/syscall.h> | |
a8410a5f | 28 | #include <sys/wait.h> |
6f33fd04 | 29 | #include <time.h> |
2c008571 | 30 | |
c2284574 AZ |
31 | /* Non cancellable open syscall. */ |
32 | __typeof (open) __open_nocancel; | |
c2284574 AZ |
33 | |
34 | /* Non cancellable open syscall (LFS version). */ | |
35 | __typeof (open64) __open64_nocancel; | |
683040c3 | 36 | |
0bb2fabc AZ |
37 | /* Non cancellable openat syscall. */ |
38 | __typeof (openat) __openat_nocancel; | |
0bb2fabc AZ |
39 | |
40 | /* Non cacellable openat syscall (LFS version). */ | |
41 | __typeof (openat64) __openat64_nocancel; | |
0bb2fabc | 42 | |
a748eb31 AZ |
43 | /* Non cancellable read syscall. */ |
44 | __typeof (__read) __read_nocancel; | |
34caaafd AZ |
45 | |
46 | /* Uncancelable write. */ | |
c647fb88 | 47 | __typeof (__write) __write_nocancel; |
2fbdf533 | 48 | |
2c008571 | 49 | /* Uncancelable close. */ |
c181840c | 50 | __typeof (__close) __close_nocancel; |
c181840c AZ |
51 | |
52 | /* Non cancellable close syscall that does not also set errno in case of | |
53 | failure. */ | |
54 | static inline void | |
55 | __close_nocancel_nostatus (int fd) | |
56 | { | |
57 | __close_nocancel (fd); | |
58 | } | |
2c008571 | 59 | |
19926de9 AZ |
60 | /* Non cancellable writev syscall that does not also set errno in case of |
61 | failure. */ | |
62 | static inline void | |
63 | __writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt) | |
64 | { | |
65 | INTERNAL_SYSCALL_DECL (err); | |
66 | INTERNAL_SYSCALL_CALL (writev, err, fd, iov, iovcnt); | |
67 | } | |
73299943 UD |
68 | |
69 | /* Uncancelable waitpid. */ | |
a8410a5f | 70 | __typeof (waitpid) __waitpid_nocancel; |
b894c2ea RM |
71 | |
72 | /* Uncancelable pause. */ | |
08d6eb46 | 73 | __typeof (pause) __pause_nocancel; |
b894c2ea RM |
74 | |
75 | /* Uncancelable nanosleep. */ | |
6f33fd04 | 76 | __typeof (__nanosleep) __nanosleep_nocancel; |
b894c2ea | 77 | |
2b0b9a1c | 78 | /* Uncancelable fcntl. */ |
06ab719d | 79 | __typeof (__fcntl) __fcntl64_nocancel; |
329ea513 ZW |
80 | |
81 | #if IS_IN (libc) || IS_IN (rtld) | |
82 | hidden_proto (__open_nocancel) | |
83 | hidden_proto (__open64_nocancel) | |
84 | hidden_proto (__openat_nocancel) | |
85 | hidden_proto (__openat64_nocancel) | |
86 | hidden_proto (__read_nocancel) | |
87 | hidden_proto (__write_nocancel) | |
88 | hidden_proto (__close_nocancel) | |
89 | hidden_proto (__waitpid_nocancel) | |
90 | hidden_proto (__pause_nocancel) | |
91 | hidden_proto (__nanosleep_nocancel) | |
06ab719d | 92 | hidden_proto (__fcntl64_nocancel) |
329ea513 | 93 | #endif |
2b0b9a1c | 94 | |
34caaafd | 95 | #endif /* NOT_CANCEL_H */ |