rump_syscalls.c revision 1.5.2.7 1 1.1 pooka /* $NetBSD: rump_syscalls.c,v 1.5.2.7 2008/12/27 23:14:25 christos Exp $ */
2 1.1 pooka
3 1.1 pooka /*
4 1.1 pooka * System call marshalling for rump.
5 1.1 pooka *
6 1.1 pooka * DO NOT EDIT-- this file is automatically generated.
7 1.5.2.7 christos * created from NetBSD: syscalls.master,v 1.218 2008/11/26 15:01:17 pooka Exp
8 1.1 pooka */
9 1.1 pooka
10 1.1 pooka #include <sys/cdefs.h>
11 1.1 pooka __KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.5.2.7 2008/12/27 23:14:25 christos Exp $");
12 1.1 pooka
13 1.1 pooka #include <sys/types.h>
14 1.1 pooka #include <sys/param.h>
15 1.1 pooka #include <sys/proc.h>
16 1.1 pooka #include <sys/syscallargs.h>
17 1.5.2.5 christos #include <rump/rump_syscalls.h>
18 1.5.2.2 christos #include "rump_private.h"
19 1.1 pooka
20 1.1 pooka #if BYTE_ORDER == BIG_ENDIAN
21 1.1 pooka #define SPARG(p,k) ((p)->k.be.datum)
22 1.1 pooka #else /* LITTLE_ENDIAN, I hope dearly */
23 1.1 pooka #define SPARG(p,k) ((p)->k.le.datum)
24 1.1 pooka #endif
25 1.1 pooka
26 1.5.2.2 christos int rump_enosys(void);
27 1.5.2.2 christos int
28 1.5.2.2 christos rump_enosys()
29 1.5.2.2 christos {
30 1.5.2.2 christos
31 1.5.2.2 christos return ENOSYS;
32 1.5.2.2 christos }
33 1.5.2.2 christos
34 1.1 pooka ssize_t
35 1.1 pooka rump_sys_read(int fd, void * buf, size_t nbyte, int *error)
36 1.1 pooka {
37 1.5.2.2 christos register_t retval = 0;
38 1.1 pooka struct sys_read_args arg;
39 1.1 pooka
40 1.1 pooka SPARG(&arg, fd) = fd;
41 1.1 pooka SPARG(&arg, buf) = buf;
42 1.1 pooka SPARG(&arg, nbyte) = nbyte;
43 1.1 pooka
44 1.1 pooka *error = sys_read(curlwp, &arg, &retval);
45 1.5.2.2 christos if (*error)
46 1.5.2.2 christos retval = -1;
47 1.1 pooka return retval;
48 1.1 pooka }
49 1.5.2.2 christos __weak_alias(sys_read,rump_enosys);
50 1.1 pooka
51 1.1 pooka ssize_t
52 1.1 pooka rump_sys_write(int fd, const void * buf, size_t nbyte, int *error)
53 1.1 pooka {
54 1.5.2.2 christos register_t retval = 0;
55 1.1 pooka struct sys_write_args arg;
56 1.1 pooka
57 1.1 pooka SPARG(&arg, fd) = fd;
58 1.1 pooka SPARG(&arg, buf) = buf;
59 1.1 pooka SPARG(&arg, nbyte) = nbyte;
60 1.1 pooka
61 1.1 pooka *error = sys_write(curlwp, &arg, &retval);
62 1.5.2.2 christos if (*error)
63 1.5.2.2 christos retval = -1;
64 1.1 pooka return retval;
65 1.1 pooka }
66 1.5.2.2 christos __weak_alias(sys_write,rump_enosys);
67 1.1 pooka
68 1.1 pooka int
69 1.1 pooka rump_sys_open(const char * path, int flags, mode_t mode, int *error)
70 1.1 pooka {
71 1.5.2.2 christos register_t retval = 0;
72 1.1 pooka struct sys_open_args arg;
73 1.1 pooka
74 1.1 pooka SPARG(&arg, path) = path;
75 1.1 pooka SPARG(&arg, flags) = flags;
76 1.1 pooka SPARG(&arg, mode) = mode;
77 1.1 pooka
78 1.1 pooka *error = sys_open(curlwp, &arg, &retval);
79 1.5.2.2 christos if (*error)
80 1.5.2.2 christos retval = -1;
81 1.1 pooka return retval;
82 1.1 pooka }
83 1.5.2.2 christos __weak_alias(sys_open,rump_enosys);
84 1.1 pooka
85 1.1 pooka int
86 1.1 pooka rump_sys_close(int fd, int *error)
87 1.1 pooka {
88 1.5.2.2 christos register_t retval = 0;
89 1.1 pooka struct sys_close_args arg;
90 1.1 pooka
91 1.1 pooka SPARG(&arg, fd) = fd;
92 1.1 pooka
93 1.1 pooka *error = sys_close(curlwp, &arg, &retval);
94 1.5.2.2 christos if (*error)
95 1.5.2.2 christos retval = -1;
96 1.1 pooka return retval;
97 1.1 pooka }
98 1.5.2.2 christos __weak_alias(sys_close,rump_enosys);
99 1.1 pooka
100 1.1 pooka int
101 1.1 pooka rump_sys_link(const char * path, const char * link, int *error)
102 1.1 pooka {
103 1.5.2.2 christos register_t retval = 0;
104 1.1 pooka struct sys_link_args arg;
105 1.1 pooka
106 1.1 pooka SPARG(&arg, path) = path;
107 1.1 pooka SPARG(&arg, link) = link;
108 1.1 pooka
109 1.1 pooka *error = sys_link(curlwp, &arg, &retval);
110 1.5.2.2 christos if (*error)
111 1.5.2.2 christos retval = -1;
112 1.1 pooka return retval;
113 1.1 pooka }
114 1.5.2.2 christos __weak_alias(sys_link,rump_enosys);
115 1.1 pooka
116 1.1 pooka int
117 1.1 pooka rump_sys_unlink(const char * path, int *error)
118 1.1 pooka {
119 1.5.2.2 christos register_t retval = 0;
120 1.1 pooka struct sys_unlink_args arg;
121 1.1 pooka
122 1.1 pooka SPARG(&arg, path) = path;
123 1.1 pooka
124 1.1 pooka *error = sys_unlink(curlwp, &arg, &retval);
125 1.5.2.2 christos if (*error)
126 1.5.2.2 christos retval = -1;
127 1.1 pooka return retval;
128 1.1 pooka }
129 1.5.2.2 christos __weak_alias(sys_unlink,rump_enosys);
130 1.1 pooka
131 1.1 pooka int
132 1.1 pooka rump_sys_chdir(const char * path, int *error)
133 1.1 pooka {
134 1.5.2.2 christos register_t retval = 0;
135 1.1 pooka struct sys_chdir_args arg;
136 1.1 pooka
137 1.1 pooka SPARG(&arg, path) = path;
138 1.1 pooka
139 1.1 pooka *error = sys_chdir(curlwp, &arg, &retval);
140 1.5.2.2 christos if (*error)
141 1.5.2.2 christos retval = -1;
142 1.1 pooka return retval;
143 1.1 pooka }
144 1.5.2.2 christos __weak_alias(sys_chdir,rump_enosys);
145 1.1 pooka
146 1.1 pooka int
147 1.1 pooka rump_sys_fchdir(int fd, int *error)
148 1.1 pooka {
149 1.5.2.2 christos register_t retval = 0;
150 1.1 pooka struct sys_fchdir_args arg;
151 1.1 pooka
152 1.1 pooka SPARG(&arg, fd) = fd;
153 1.1 pooka
154 1.1 pooka *error = sys_fchdir(curlwp, &arg, &retval);
155 1.5.2.2 christos if (*error)
156 1.5.2.2 christos retval = -1;
157 1.1 pooka return retval;
158 1.1 pooka }
159 1.5.2.2 christos __weak_alias(sys_fchdir,rump_enosys);
160 1.1 pooka
161 1.1 pooka int
162 1.1 pooka rump_sys_chmod(const char * path, mode_t mode, int *error)
163 1.1 pooka {
164 1.5.2.2 christos register_t retval = 0;
165 1.1 pooka struct sys_chmod_args arg;
166 1.1 pooka
167 1.1 pooka SPARG(&arg, path) = path;
168 1.1 pooka SPARG(&arg, mode) = mode;
169 1.1 pooka
170 1.1 pooka *error = sys_chmod(curlwp, &arg, &retval);
171 1.5.2.2 christos if (*error)
172 1.5.2.2 christos retval = -1;
173 1.1 pooka return retval;
174 1.1 pooka }
175 1.5.2.2 christos __weak_alias(sys_chmod,rump_enosys);
176 1.1 pooka
177 1.1 pooka int
178 1.1 pooka rump_sys_chown(const char * path, uid_t uid, gid_t gid, int *error)
179 1.1 pooka {
180 1.5.2.2 christos register_t retval = 0;
181 1.1 pooka struct sys_chown_args arg;
182 1.1 pooka
183 1.1 pooka SPARG(&arg, path) = path;
184 1.1 pooka SPARG(&arg, uid) = uid;
185 1.1 pooka SPARG(&arg, gid) = gid;
186 1.1 pooka
187 1.1 pooka *error = sys_chown(curlwp, &arg, &retval);
188 1.5.2.2 christos if (*error)
189 1.5.2.2 christos retval = -1;
190 1.1 pooka return retval;
191 1.1 pooka }
192 1.5.2.2 christos __weak_alias(sys_chown,rump_enosys);
193 1.1 pooka
194 1.1 pooka int
195 1.1 pooka rump_sys_unmount(const char * path, int flags, int *error)
196 1.1 pooka {
197 1.5.2.2 christos register_t retval = 0;
198 1.1 pooka struct sys_unmount_args arg;
199 1.1 pooka
200 1.1 pooka SPARG(&arg, path) = path;
201 1.1 pooka SPARG(&arg, flags) = flags;
202 1.1 pooka
203 1.1 pooka *error = sys_unmount(curlwp, &arg, &retval);
204 1.5.2.2 christos if (*error)
205 1.5.2.2 christos retval = -1;
206 1.1 pooka return retval;
207 1.1 pooka }
208 1.5.2.2 christos __weak_alias(sys_unmount,rump_enosys);
209 1.1 pooka
210 1.1 pooka int
211 1.5.2.7 christos rump_sys_accept(int s, struct sockaddr * name, unsigned int * anamelen, int *error)
212 1.5.2.7 christos {
213 1.5.2.7 christos register_t retval = 0;
214 1.5.2.7 christos struct sys_accept_args arg;
215 1.5.2.7 christos
216 1.5.2.7 christos SPARG(&arg, s) = s;
217 1.5.2.7 christos SPARG(&arg, name) = name;
218 1.5.2.7 christos SPARG(&arg, anamelen) = anamelen;
219 1.5.2.7 christos
220 1.5.2.7 christos *error = sys_accept(curlwp, &arg, &retval);
221 1.5.2.7 christos if (*error)
222 1.5.2.7 christos retval = -1;
223 1.5.2.7 christos return retval;
224 1.5.2.7 christos }
225 1.5.2.7 christos __weak_alias(sys_accept,rump_enosys);
226 1.5.2.7 christos
227 1.5.2.7 christos int
228 1.5.2.2 christos rump_sys_chflags(const char * path, u_long flags, int *error)
229 1.1 pooka {
230 1.5.2.2 christos register_t retval = 0;
231 1.5.2.2 christos struct sys_chflags_args arg;
232 1.1 pooka
233 1.1 pooka SPARG(&arg, path) = path;
234 1.1 pooka SPARG(&arg, flags) = flags;
235 1.1 pooka
236 1.5.2.2 christos *error = sys_chflags(curlwp, &arg, &retval);
237 1.5.2.2 christos if (*error)
238 1.5.2.2 christos retval = -1;
239 1.1 pooka return retval;
240 1.1 pooka }
241 1.5.2.2 christos __weak_alias(sys_chflags,rump_enosys);
242 1.1 pooka
243 1.5.2.2 christos void
244 1.5.2.2 christos rump_sys_sync(int *error)
245 1.1 pooka {
246 1.5.2.2 christos register_t retval = 0;
247 1.1 pooka
248 1.5.2.2 christos *error = sys_sync(curlwp, NULL, &retval);
249 1.5.2.2 christos if (*error)
250 1.5.2.2 christos retval = -1;
251 1.1 pooka }
252 1.5.2.2 christos __weak_alias(sys_sync,rump_enosys);
253 1.1 pooka
254 1.1 pooka int
255 1.5.2.2 christos rump_sys_ioctl(int fd, u_long com, void * data, int *error)
256 1.1 pooka {
257 1.5.2.2 christos register_t retval = 0;
258 1.5.2.2 christos struct sys_ioctl_args arg;
259 1.1 pooka
260 1.1 pooka SPARG(&arg, fd) = fd;
261 1.5.2.2 christos SPARG(&arg, com) = com;
262 1.5.2.2 christos SPARG(&arg, data) = data;
263 1.1 pooka
264 1.5.2.2 christos *error = sys_ioctl(curlwp, &arg, &retval);
265 1.5.2.2 christos if (*error)
266 1.5.2.2 christos retval = -1;
267 1.1 pooka return retval;
268 1.1 pooka }
269 1.5.2.2 christos __weak_alias(sys_ioctl,rump_enosys);
270 1.1 pooka
271 1.1 pooka int
272 1.1 pooka rump_sys_symlink(const char * path, const char * link, int *error)
273 1.1 pooka {
274 1.5.2.2 christos register_t retval = 0;
275 1.1 pooka struct sys_symlink_args arg;
276 1.1 pooka
277 1.1 pooka SPARG(&arg, path) = path;
278 1.1 pooka SPARG(&arg, link) = link;
279 1.1 pooka
280 1.1 pooka *error = sys_symlink(curlwp, &arg, &retval);
281 1.5.2.2 christos if (*error)
282 1.5.2.2 christos retval = -1;
283 1.1 pooka return retval;
284 1.1 pooka }
285 1.5.2.2 christos __weak_alias(sys_symlink,rump_enosys);
286 1.1 pooka
287 1.1 pooka ssize_t
288 1.1 pooka rump_sys_readlink(const char * path, char * buf, size_t count, int *error)
289 1.1 pooka {
290 1.5.2.2 christos register_t retval = 0;
291 1.1 pooka struct sys_readlink_args arg;
292 1.1 pooka
293 1.1 pooka SPARG(&arg, path) = path;
294 1.1 pooka SPARG(&arg, buf) = buf;
295 1.1 pooka SPARG(&arg, count) = count;
296 1.1 pooka
297 1.1 pooka *error = sys_readlink(curlwp, &arg, &retval);
298 1.5.2.2 christos if (*error)
299 1.5.2.2 christos retval = -1;
300 1.5.2.2 christos return retval;
301 1.5.2.2 christos }
302 1.5.2.2 christos __weak_alias(sys_readlink,rump_enosys);
303 1.5.2.2 christos
304 1.5.2.2 christos int
305 1.5.2.2 christos rump_sys_fsync(int fd, int *error)
306 1.5.2.2 christos {
307 1.5.2.2 christos register_t retval = 0;
308 1.5.2.2 christos struct sys_fsync_args arg;
309 1.5.2.2 christos
310 1.5.2.2 christos SPARG(&arg, fd) = fd;
311 1.5.2.2 christos
312 1.5.2.2 christos *error = sys_fsync(curlwp, &arg, &retval);
313 1.5.2.2 christos if (*error)
314 1.5.2.2 christos retval = -1;
315 1.5.2.2 christos return retval;
316 1.5.2.2 christos }
317 1.5.2.2 christos __weak_alias(sys_fsync,rump_enosys);
318 1.5.2.2 christos
319 1.5.2.2 christos int
320 1.5.2.2 christos rump_sys_connect(int s, const struct sockaddr * name, unsigned int namelen, int *error)
321 1.5.2.2 christos {
322 1.5.2.2 christos register_t retval = 0;
323 1.5.2.2 christos struct sys_connect_args arg;
324 1.5.2.2 christos
325 1.5.2.2 christos SPARG(&arg, s) = s;
326 1.5.2.2 christos SPARG(&arg, name) = name;
327 1.5.2.2 christos SPARG(&arg, namelen) = namelen;
328 1.5.2.2 christos
329 1.5.2.2 christos *error = sys_connect(curlwp, &arg, &retval);
330 1.5.2.2 christos if (*error)
331 1.5.2.2 christos retval = -1;
332 1.5.2.2 christos return retval;
333 1.5.2.2 christos }
334 1.5.2.2 christos __weak_alias(sys_connect,rump_enosys);
335 1.5.2.2 christos
336 1.5.2.2 christos int
337 1.5.2.7 christos rump_sys_bind(int s, const struct sockaddr * name, unsigned int namelen, int *error)
338 1.5.2.7 christos {
339 1.5.2.7 christos register_t retval = 0;
340 1.5.2.7 christos struct sys_bind_args arg;
341 1.5.2.7 christos
342 1.5.2.7 christos SPARG(&arg, s) = s;
343 1.5.2.7 christos SPARG(&arg, name) = name;
344 1.5.2.7 christos SPARG(&arg, namelen) = namelen;
345 1.5.2.7 christos
346 1.5.2.7 christos *error = sys_bind(curlwp, &arg, &retval);
347 1.5.2.7 christos if (*error)
348 1.5.2.7 christos retval = -1;
349 1.5.2.7 christos return retval;
350 1.5.2.7 christos }
351 1.5.2.7 christos __weak_alias(sys_bind,rump_enosys);
352 1.5.2.7 christos
353 1.5.2.7 christos int
354 1.5.2.2 christos rump_sys_setsockopt(int s, int level, int name, const void * val, unsigned int valsize, int *error)
355 1.5.2.2 christos {
356 1.5.2.2 christos register_t retval = 0;
357 1.5.2.2 christos struct sys_setsockopt_args arg;
358 1.5.2.2 christos
359 1.5.2.2 christos SPARG(&arg, s) = s;
360 1.5.2.2 christos SPARG(&arg, level) = level;
361 1.5.2.2 christos SPARG(&arg, name) = name;
362 1.5.2.2 christos SPARG(&arg, val) = val;
363 1.5.2.2 christos SPARG(&arg, valsize) = valsize;
364 1.5.2.2 christos
365 1.5.2.2 christos *error = sys_setsockopt(curlwp, &arg, &retval);
366 1.5.2.2 christos if (*error)
367 1.5.2.2 christos retval = -1;
368 1.5.2.2 christos return retval;
369 1.5.2.2 christos }
370 1.5.2.2 christos __weak_alias(sys_setsockopt,rump_enosys);
371 1.5.2.2 christos
372 1.5.2.2 christos int
373 1.5.2.7 christos rump_sys_listen(int s, int backlog, int *error)
374 1.5.2.7 christos {
375 1.5.2.7 christos register_t retval = 0;
376 1.5.2.7 christos struct sys_listen_args arg;
377 1.5.2.7 christos
378 1.5.2.7 christos SPARG(&arg, s) = s;
379 1.5.2.7 christos SPARG(&arg, backlog) = backlog;
380 1.5.2.7 christos
381 1.5.2.7 christos *error = sys_listen(curlwp, &arg, &retval);
382 1.5.2.7 christos if (*error)
383 1.5.2.7 christos retval = -1;
384 1.5.2.7 christos return retval;
385 1.5.2.7 christos }
386 1.5.2.7 christos __weak_alias(sys_listen,rump_enosys);
387 1.5.2.7 christos
388 1.5.2.7 christos int
389 1.5.2.2 christos rump_sys_getsockopt(int s, int level, int name, void * val, unsigned int * avalsize, int *error)
390 1.5.2.2 christos {
391 1.5.2.2 christos register_t retval = 0;
392 1.5.2.2 christos struct sys_getsockopt_args arg;
393 1.5.2.2 christos
394 1.5.2.2 christos SPARG(&arg, s) = s;
395 1.5.2.2 christos SPARG(&arg, level) = level;
396 1.5.2.2 christos SPARG(&arg, name) = name;
397 1.5.2.2 christos SPARG(&arg, val) = val;
398 1.5.2.2 christos SPARG(&arg, avalsize) = avalsize;
399 1.5.2.2 christos
400 1.5.2.2 christos *error = sys_getsockopt(curlwp, &arg, &retval);
401 1.5.2.2 christos if (*error)
402 1.5.2.2 christos retval = -1;
403 1.1 pooka return retval;
404 1.1 pooka }
405 1.5.2.2 christos __weak_alias(sys_getsockopt,rump_enosys);
406 1.1 pooka
407 1.1 pooka int
408 1.1 pooka rump_sys_rename(const char * from, const char * to, int *error)
409 1.1 pooka {
410 1.5.2.2 christos register_t retval = 0;
411 1.1 pooka struct sys_rename_args arg;
412 1.1 pooka
413 1.1 pooka SPARG(&arg, from) = from;
414 1.1 pooka SPARG(&arg, to) = to;
415 1.1 pooka
416 1.1 pooka *error = sys_rename(curlwp, &arg, &retval);
417 1.5.2.2 christos if (*error)
418 1.5.2.2 christos retval = -1;
419 1.5.2.2 christos return retval;
420 1.5.2.2 christos }
421 1.5.2.2 christos __weak_alias(sys_rename,rump_enosys);
422 1.5.2.2 christos
423 1.5.2.2 christos int
424 1.5.2.2 christos rump_sys_mkfifo(const char * path, mode_t mode, int *error)
425 1.5.2.2 christos {
426 1.5.2.2 christos register_t retval = 0;
427 1.5.2.2 christos struct sys_mkfifo_args arg;
428 1.5.2.2 christos
429 1.5.2.2 christos SPARG(&arg, path) = path;
430 1.5.2.2 christos SPARG(&arg, mode) = mode;
431 1.5.2.2 christos
432 1.5.2.2 christos *error = sys_mkfifo(curlwp, &arg, &retval);
433 1.5.2.2 christos if (*error)
434 1.5.2.2 christos retval = -1;
435 1.1 pooka return retval;
436 1.1 pooka }
437 1.5.2.2 christos __weak_alias(sys_mkfifo,rump_enosys);
438 1.1 pooka
439 1.1 pooka int
440 1.1 pooka rump_sys_mkdir(const char * path, mode_t mode, int *error)
441 1.1 pooka {
442 1.5.2.2 christos register_t retval = 0;
443 1.1 pooka struct sys_mkdir_args arg;
444 1.1 pooka
445 1.1 pooka SPARG(&arg, path) = path;
446 1.1 pooka SPARG(&arg, mode) = mode;
447 1.1 pooka
448 1.1 pooka *error = sys_mkdir(curlwp, &arg, &retval);
449 1.5.2.2 christos if (*error)
450 1.5.2.2 christos retval = -1;
451 1.1 pooka return retval;
452 1.1 pooka }
453 1.5.2.2 christos __weak_alias(sys_mkdir,rump_enosys);
454 1.1 pooka
455 1.1 pooka int
456 1.1 pooka rump_sys_rmdir(const char * path, int *error)
457 1.1 pooka {
458 1.5.2.2 christos register_t retval = 0;
459 1.1 pooka struct sys_rmdir_args arg;
460 1.1 pooka
461 1.1 pooka SPARG(&arg, path) = path;
462 1.1 pooka
463 1.1 pooka *error = sys_rmdir(curlwp, &arg, &retval);
464 1.5.2.2 christos if (*error)
465 1.5.2.2 christos retval = -1;
466 1.5.2.2 christos return retval;
467 1.5.2.2 christos }
468 1.5.2.2 christos __weak_alias(sys_rmdir,rump_enosys);
469 1.5.2.2 christos
470 1.5.2.7 christos int
471 1.5.2.7 christos rump_sys_nfssvc(int flag, void * argp, int *error)
472 1.5.2.7 christos {
473 1.5.2.7 christos register_t retval = 0;
474 1.5.2.7 christos struct sys_nfssvc_args arg;
475 1.5.2.7 christos
476 1.5.2.7 christos SPARG(&arg, flag) = flag;
477 1.5.2.7 christos SPARG(&arg, argp) = argp;
478 1.5.2.7 christos
479 1.5.2.7 christos *error = sys_nfssvc(curlwp, &arg, &retval);
480 1.5.2.7 christos if (*error)
481 1.5.2.7 christos retval = -1;
482 1.5.2.7 christos return retval;
483 1.5.2.7 christos }
484 1.5.2.7 christos __weak_alias(sys_nfssvc,rump_enosys);
485 1.5.2.7 christos
486 1.5.2.2 christos ssize_t
487 1.5.2.2 christos rump_sys_pread(int fd, void * buf, size_t nbyte, int pad, off_t offset, int *error)
488 1.5.2.2 christos {
489 1.5.2.2 christos register_t retval = 0;
490 1.5.2.2 christos struct sys_pread_args arg;
491 1.5.2.2 christos
492 1.5.2.2 christos SPARG(&arg, fd) = fd;
493 1.5.2.2 christos SPARG(&arg, buf) = buf;
494 1.5.2.2 christos SPARG(&arg, nbyte) = nbyte;
495 1.5.2.2 christos SPARG(&arg, pad) = pad;
496 1.5.2.2 christos SPARG(&arg, offset) = offset;
497 1.5.2.2 christos
498 1.5.2.2 christos *error = sys_pread(curlwp, &arg, &retval);
499 1.5.2.2 christos if (*error)
500 1.5.2.2 christos retval = -1;
501 1.1 pooka return retval;
502 1.1 pooka }
503 1.5.2.2 christos __weak_alias(sys_pread,rump_enosys);
504 1.5.2.2 christos
505 1.5.2.2 christos ssize_t
506 1.5.2.2 christos rump_sys_pwrite(int fd, const void * buf, size_t nbyte, int pad, off_t offset, int *error)
507 1.5.2.2 christos {
508 1.5.2.2 christos register_t retval = 0;
509 1.5.2.2 christos struct sys_pwrite_args arg;
510 1.5.2.2 christos
511 1.5.2.2 christos SPARG(&arg, fd) = fd;
512 1.5.2.2 christos SPARG(&arg, buf) = buf;
513 1.5.2.2 christos SPARG(&arg, nbyte) = nbyte;
514 1.5.2.2 christos SPARG(&arg, pad) = pad;
515 1.5.2.2 christos SPARG(&arg, offset) = offset;
516 1.5.2.2 christos
517 1.5.2.2 christos *error = sys_pwrite(curlwp, &arg, &retval);
518 1.5.2.2 christos if (*error)
519 1.5.2.2 christos retval = -1;
520 1.5.2.2 christos return retval;
521 1.5.2.2 christos }
522 1.5.2.2 christos __weak_alias(sys_pwrite,rump_enosys);
523 1.1 pooka
524 1.1 pooka int
525 1.1 pooka rump_sys_truncate(const char * path, int pad, off_t length, int *error)
526 1.1 pooka {
527 1.5.2.2 christos register_t retval = 0;
528 1.1 pooka struct sys_truncate_args arg;
529 1.1 pooka
530 1.1 pooka SPARG(&arg, path) = path;
531 1.1 pooka SPARG(&arg, pad) = pad;
532 1.1 pooka SPARG(&arg, length) = length;
533 1.1 pooka
534 1.1 pooka *error = sys_truncate(curlwp, &arg, &retval);
535 1.5.2.2 christos if (*error)
536 1.5.2.2 christos retval = -1;
537 1.5.2.2 christos return retval;
538 1.5.2.2 christos }
539 1.5.2.2 christos __weak_alias(sys_truncate,rump_enosys);
540 1.5.2.2 christos
541 1.5.2.2 christos int
542 1.5.2.2 christos rump_sys___sysctl(const int * name, u_int namelen, void * old, size_t * oldlenp, const void * new, size_t newlen, int *error)
543 1.5.2.2 christos {
544 1.5.2.2 christos register_t retval = 0;
545 1.5.2.2 christos struct sys___sysctl_args arg;
546 1.5.2.2 christos
547 1.5.2.2 christos SPARG(&arg, name) = name;
548 1.5.2.2 christos SPARG(&arg, namelen) = namelen;
549 1.5.2.2 christos SPARG(&arg, old) = old;
550 1.5.2.2 christos SPARG(&arg, oldlenp) = oldlenp;
551 1.5.2.2 christos SPARG(&arg, new) = new;
552 1.5.2.2 christos SPARG(&arg, newlen) = newlen;
553 1.5.2.2 christos
554 1.5.2.2 christos *error = sys___sysctl(curlwp, &arg, &retval);
555 1.5.2.2 christos if (*error)
556 1.5.2.2 christos retval = -1;
557 1.1 pooka return retval;
558 1.1 pooka }
559 1.5.2.2 christos __weak_alias(sys___sysctl,rump_enosys);
560 1.1 pooka
561 1.1 pooka int
562 1.1 pooka rump_sys_lchmod(const char * path, mode_t mode, int *error)
563 1.1 pooka {
564 1.5.2.2 christos register_t retval = 0;
565 1.1 pooka struct sys_lchmod_args arg;
566 1.1 pooka
567 1.1 pooka SPARG(&arg, path) = path;
568 1.1 pooka SPARG(&arg, mode) = mode;
569 1.1 pooka
570 1.1 pooka *error = sys_lchmod(curlwp, &arg, &retval);
571 1.5.2.2 christos if (*error)
572 1.5.2.2 christos retval = -1;
573 1.1 pooka return retval;
574 1.1 pooka }
575 1.5.2.2 christos __weak_alias(sys_lchmod,rump_enosys);
576 1.1 pooka
577 1.1 pooka int
578 1.1 pooka rump_sys_lchown(const char * path, uid_t uid, gid_t gid, int *error)
579 1.1 pooka {
580 1.5.2.2 christos register_t retval = 0;
581 1.1 pooka struct sys_lchown_args arg;
582 1.1 pooka
583 1.1 pooka SPARG(&arg, path) = path;
584 1.1 pooka SPARG(&arg, uid) = uid;
585 1.1 pooka SPARG(&arg, gid) = gid;
586 1.1 pooka
587 1.1 pooka *error = sys_lchown(curlwp, &arg, &retval);
588 1.5.2.2 christos if (*error)
589 1.5.2.2 christos retval = -1;
590 1.5.2.2 christos return retval;
591 1.5.2.2 christos }
592 1.5.2.2 christos __weak_alias(sys_lchown,rump_enosys);
593 1.5.2.2 christos
594 1.5.2.2 christos int
595 1.5.2.2 christos rump_sys_lutimes(const char * path, const struct timeval50 * tptr, int *error)
596 1.5.2.2 christos {
597 1.5.2.2 christos register_t retval = 0;
598 1.5.2.2 christos struct sys_lutimescompat_50__args arg;
599 1.5.2.2 christos
600 1.5.2.2 christos SPARG(&arg, path) = path;
601 1.5.2.2 christos SPARG(&arg, tptr) = tptr;
602 1.5.2.2 christos
603 1.5.2.2 christos *error = sys_lutimes(curlwp, &arg, &retval);
604 1.5.2.2 christos if (*error)
605 1.5.2.2 christos retval = -1;
606 1.5.2.2 christos return retval;
607 1.5.2.2 christos }
608 1.5.2.2 christos __weak_alias(sys_lutimes,rump_enosys);
609 1.5.2.2 christos
610 1.5.2.2 christos int
611 1.5.2.2 christos rump_sys_lchflags(const char * path, u_long flags, int *error)
612 1.5.2.2 christos {
613 1.5.2.2 christos register_t retval = 0;
614 1.5.2.2 christos struct sys_lchflags_args arg;
615 1.5.2.2 christos
616 1.5.2.2 christos SPARG(&arg, path) = path;
617 1.5.2.2 christos SPARG(&arg, flags) = flags;
618 1.5.2.2 christos
619 1.5.2.2 christos *error = sys_lchflags(curlwp, &arg, &retval);
620 1.5.2.2 christos if (*error)
621 1.5.2.2 christos retval = -1;
622 1.5.2.2 christos return retval;
623 1.5.2.2 christos }
624 1.5.2.2 christos __weak_alias(sys_lchflags,rump_enosys);
625 1.5.2.2 christos
626 1.5.2.2 christos int
627 1.5.2.7 christos rump_sys_statvfs1(const char * path, struct statvfs * buf, int flags, int *error)
628 1.5.2.7 christos {
629 1.5.2.7 christos register_t retval = 0;
630 1.5.2.7 christos struct sys_statvfs1_args arg;
631 1.5.2.7 christos
632 1.5.2.7 christos SPARG(&arg, path) = path;
633 1.5.2.7 christos SPARG(&arg, buf) = buf;
634 1.5.2.7 christos SPARG(&arg, flags) = flags;
635 1.5.2.7 christos
636 1.5.2.7 christos *error = sys_statvfs1(curlwp, &arg, &retval);
637 1.5.2.7 christos if (*error)
638 1.5.2.7 christos retval = -1;
639 1.5.2.7 christos return retval;
640 1.5.2.7 christos }
641 1.5.2.7 christos __weak_alias(sys_statvfs1,rump_enosys);
642 1.5.2.7 christos
643 1.5.2.7 christos int
644 1.5.2.2 christos rump_sys___socket30(int domain, int type, int protocol, int *error)
645 1.5.2.2 christos {
646 1.5.2.2 christos register_t retval = 0;
647 1.5.2.2 christos struct sys___socket30_args arg;
648 1.5.2.2 christos
649 1.5.2.2 christos SPARG(&arg, domain) = domain;
650 1.5.2.2 christos SPARG(&arg, type) = type;
651 1.5.2.2 christos SPARG(&arg, protocol) = protocol;
652 1.5.2.2 christos
653 1.5.2.2 christos *error = sys___socket30(curlwp, &arg, &retval);
654 1.5.2.2 christos if (*error)
655 1.5.2.2 christos retval = -1;
656 1.5.2.2 christos return retval;
657 1.5.2.2 christos }
658 1.5.2.2 christos __weak_alias(sys___socket30,rump_enosys);
659 1.5.2.2 christos
660 1.5.2.2 christos int
661 1.5.2.7 christos rump_sys___getfh30(const char * fname, void * fhp, size_t * fh_size, int *error)
662 1.5.2.7 christos {
663 1.5.2.7 christos register_t retval = 0;
664 1.5.2.7 christos struct sys___getfh30_args arg;
665 1.5.2.7 christos
666 1.5.2.7 christos SPARG(&arg, fname) = fname;
667 1.5.2.7 christos SPARG(&arg, fhp) = fhp;
668 1.5.2.7 christos SPARG(&arg, fh_size) = fh_size;
669 1.5.2.7 christos
670 1.5.2.7 christos *error = sys___getfh30(curlwp, &arg, &retval);
671 1.5.2.7 christos if (*error)
672 1.5.2.7 christos retval = -1;
673 1.5.2.7 christos return retval;
674 1.5.2.7 christos }
675 1.5.2.7 christos __weak_alias(sys___getfh30,rump_enosys);
676 1.5.2.7 christos
677 1.5.2.7 christos int
678 1.5.2.2 christos rump_sys___lutimes50(const char * path, const struct timeval * tptr, int *error)
679 1.5.2.2 christos {
680 1.5.2.2 christos register_t retval = 0;
681 1.5.2.2 christos struct sys___lutimes50_args arg;
682 1.5.2.2 christos
683 1.5.2.2 christos SPARG(&arg, path) = path;
684 1.5.2.2 christos SPARG(&arg, tptr) = tptr;
685 1.5.2.2 christos
686 1.5.2.2 christos *error = sys___lutimes50(curlwp, &arg, &retval);
687 1.5.2.2 christos if (*error)
688 1.5.2.2 christos retval = -1;
689 1.5.2.2 christos return retval;
690 1.5.2.2 christos }
691 1.5.2.2 christos __weak_alias(sys___lutimes50,rump_enosys);
692 1.5.2.2 christos
693 1.5.2.2 christos int
694 1.5.2.2 christos rump_sys___stat50(const char * path, struct stat * ub, int *error)
695 1.5.2.2 christos {
696 1.5.2.2 christos register_t retval = 0;
697 1.5.2.2 christos struct sys___stat50_args arg;
698 1.5.2.2 christos
699 1.5.2.2 christos SPARG(&arg, path) = path;
700 1.5.2.2 christos SPARG(&arg, ub) = ub;
701 1.5.2.2 christos
702 1.5.2.2 christos *error = sys___stat50(curlwp, &arg, &retval);
703 1.5.2.2 christos if (*error)
704 1.5.2.2 christos retval = -1;
705 1.5.2.2 christos return retval;
706 1.5.2.2 christos }
707 1.5.2.2 christos __weak_alias(sys___stat50,rump_enosys);
708 1.5.2.2 christos
709 1.5.2.2 christos int
710 1.5.2.2 christos rump_sys___lstat50(const char * path, struct stat * ub, int *error)
711 1.5.2.2 christos {
712 1.5.2.2 christos register_t retval = 0;
713 1.5.2.2 christos struct sys___lstat50_args arg;
714 1.5.2.2 christos
715 1.5.2.2 christos SPARG(&arg, path) = path;
716 1.5.2.2 christos SPARG(&arg, ub) = ub;
717 1.5.2.2 christos
718 1.5.2.2 christos *error = sys___lstat50(curlwp, &arg, &retval);
719 1.5.2.2 christos if (*error)
720 1.5.2.2 christos retval = -1;
721 1.5.2.2 christos return retval;
722 1.5.2.2 christos }
723 1.5.2.2 christos __weak_alias(sys___lstat50,rump_enosys);
724 1.1 pooka
725 1.5.2.1 christos int
726 1.5.2.1 christos rump_sys___mknod50(const char * path, mode_t mode, dev_t dev, int *error)
727 1.5.2.1 christos {
728 1.5.2.2 christos register_t retval = 0;
729 1.5.2.1 christos struct sys___mknod50_args arg;
730 1.5.2.1 christos
731 1.5.2.1 christos SPARG(&arg, path) = path;
732 1.5.2.1 christos SPARG(&arg, mode) = mode;
733 1.5.2.1 christos SPARG(&arg, dev) = dev;
734 1.5.2.1 christos
735 1.5.2.1 christos *error = sys___mknod50(curlwp, &arg, &retval);
736 1.5.2.2 christos if (*error)
737 1.5.2.2 christos retval = -1;
738 1.5.2.1 christos return retval;
739 1.5.2.1 christos }
740 1.5.2.2 christos __weak_alias(sys___mknod50,rump_enosys);
741