]>
Commit | Line | Data |
---|---|---|
e0317569 MK |
1 | diff -urpa elogind-235.3.orig/src/basic/missing_syscall.h elogind-235.3/src/basic/missing_syscall.h |
2 | --- elogind-235.3.orig/src/basic/missing_syscall.h 2018-03-09 06:57:50.000000000 +0000 | |
3 | +++ elogind-235.3/src/basic/missing_syscall.h 2018-04-14 18:13:21.667411504 +0000 | |
4 | @@ -26,9 +26,11 @@ | |
5 | #include <sys/types.h> | |
6 | ||
7 | #if !HAVE_PIVOT_ROOT | |
8 | -static inline int pivot_root(const char *new_root, const char *put_old) { | |
9 | +static inline int missing_pivot_root(const char *new_root, const char *put_old) { | |
10 | return syscall(SYS_pivot_root, new_root, put_old); | |
11 | } | |
12 | + | |
13 | +# define pivot_root missing_pivot_root | |
14 | #endif | |
15 | #endif // 0 | |
16 | ||
17 | @@ -63,7 +65,7 @@ static inline int pivot_root(const char | |
18 | # endif | |
19 | # endif | |
20 | ||
21 | -static inline int memfd_create(const char *name, unsigned int flags) { | |
22 | +static inline int missing_memfd_create(const char *name, unsigned int flags) { | |
23 | # ifdef __NR_memfd_create | |
24 | return syscall(__NR_memfd_create, name, flags); | |
25 | # else | |
26 | @@ -71,6 +73,8 @@ static inline int memfd_create(const cha | |
27 | return -1; | |
28 | # endif | |
29 | } | |
30 | + | |
31 | +# define memfd_create missing_memfd_create | |
32 | #endif | |
33 | ||
34 | /* ======================================================================= */ | |
35 | @@ -110,7 +114,7 @@ static inline int memfd_create(const cha | |
36 | # endif | |
37 | # endif | |
38 | ||
39 | -static inline int getrandom(void *buffer, size_t count, unsigned flags) { | |
40 | +static inline int missing_getrandom(void *buffer, size_t count, unsigned flags) { | |
41 | # ifdef __NR_getrandom | |
42 | return syscall(__NR_getrandom, buffer, count, flags); | |
43 | # else | |
44 | @@ -118,14 +122,18 @@ static inline int getrandom(void *buffer | |
45 | return -1; | |
46 | # endif | |
47 | } | |
48 | + | |
49 | +# define getrandom missing_getrandom | |
50 | #endif | |
51 | ||
52 | /* ======================================================================= */ | |
53 | ||
54 | #if !HAVE_GETTID | |
55 | -static inline pid_t gettid(void) { | |
56 | +static inline pid_t missing_gettid(void) { | |
57 | return (pid_t) syscall(SYS_gettid); | |
58 | } | |
59 | + | |
60 | +# define gettid missing_gettid | |
61 | #endif | |
62 | ||
63 | /* ======================================================================= */ | |
64 | @@ -153,7 +161,7 @@ struct file_handle { | |
65 | unsigned char f_handle[0]; | |
66 | }; | |
67 | ||
68 | -static inline int name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) { | |
69 | +static inline int missing_name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) { | |
70 | # ifdef __NR_name_to_handle_at | |
71 | return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags); | |
72 | # else | |
73 | @@ -161,6 +169,8 @@ static inline int name_to_handle_at(int | |
74 | return -1; | |
75 | # endif | |
76 | } | |
77 | + | |
78 | +# define name_to_handle_at missing_name_to_handle_at | |
79 | #endif | |
80 | ||
81 | /* ======================================================================= */ | |
82 | @@ -178,7 +188,7 @@ static inline int name_to_handle_at(int | |
83 | # endif | |
84 | # endif | |
85 | ||
86 | -static inline int setns(int fd, int nstype) { | |
87 | +static inline int missing_setns(int fd, int nstype) { | |
88 | # ifdef __NR_setns | |
89 | return syscall(__NR_setns, fd, nstype); | |
90 | # else | |
91 | @@ -186,6 +196,8 @@ static inline int setns(int fd, int nsty | |
92 | return -1; | |
93 | # endif | |
94 | } | |
95 | + | |
96 | +# define setns missing_setns | |
97 | #endif | |
98 | ||
99 | /* ======================================================================= */ | |
100 | @@ -231,7 +243,7 @@ static inline pid_t raw_getpid(void) { | |
101 | # endif | |
102 | # endif | |
103 | ||
104 | -static inline int renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) { | |
105 | +static inline int missing_renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) { | |
106 | # ifdef __NR_renameat2 | |
107 | return syscall(__NR_renameat2, oldfd, oldname, newfd, newname, flags); | |
108 | # else | |
109 | @@ -239,12 +251,14 @@ static inline int renameat2(int oldfd, c | |
110 | return -1; | |
111 | # endif | |
112 | } | |
113 | + | |
114 | +# define renameat2 missing_renameat2 | |
115 | #endif | |
116 | ||
117 | /* ======================================================================= */ | |
118 | ||
119 | #if !HAVE_KCMP | |
120 | -static inline int kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) { | |
121 | +static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) { | |
122 | # ifdef __NR_kcmp | |
123 | return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2); | |
124 | # else | |
125 | @@ -252,36 +266,45 @@ static inline int kcmp(pid_t pid1, pid_t | |
126 | return -1; | |
127 | # endif | |
128 | } | |
129 | + | |
130 | +# define kcmp missing_kcmp | |
131 | #endif | |
132 | ||
133 | + | |
134 | /* ======================================================================= */ | |
135 | ||
136 | #if !HAVE_KEYCTL | |
137 | -static inline long keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4,unsigned long arg5) { | |
138 | +static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4,unsigned long arg5) { | |
139 | # ifdef __NR_keyctl | |
140 | return syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5); | |
141 | # else | |
142 | errno = ENOSYS; | |
143 | return -1; | |
144 | # endif | |
145 | + | |
146 | +# define keyctl missing_keyctl | |
147 | } | |
148 | ||
149 | -static inline key_serial_t add_key(const char *type, const char *description, const void *payload, size_t plen, key_serial_t ringid) { | |
150 | +static inline key_serial_t missing_add_key(const char *type, const char *description, const void *payload, size_t plen, key_serial_t ringid) { | |
151 | # ifdef __NR_add_key | |
152 | return syscall(__NR_add_key, type, description, payload, plen, ringid); | |
153 | # else | |
154 | errno = ENOSYS; | |
155 | return -1; | |
156 | # endif | |
157 | + | |
158 | +# define add_key missing_add_key | |
159 | } | |
160 | ||
161 | -static inline key_serial_t request_key(const char *type, const char *description, const char * callout_info, key_serial_t destringid) { | |
162 | +static inline key_serial_t missing_request_key(const char *type, const char *description, const char * callout_info, key_serial_t destringid) { | |
163 | # ifdef __NR_request_key | |
164 | return syscall(__NR_request_key, type, description, callout_info, destringid); | |
165 | # else | |
166 | errno = ENOSYS; | |
167 | return -1; | |
168 | # endif | |
169 | + | |
170 | +# define request_key missing_request_key | |
171 | } | |
172 | #endif | |
173 | ||
174 | @@ -308,10 +331,10 @@ static inline key_serial_t request_key(c | |
175 | # endif | |
176 | # endif | |
177 | ||
178 | -static inline ssize_t copy_file_range(int fd_in, loff_t *off_in, | |
179 | - int fd_out, loff_t *off_out, | |
180 | - size_t len, | |
181 | - unsigned int flags) { | |
182 | +static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in, | |
183 | + int fd_out, loff_t *off_out, | |
184 | + size_t len, | |
185 | + unsigned int flags) { | |
186 | # ifdef __NR_copy_file_range | |
187 | return syscall(__NR_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags); | |
188 | # else | |
189 | @@ -319,6 +342,8 @@ static inline ssize_t copy_file_range(in | |
190 | return -1; | |
191 | # endif | |
192 | } | |
193 | + | |
194 | +# define copy_file_range missing_copy_file_range | |
195 | #endif | |
196 | ||
197 | #if !HAVE_BPF | |
198 | @@ -340,7 +365,7 @@ static inline ssize_t copy_file_range(in | |
199 | ||
200 | union bpf_attr; | |
201 | ||
202 | -static inline int bpf(int cmd, union bpf_attr *attr, size_t size) { | |
203 | +static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) { | |
204 | #ifdef __NR_bpf | |
205 | return (int) syscall(__NR_bpf, cmd, attr, size); | |
206 | #else | |
207 | @@ -349,4 +374,5 @@ static inline int bpf(int cmd, union bpf | |
208 | #endif | |
209 | } | |
210 | ||
211 | +# define bpf missing_bpf | |
212 | #endif |