Home | History | Annotate | Line # | Download | only in rumpkern
rump_syscalls.c revision 1.5.2.6
      1      1.1     pooka /* $NetBSD: rump_syscalls.c,v 1.5.2.6 2008/11/20 22:21:56 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.6  christos  * created from	NetBSD: syscalls.master,v 1.196.2.5 2008/11/20 20:45:39 christos 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.6 2008/11/20 22:21:56 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.2  christos rump_sys_chflags(const char * path, u_long flags, int *error)
    212      1.1     pooka {
    213  1.5.2.2  christos 	register_t retval = 0;
    214  1.5.2.2  christos 	struct sys_chflags_args arg;
    215      1.1     pooka 
    216      1.1     pooka 	SPARG(&arg, path) = path;
    217      1.1     pooka 	SPARG(&arg, flags) = flags;
    218      1.1     pooka 
    219  1.5.2.2  christos 	*error = sys_chflags(curlwp, &arg, &retval);
    220  1.5.2.2  christos 	if (*error)
    221  1.5.2.2  christos 		retval = -1;
    222      1.1     pooka 	return retval;
    223      1.1     pooka }
    224  1.5.2.2  christos __weak_alias(sys_chflags,rump_enosys);
    225      1.1     pooka 
    226  1.5.2.2  christos void
    227  1.5.2.2  christos rump_sys_sync(int *error)
    228      1.1     pooka {
    229  1.5.2.2  christos 	register_t retval = 0;
    230      1.1     pooka 
    231  1.5.2.2  christos 	*error = sys_sync(curlwp, NULL, &retval);
    232  1.5.2.2  christos 	if (*error)
    233  1.5.2.2  christos 		retval = -1;
    234      1.1     pooka }
    235  1.5.2.2  christos __weak_alias(sys_sync,rump_enosys);
    236      1.1     pooka 
    237      1.1     pooka int
    238  1.5.2.2  christos rump_sys_ioctl(int fd, u_long com, void * data, int *error)
    239      1.1     pooka {
    240  1.5.2.2  christos 	register_t retval = 0;
    241  1.5.2.2  christos 	struct sys_ioctl_args arg;
    242      1.1     pooka 
    243      1.1     pooka 	SPARG(&arg, fd) = fd;
    244  1.5.2.2  christos 	SPARG(&arg, com) = com;
    245  1.5.2.2  christos 	SPARG(&arg, data) = data;
    246      1.1     pooka 
    247  1.5.2.2  christos 	*error = sys_ioctl(curlwp, &arg, &retval);
    248  1.5.2.2  christos 	if (*error)
    249  1.5.2.2  christos 		retval = -1;
    250      1.1     pooka 	return retval;
    251      1.1     pooka }
    252  1.5.2.2  christos __weak_alias(sys_ioctl,rump_enosys);
    253      1.1     pooka 
    254      1.1     pooka int
    255      1.1     pooka rump_sys_symlink(const char * path, const char * link, int *error)
    256      1.1     pooka {
    257  1.5.2.2  christos 	register_t retval = 0;
    258      1.1     pooka 	struct sys_symlink_args arg;
    259      1.1     pooka 
    260      1.1     pooka 	SPARG(&arg, path) = path;
    261      1.1     pooka 	SPARG(&arg, link) = link;
    262      1.1     pooka 
    263      1.1     pooka 	*error = sys_symlink(curlwp, &arg, &retval);
    264  1.5.2.2  christos 	if (*error)
    265  1.5.2.2  christos 		retval = -1;
    266      1.1     pooka 	return retval;
    267      1.1     pooka }
    268  1.5.2.2  christos __weak_alias(sys_symlink,rump_enosys);
    269      1.1     pooka 
    270      1.1     pooka ssize_t
    271      1.1     pooka rump_sys_readlink(const char * path, char * buf, size_t count, int *error)
    272      1.1     pooka {
    273  1.5.2.2  christos 	register_t retval = 0;
    274      1.1     pooka 	struct sys_readlink_args arg;
    275      1.1     pooka 
    276      1.1     pooka 	SPARG(&arg, path) = path;
    277      1.1     pooka 	SPARG(&arg, buf) = buf;
    278      1.1     pooka 	SPARG(&arg, count) = count;
    279      1.1     pooka 
    280      1.1     pooka 	*error = sys_readlink(curlwp, &arg, &retval);
    281  1.5.2.2  christos 	if (*error)
    282  1.5.2.2  christos 		retval = -1;
    283  1.5.2.2  christos 	return retval;
    284  1.5.2.2  christos }
    285  1.5.2.2  christos __weak_alias(sys_readlink,rump_enosys);
    286  1.5.2.2  christos 
    287  1.5.2.2  christos int
    288  1.5.2.2  christos rump_sys_fsync(int fd, int *error)
    289  1.5.2.2  christos {
    290  1.5.2.2  christos 	register_t retval = 0;
    291  1.5.2.2  christos 	struct sys_fsync_args arg;
    292  1.5.2.2  christos 
    293  1.5.2.2  christos 	SPARG(&arg, fd) = fd;
    294  1.5.2.2  christos 
    295  1.5.2.2  christos 	*error = sys_fsync(curlwp, &arg, &retval);
    296  1.5.2.2  christos 	if (*error)
    297  1.5.2.2  christos 		retval = -1;
    298  1.5.2.2  christos 	return retval;
    299  1.5.2.2  christos }
    300  1.5.2.2  christos __weak_alias(sys_fsync,rump_enosys);
    301  1.5.2.2  christos 
    302  1.5.2.2  christos int
    303  1.5.2.2  christos rump_sys_connect(int s, const struct sockaddr * name, unsigned int namelen, int *error)
    304  1.5.2.2  christos {
    305  1.5.2.2  christos 	register_t retval = 0;
    306  1.5.2.2  christos 	struct sys_connect_args arg;
    307  1.5.2.2  christos 
    308  1.5.2.2  christos 	SPARG(&arg, s) = s;
    309  1.5.2.2  christos 	SPARG(&arg, name) = name;
    310  1.5.2.2  christos 	SPARG(&arg, namelen) = namelen;
    311  1.5.2.2  christos 
    312  1.5.2.2  christos 	*error = sys_connect(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_connect,rump_enosys);
    318  1.5.2.2  christos 
    319  1.5.2.2  christos int
    320  1.5.2.2  christos rump_sys_setsockopt(int s, int level, int name, const void * val, unsigned int valsize, 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_setsockopt_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, level) = level;
    327  1.5.2.2  christos 	SPARG(&arg, name) = name;
    328  1.5.2.2  christos 	SPARG(&arg, val) = val;
    329  1.5.2.2  christos 	SPARG(&arg, valsize) = valsize;
    330  1.5.2.2  christos 
    331  1.5.2.2  christos 	*error = sys_setsockopt(curlwp, &arg, &retval);
    332  1.5.2.2  christos 	if (*error)
    333  1.5.2.2  christos 		retval = -1;
    334  1.5.2.2  christos 	return retval;
    335  1.5.2.2  christos }
    336  1.5.2.2  christos __weak_alias(sys_setsockopt,rump_enosys);
    337  1.5.2.2  christos 
    338  1.5.2.2  christos int
    339  1.5.2.2  christos rump_sys_getsockopt(int s, int level, int name, void * val, unsigned int * avalsize, int *error)
    340  1.5.2.2  christos {
    341  1.5.2.2  christos 	register_t retval = 0;
    342  1.5.2.2  christos 	struct sys_getsockopt_args arg;
    343  1.5.2.2  christos 
    344  1.5.2.2  christos 	SPARG(&arg, s) = s;
    345  1.5.2.2  christos 	SPARG(&arg, level) = level;
    346  1.5.2.2  christos 	SPARG(&arg, name) = name;
    347  1.5.2.2  christos 	SPARG(&arg, val) = val;
    348  1.5.2.2  christos 	SPARG(&arg, avalsize) = avalsize;
    349  1.5.2.2  christos 
    350  1.5.2.2  christos 	*error = sys_getsockopt(curlwp, &arg, &retval);
    351  1.5.2.2  christos 	if (*error)
    352  1.5.2.2  christos 		retval = -1;
    353      1.1     pooka 	return retval;
    354      1.1     pooka }
    355  1.5.2.2  christos __weak_alias(sys_getsockopt,rump_enosys);
    356      1.1     pooka 
    357      1.1     pooka int
    358      1.1     pooka rump_sys_rename(const char * from, const char * to, int *error)
    359      1.1     pooka {
    360  1.5.2.2  christos 	register_t retval = 0;
    361      1.1     pooka 	struct sys_rename_args arg;
    362      1.1     pooka 
    363      1.1     pooka 	SPARG(&arg, from) = from;
    364      1.1     pooka 	SPARG(&arg, to) = to;
    365      1.1     pooka 
    366      1.1     pooka 	*error = sys_rename(curlwp, &arg, &retval);
    367  1.5.2.2  christos 	if (*error)
    368  1.5.2.2  christos 		retval = -1;
    369  1.5.2.2  christos 	return retval;
    370  1.5.2.2  christos }
    371  1.5.2.2  christos __weak_alias(sys_rename,rump_enosys);
    372  1.5.2.2  christos 
    373  1.5.2.2  christos int
    374  1.5.2.2  christos rump_sys_mkfifo(const char * path, mode_t mode, int *error)
    375  1.5.2.2  christos {
    376  1.5.2.2  christos 	register_t retval = 0;
    377  1.5.2.2  christos 	struct sys_mkfifo_args arg;
    378  1.5.2.2  christos 
    379  1.5.2.2  christos 	SPARG(&arg, path) = path;
    380  1.5.2.2  christos 	SPARG(&arg, mode) = mode;
    381  1.5.2.2  christos 
    382  1.5.2.2  christos 	*error = sys_mkfifo(curlwp, &arg, &retval);
    383  1.5.2.2  christos 	if (*error)
    384  1.5.2.2  christos 		retval = -1;
    385      1.1     pooka 	return retval;
    386      1.1     pooka }
    387  1.5.2.2  christos __weak_alias(sys_mkfifo,rump_enosys);
    388      1.1     pooka 
    389      1.1     pooka int
    390      1.1     pooka rump_sys_mkdir(const char * path, mode_t mode, int *error)
    391      1.1     pooka {
    392  1.5.2.2  christos 	register_t retval = 0;
    393      1.1     pooka 	struct sys_mkdir_args arg;
    394      1.1     pooka 
    395      1.1     pooka 	SPARG(&arg, path) = path;
    396      1.1     pooka 	SPARG(&arg, mode) = mode;
    397      1.1     pooka 
    398      1.1     pooka 	*error = sys_mkdir(curlwp, &arg, &retval);
    399  1.5.2.2  christos 	if (*error)
    400  1.5.2.2  christos 		retval = -1;
    401      1.1     pooka 	return retval;
    402      1.1     pooka }
    403  1.5.2.2  christos __weak_alias(sys_mkdir,rump_enosys);
    404      1.1     pooka 
    405      1.1     pooka int
    406      1.1     pooka rump_sys_rmdir(const char * path, int *error)
    407      1.1     pooka {
    408  1.5.2.2  christos 	register_t retval = 0;
    409      1.1     pooka 	struct sys_rmdir_args arg;
    410      1.1     pooka 
    411      1.1     pooka 	SPARG(&arg, path) = path;
    412      1.1     pooka 
    413      1.1     pooka 	*error = sys_rmdir(curlwp, &arg, &retval);
    414  1.5.2.2  christos 	if (*error)
    415  1.5.2.2  christos 		retval = -1;
    416  1.5.2.2  christos 	return retval;
    417  1.5.2.2  christos }
    418  1.5.2.2  christos __weak_alias(sys_rmdir,rump_enosys);
    419  1.5.2.2  christos 
    420  1.5.2.2  christos ssize_t
    421  1.5.2.2  christos rump_sys_pread(int fd, void * buf, size_t nbyte, int pad, off_t offset, int *error)
    422  1.5.2.2  christos {
    423  1.5.2.2  christos 	register_t retval = 0;
    424  1.5.2.2  christos 	struct sys_pread_args arg;
    425  1.5.2.2  christos 
    426  1.5.2.2  christos 	SPARG(&arg, fd) = fd;
    427  1.5.2.2  christos 	SPARG(&arg, buf) = buf;
    428  1.5.2.2  christos 	SPARG(&arg, nbyte) = nbyte;
    429  1.5.2.2  christos 	SPARG(&arg, pad) = pad;
    430  1.5.2.2  christos 	SPARG(&arg, offset) = offset;
    431  1.5.2.2  christos 
    432  1.5.2.2  christos 	*error = sys_pread(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_pread,rump_enosys);
    438  1.5.2.2  christos 
    439  1.5.2.2  christos ssize_t
    440  1.5.2.2  christos rump_sys_pwrite(int fd, const void * buf, size_t nbyte, int pad, off_t offset, int *error)
    441  1.5.2.2  christos {
    442  1.5.2.2  christos 	register_t retval = 0;
    443  1.5.2.2  christos 	struct sys_pwrite_args arg;
    444  1.5.2.2  christos 
    445  1.5.2.2  christos 	SPARG(&arg, fd) = fd;
    446  1.5.2.2  christos 	SPARG(&arg, buf) = buf;
    447  1.5.2.2  christos 	SPARG(&arg, nbyte) = nbyte;
    448  1.5.2.2  christos 	SPARG(&arg, pad) = pad;
    449  1.5.2.2  christos 	SPARG(&arg, offset) = offset;
    450  1.5.2.2  christos 
    451  1.5.2.2  christos 	*error = sys_pwrite(curlwp, &arg, &retval);
    452  1.5.2.2  christos 	if (*error)
    453  1.5.2.2  christos 		retval = -1;
    454  1.5.2.2  christos 	return retval;
    455  1.5.2.2  christos }
    456  1.5.2.2  christos __weak_alias(sys_pwrite,rump_enosys);
    457      1.1     pooka 
    458      1.1     pooka int
    459      1.1     pooka rump_sys_truncate(const char * path, int pad, off_t length, int *error)
    460      1.1     pooka {
    461  1.5.2.2  christos 	register_t retval = 0;
    462      1.1     pooka 	struct sys_truncate_args arg;
    463      1.1     pooka 
    464      1.1     pooka 	SPARG(&arg, path) = path;
    465      1.1     pooka 	SPARG(&arg, pad) = pad;
    466      1.1     pooka 	SPARG(&arg, length) = length;
    467      1.1     pooka 
    468      1.1     pooka 	*error = sys_truncate(curlwp, &arg, &retval);
    469  1.5.2.2  christos 	if (*error)
    470  1.5.2.2  christos 		retval = -1;
    471  1.5.2.2  christos 	return retval;
    472  1.5.2.2  christos }
    473  1.5.2.2  christos __weak_alias(sys_truncate,rump_enosys);
    474  1.5.2.2  christos 
    475  1.5.2.2  christos int
    476  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)
    477  1.5.2.2  christos {
    478  1.5.2.2  christos 	register_t retval = 0;
    479  1.5.2.2  christos 	struct sys___sysctl_args arg;
    480  1.5.2.2  christos 
    481  1.5.2.2  christos 	SPARG(&arg, name) = name;
    482  1.5.2.2  christos 	SPARG(&arg, namelen) = namelen;
    483  1.5.2.2  christos 	SPARG(&arg, old) = old;
    484  1.5.2.2  christos 	SPARG(&arg, oldlenp) = oldlenp;
    485  1.5.2.2  christos 	SPARG(&arg, new) = new;
    486  1.5.2.2  christos 	SPARG(&arg, newlen) = newlen;
    487  1.5.2.2  christos 
    488  1.5.2.2  christos 	*error = sys___sysctl(curlwp, &arg, &retval);
    489  1.5.2.2  christos 	if (*error)
    490  1.5.2.2  christos 		retval = -1;
    491      1.1     pooka 	return retval;
    492      1.1     pooka }
    493  1.5.2.2  christos __weak_alias(sys___sysctl,rump_enosys);
    494      1.1     pooka 
    495      1.1     pooka int
    496      1.1     pooka rump_sys_lchmod(const char * path, mode_t mode, int *error)
    497      1.1     pooka {
    498  1.5.2.2  christos 	register_t retval = 0;
    499      1.1     pooka 	struct sys_lchmod_args arg;
    500      1.1     pooka 
    501      1.1     pooka 	SPARG(&arg, path) = path;
    502      1.1     pooka 	SPARG(&arg, mode) = mode;
    503      1.1     pooka 
    504      1.1     pooka 	*error = sys_lchmod(curlwp, &arg, &retval);
    505  1.5.2.2  christos 	if (*error)
    506  1.5.2.2  christos 		retval = -1;
    507      1.1     pooka 	return retval;
    508      1.1     pooka }
    509  1.5.2.2  christos __weak_alias(sys_lchmod,rump_enosys);
    510      1.1     pooka 
    511      1.1     pooka int
    512      1.1     pooka rump_sys_lchown(const char * path, uid_t uid, gid_t gid, int *error)
    513      1.1     pooka {
    514  1.5.2.2  christos 	register_t retval = 0;
    515      1.1     pooka 	struct sys_lchown_args arg;
    516      1.1     pooka 
    517      1.1     pooka 	SPARG(&arg, path) = path;
    518      1.1     pooka 	SPARG(&arg, uid) = uid;
    519      1.1     pooka 	SPARG(&arg, gid) = gid;
    520      1.1     pooka 
    521      1.1     pooka 	*error = sys_lchown(curlwp, &arg, &retval);
    522  1.5.2.2  christos 	if (*error)
    523  1.5.2.2  christos 		retval = -1;
    524  1.5.2.2  christos 	return retval;
    525  1.5.2.2  christos }
    526  1.5.2.2  christos __weak_alias(sys_lchown,rump_enosys);
    527  1.5.2.2  christos 
    528  1.5.2.2  christos int
    529  1.5.2.2  christos rump_sys_lutimes(const char * path, const struct timeval50 * tptr, int *error)
    530  1.5.2.2  christos {
    531  1.5.2.2  christos 	register_t retval = 0;
    532  1.5.2.2  christos 	struct sys_lutimescompat_50__args arg;
    533  1.5.2.2  christos 
    534  1.5.2.2  christos 	SPARG(&arg, path) = path;
    535  1.5.2.2  christos 	SPARG(&arg, tptr) = tptr;
    536  1.5.2.2  christos 
    537  1.5.2.2  christos 	*error = sys_lutimes(curlwp, &arg, &retval);
    538  1.5.2.2  christos 	if (*error)
    539  1.5.2.2  christos 		retval = -1;
    540  1.5.2.2  christos 	return retval;
    541  1.5.2.2  christos }
    542  1.5.2.2  christos __weak_alias(sys_lutimes,rump_enosys);
    543  1.5.2.2  christos 
    544  1.5.2.2  christos int
    545  1.5.2.2  christos rump_sys_lchflags(const char * path, u_long flags, int *error)
    546  1.5.2.2  christos {
    547  1.5.2.2  christos 	register_t retval = 0;
    548  1.5.2.2  christos 	struct sys_lchflags_args arg;
    549  1.5.2.2  christos 
    550  1.5.2.2  christos 	SPARG(&arg, path) = path;
    551  1.5.2.2  christos 	SPARG(&arg, flags) = flags;
    552  1.5.2.2  christos 
    553  1.5.2.2  christos 	*error = sys_lchflags(curlwp, &arg, &retval);
    554  1.5.2.2  christos 	if (*error)
    555  1.5.2.2  christos 		retval = -1;
    556  1.5.2.2  christos 	return retval;
    557  1.5.2.2  christos }
    558  1.5.2.2  christos __weak_alias(sys_lchflags,rump_enosys);
    559  1.5.2.2  christos 
    560  1.5.2.2  christos int
    561  1.5.2.2  christos rump_sys___socket30(int domain, int type, int protocol, int *error)
    562  1.5.2.2  christos {
    563  1.5.2.2  christos 	register_t retval = 0;
    564  1.5.2.2  christos 	struct sys___socket30_args arg;
    565  1.5.2.2  christos 
    566  1.5.2.2  christos 	SPARG(&arg, domain) = domain;
    567  1.5.2.2  christos 	SPARG(&arg, type) = type;
    568  1.5.2.2  christos 	SPARG(&arg, protocol) = protocol;
    569  1.5.2.2  christos 
    570  1.5.2.2  christos 	*error = sys___socket30(curlwp, &arg, &retval);
    571  1.5.2.2  christos 	if (*error)
    572  1.5.2.2  christos 		retval = -1;
    573  1.5.2.2  christos 	return retval;
    574  1.5.2.2  christos }
    575  1.5.2.2  christos __weak_alias(sys___socket30,rump_enosys);
    576  1.5.2.2  christos 
    577  1.5.2.2  christos int
    578  1.5.2.2  christos rump_sys___lutimes50(const char * path, const struct timeval * tptr, int *error)
    579  1.5.2.2  christos {
    580  1.5.2.2  christos 	register_t retval = 0;
    581  1.5.2.2  christos 	struct sys___lutimes50_args arg;
    582  1.5.2.2  christos 
    583  1.5.2.2  christos 	SPARG(&arg, path) = path;
    584  1.5.2.2  christos 	SPARG(&arg, tptr) = tptr;
    585  1.5.2.2  christos 
    586  1.5.2.2  christos 	*error = sys___lutimes50(curlwp, &arg, &retval);
    587  1.5.2.2  christos 	if (*error)
    588  1.5.2.2  christos 		retval = -1;
    589  1.5.2.2  christos 	return retval;
    590  1.5.2.2  christos }
    591  1.5.2.2  christos __weak_alias(sys___lutimes50,rump_enosys);
    592  1.5.2.2  christos 
    593  1.5.2.2  christos int
    594  1.5.2.2  christos rump_sys___stat50(const char * path, struct stat * ub, int *error)
    595  1.5.2.2  christos {
    596  1.5.2.2  christos 	register_t retval = 0;
    597  1.5.2.2  christos 	struct sys___stat50_args arg;
    598  1.5.2.2  christos 
    599  1.5.2.2  christos 	SPARG(&arg, path) = path;
    600  1.5.2.2  christos 	SPARG(&arg, ub) = ub;
    601  1.5.2.2  christos 
    602  1.5.2.2  christos 	*error = sys___stat50(curlwp, &arg, &retval);
    603  1.5.2.2  christos 	if (*error)
    604  1.5.2.2  christos 		retval = -1;
    605  1.5.2.2  christos 	return retval;
    606  1.5.2.2  christos }
    607  1.5.2.2  christos __weak_alias(sys___stat50,rump_enosys);
    608  1.5.2.2  christos 
    609  1.5.2.2  christos int
    610  1.5.2.2  christos rump_sys___lstat50(const char * path, struct stat * ub, int *error)
    611  1.5.2.2  christos {
    612  1.5.2.2  christos 	register_t retval = 0;
    613  1.5.2.2  christos 	struct sys___lstat50_args arg;
    614  1.5.2.2  christos 
    615  1.5.2.2  christos 	SPARG(&arg, path) = path;
    616  1.5.2.2  christos 	SPARG(&arg, ub) = ub;
    617  1.5.2.2  christos 
    618  1.5.2.2  christos 	*error = sys___lstat50(curlwp, &arg, &retval);
    619  1.5.2.2  christos 	if (*error)
    620  1.5.2.2  christos 		retval = -1;
    621  1.5.2.2  christos 	return retval;
    622  1.5.2.2  christos }
    623  1.5.2.2  christos __weak_alias(sys___lstat50,rump_enosys);
    624      1.1     pooka 
    625  1.5.2.1  christos int
    626  1.5.2.1  christos rump_sys___mknod50(const char * path, mode_t mode, dev_t dev, int *error)
    627  1.5.2.1  christos {
    628  1.5.2.2  christos 	register_t retval = 0;
    629  1.5.2.1  christos 	struct sys___mknod50_args arg;
    630  1.5.2.1  christos 
    631  1.5.2.1  christos 	SPARG(&arg, path) = path;
    632  1.5.2.1  christos 	SPARG(&arg, mode) = mode;
    633  1.5.2.1  christos 	SPARG(&arg, dev) = dev;
    634  1.5.2.1  christos 
    635  1.5.2.1  christos 	*error = sys___mknod50(curlwp, &arg, &retval);
    636  1.5.2.2  christos 	if (*error)
    637  1.5.2.2  christos 		retval = -1;
    638  1.5.2.1  christos 	return retval;
    639  1.5.2.1  christos }
    640  1.5.2.2  christos __weak_alias(sys___mknod50,rump_enosys);
    641