Home | History | Annotate | Line # | Download | only in rumpkern
rump_syscalls.c revision 1.5.2.3
      1      1.1     pooka /* $NetBSD: rump_syscalls.c,v 1.5.2.3 2008/11/09 02:02:52 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.3  christos  * created from	NetBSD: syscalls.master,v 1.196.2.2 2008/11/01 21:22:27 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.3 2008/11/09 02:02:52 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.1     pooka #include "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.5.2.1  christos rump_sys_mknod(const char * path, mode_t mode, uint32_t dev, int *error)
    163      1.1     pooka {
    164  1.5.2.2  christos 	register_t retval = 0;
    165  1.5.2.1  christos 	struct sys_mknodcompat_50__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 	SPARG(&arg, dev) = dev;
    170      1.1     pooka 
    171      1.1     pooka 	*error = sys_mknod(curlwp, &arg, &retval);
    172  1.5.2.2  christos 	if (*error)
    173  1.5.2.2  christos 		retval = -1;
    174      1.1     pooka 	return retval;
    175      1.1     pooka }
    176  1.5.2.2  christos __weak_alias(sys_mknod,rump_enosys);
    177      1.1     pooka 
    178      1.1     pooka int
    179      1.1     pooka rump_sys_chmod(const char * path, mode_t mode, int *error)
    180      1.1     pooka {
    181  1.5.2.2  christos 	register_t retval = 0;
    182      1.1     pooka 	struct sys_chmod_args arg;
    183      1.1     pooka 
    184      1.1     pooka 	SPARG(&arg, path) = path;
    185      1.1     pooka 	SPARG(&arg, mode) = mode;
    186      1.1     pooka 
    187      1.1     pooka 	*error = sys_chmod(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_chmod,rump_enosys);
    193      1.1     pooka 
    194      1.1     pooka int
    195      1.1     pooka rump_sys_chown(const char * path, uid_t uid, gid_t gid, int *error)
    196      1.1     pooka {
    197  1.5.2.2  christos 	register_t retval = 0;
    198      1.1     pooka 	struct sys_chown_args arg;
    199      1.1     pooka 
    200      1.1     pooka 	SPARG(&arg, path) = path;
    201      1.1     pooka 	SPARG(&arg, uid) = uid;
    202      1.1     pooka 	SPARG(&arg, gid) = gid;
    203      1.1     pooka 
    204      1.1     pooka 	*error = sys_chown(curlwp, &arg, &retval);
    205  1.5.2.2  christos 	if (*error)
    206  1.5.2.2  christos 		retval = -1;
    207      1.1     pooka 	return retval;
    208      1.1     pooka }
    209  1.5.2.2  christos __weak_alias(sys_chown,rump_enosys);
    210      1.1     pooka 
    211      1.1     pooka int
    212      1.1     pooka rump_sys_unmount(const char * path, int flags, int *error)
    213      1.1     pooka {
    214  1.5.2.2  christos 	register_t retval = 0;
    215      1.1     pooka 	struct sys_unmount_args arg;
    216      1.1     pooka 
    217      1.1     pooka 	SPARG(&arg, path) = path;
    218      1.1     pooka 	SPARG(&arg, flags) = flags;
    219      1.1     pooka 
    220      1.1     pooka 	*error = sys_unmount(curlwp, &arg, &retval);
    221  1.5.2.2  christos 	if (*error)
    222  1.5.2.2  christos 		retval = -1;
    223      1.1     pooka 	return retval;
    224      1.1     pooka }
    225  1.5.2.2  christos __weak_alias(sys_unmount,rump_enosys);
    226      1.1     pooka 
    227      1.1     pooka 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.2  christos rump_sys_setsockopt(int s, int level, int name, const void * val, unsigned int valsize, int *error)
    338  1.5.2.2  christos {
    339  1.5.2.2  christos 	register_t retval = 0;
    340  1.5.2.2  christos 	struct sys_setsockopt_args arg;
    341  1.5.2.2  christos 
    342  1.5.2.2  christos 	SPARG(&arg, s) = s;
    343  1.5.2.2  christos 	SPARG(&arg, level) = level;
    344  1.5.2.2  christos 	SPARG(&arg, name) = name;
    345  1.5.2.2  christos 	SPARG(&arg, val) = val;
    346  1.5.2.2  christos 	SPARG(&arg, valsize) = valsize;
    347  1.5.2.2  christos 
    348  1.5.2.2  christos 	*error = sys_setsockopt(curlwp, &arg, &retval);
    349  1.5.2.2  christos 	if (*error)
    350  1.5.2.2  christos 		retval = -1;
    351  1.5.2.2  christos 	return retval;
    352  1.5.2.2  christos }
    353  1.5.2.2  christos __weak_alias(sys_setsockopt,rump_enosys);
    354  1.5.2.2  christos 
    355  1.5.2.2  christos int
    356  1.5.2.2  christos rump_sys_getsockopt(int s, int level, int name, void * val, unsigned int * avalsize, int *error)
    357  1.5.2.2  christos {
    358  1.5.2.2  christos 	register_t retval = 0;
    359  1.5.2.2  christos 	struct sys_getsockopt_args arg;
    360  1.5.2.2  christos 
    361  1.5.2.2  christos 	SPARG(&arg, s) = s;
    362  1.5.2.2  christos 	SPARG(&arg, level) = level;
    363  1.5.2.2  christos 	SPARG(&arg, name) = name;
    364  1.5.2.2  christos 	SPARG(&arg, val) = val;
    365  1.5.2.2  christos 	SPARG(&arg, avalsize) = avalsize;
    366  1.5.2.2  christos 
    367  1.5.2.2  christos 	*error = sys_getsockopt(curlwp, &arg, &retval);
    368  1.5.2.2  christos 	if (*error)
    369  1.5.2.2  christos 		retval = -1;
    370      1.1     pooka 	return retval;
    371      1.1     pooka }
    372  1.5.2.2  christos __weak_alias(sys_getsockopt,rump_enosys);
    373      1.1     pooka 
    374      1.1     pooka int
    375      1.1     pooka rump_sys_rename(const char * from, const char * to, int *error)
    376      1.1     pooka {
    377  1.5.2.2  christos 	register_t retval = 0;
    378      1.1     pooka 	struct sys_rename_args arg;
    379      1.1     pooka 
    380      1.1     pooka 	SPARG(&arg, from) = from;
    381      1.1     pooka 	SPARG(&arg, to) = to;
    382      1.1     pooka 
    383      1.1     pooka 	*error = sys_rename(curlwp, &arg, &retval);
    384  1.5.2.2  christos 	if (*error)
    385  1.5.2.2  christos 		retval = -1;
    386  1.5.2.2  christos 	return retval;
    387  1.5.2.2  christos }
    388  1.5.2.2  christos __weak_alias(sys_rename,rump_enosys);
    389  1.5.2.2  christos 
    390  1.5.2.2  christos int
    391  1.5.2.2  christos rump_sys_mkfifo(const char * path, mode_t mode, int *error)
    392  1.5.2.2  christos {
    393  1.5.2.2  christos 	register_t retval = 0;
    394  1.5.2.2  christos 	struct sys_mkfifo_args arg;
    395  1.5.2.2  christos 
    396  1.5.2.2  christos 	SPARG(&arg, path) = path;
    397  1.5.2.2  christos 	SPARG(&arg, mode) = mode;
    398  1.5.2.2  christos 
    399  1.5.2.2  christos 	*error = sys_mkfifo(curlwp, &arg, &retval);
    400  1.5.2.2  christos 	if (*error)
    401  1.5.2.2  christos 		retval = -1;
    402      1.1     pooka 	return retval;
    403      1.1     pooka }
    404  1.5.2.2  christos __weak_alias(sys_mkfifo,rump_enosys);
    405      1.1     pooka 
    406      1.1     pooka int
    407      1.1     pooka rump_sys_mkdir(const char * path, mode_t mode, int *error)
    408      1.1     pooka {
    409  1.5.2.2  christos 	register_t retval = 0;
    410      1.1     pooka 	struct sys_mkdir_args arg;
    411      1.1     pooka 
    412      1.1     pooka 	SPARG(&arg, path) = path;
    413      1.1     pooka 	SPARG(&arg, mode) = mode;
    414      1.1     pooka 
    415      1.1     pooka 	*error = sys_mkdir(curlwp, &arg, &retval);
    416  1.5.2.2  christos 	if (*error)
    417  1.5.2.2  christos 		retval = -1;
    418      1.1     pooka 	return retval;
    419      1.1     pooka }
    420  1.5.2.2  christos __weak_alias(sys_mkdir,rump_enosys);
    421      1.1     pooka 
    422      1.1     pooka int
    423      1.1     pooka rump_sys_rmdir(const char * path, int *error)
    424      1.1     pooka {
    425  1.5.2.2  christos 	register_t retval = 0;
    426      1.1     pooka 	struct sys_rmdir_args arg;
    427      1.1     pooka 
    428      1.1     pooka 	SPARG(&arg, path) = path;
    429      1.1     pooka 
    430      1.1     pooka 	*error = sys_rmdir(curlwp, &arg, &retval);
    431  1.5.2.2  christos 	if (*error)
    432  1.5.2.2  christos 		retval = -1;
    433  1.5.2.2  christos 	return retval;
    434  1.5.2.2  christos }
    435  1.5.2.2  christos __weak_alias(sys_rmdir,rump_enosys);
    436  1.5.2.2  christos 
    437  1.5.2.2  christos ssize_t
    438  1.5.2.2  christos rump_sys_pread(int fd, void * buf, size_t nbyte, int pad, off_t offset, int *error)
    439  1.5.2.2  christos {
    440  1.5.2.2  christos 	register_t retval = 0;
    441  1.5.2.2  christos 	struct sys_pread_args arg;
    442  1.5.2.2  christos 
    443  1.5.2.2  christos 	SPARG(&arg, fd) = fd;
    444  1.5.2.2  christos 	SPARG(&arg, buf) = buf;
    445  1.5.2.2  christos 	SPARG(&arg, nbyte) = nbyte;
    446  1.5.2.2  christos 	SPARG(&arg, pad) = pad;
    447  1.5.2.2  christos 	SPARG(&arg, offset) = offset;
    448  1.5.2.2  christos 
    449  1.5.2.2  christos 	*error = sys_pread(curlwp, &arg, &retval);
    450  1.5.2.2  christos 	if (*error)
    451  1.5.2.2  christos 		retval = -1;
    452      1.1     pooka 	return retval;
    453      1.1     pooka }
    454  1.5.2.2  christos __weak_alias(sys_pread,rump_enosys);
    455  1.5.2.2  christos 
    456  1.5.2.2  christos ssize_t
    457  1.5.2.2  christos rump_sys_pwrite(int fd, const void * buf, size_t nbyte, int pad, off_t offset, int *error)
    458  1.5.2.2  christos {
    459  1.5.2.2  christos 	register_t retval = 0;
    460  1.5.2.2  christos 	struct sys_pwrite_args arg;
    461  1.5.2.2  christos 
    462  1.5.2.2  christos 	SPARG(&arg, fd) = fd;
    463  1.5.2.2  christos 	SPARG(&arg, buf) = buf;
    464  1.5.2.2  christos 	SPARG(&arg, nbyte) = nbyte;
    465  1.5.2.2  christos 	SPARG(&arg, pad) = pad;
    466  1.5.2.2  christos 	SPARG(&arg, offset) = offset;
    467  1.5.2.2  christos 
    468  1.5.2.2  christos 	*error = sys_pwrite(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_pwrite,rump_enosys);
    474      1.1     pooka 
    475      1.1     pooka int
    476      1.1     pooka rump_sys_truncate(const char * path, int pad, off_t length, int *error)
    477      1.1     pooka {
    478  1.5.2.2  christos 	register_t retval = 0;
    479      1.1     pooka 	struct sys_truncate_args arg;
    480      1.1     pooka 
    481      1.1     pooka 	SPARG(&arg, path) = path;
    482      1.1     pooka 	SPARG(&arg, pad) = pad;
    483      1.1     pooka 	SPARG(&arg, length) = length;
    484      1.1     pooka 
    485      1.1     pooka 	*error = sys_truncate(curlwp, &arg, &retval);
    486  1.5.2.2  christos 	if (*error)
    487  1.5.2.2  christos 		retval = -1;
    488  1.5.2.2  christos 	return retval;
    489  1.5.2.2  christos }
    490  1.5.2.2  christos __weak_alias(sys_truncate,rump_enosys);
    491  1.5.2.2  christos 
    492  1.5.2.2  christos int
    493  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)
    494  1.5.2.2  christos {
    495  1.5.2.2  christos 	register_t retval = 0;
    496  1.5.2.2  christos 	struct sys___sysctl_args arg;
    497  1.5.2.2  christos 
    498  1.5.2.2  christos 	SPARG(&arg, name) = name;
    499  1.5.2.2  christos 	SPARG(&arg, namelen) = namelen;
    500  1.5.2.2  christos 	SPARG(&arg, old) = old;
    501  1.5.2.2  christos 	SPARG(&arg, oldlenp) = oldlenp;
    502  1.5.2.2  christos 	SPARG(&arg, new) = new;
    503  1.5.2.2  christos 	SPARG(&arg, newlen) = newlen;
    504  1.5.2.2  christos 
    505  1.5.2.2  christos 	*error = sys___sysctl(curlwp, &arg, &retval);
    506  1.5.2.2  christos 	if (*error)
    507  1.5.2.2  christos 		retval = -1;
    508      1.1     pooka 	return retval;
    509      1.1     pooka }
    510  1.5.2.2  christos __weak_alias(sys___sysctl,rump_enosys);
    511      1.1     pooka 
    512      1.1     pooka int
    513      1.1     pooka rump_sys_lchmod(const char * path, mode_t mode, int *error)
    514      1.1     pooka {
    515  1.5.2.2  christos 	register_t retval = 0;
    516      1.1     pooka 	struct sys_lchmod_args arg;
    517      1.1     pooka 
    518      1.1     pooka 	SPARG(&arg, path) = path;
    519      1.1     pooka 	SPARG(&arg, mode) = mode;
    520      1.1     pooka 
    521      1.1     pooka 	*error = sys_lchmod(curlwp, &arg, &retval);
    522  1.5.2.2  christos 	if (*error)
    523  1.5.2.2  christos 		retval = -1;
    524      1.1     pooka 	return retval;
    525      1.1     pooka }
    526  1.5.2.2  christos __weak_alias(sys_lchmod,rump_enosys);
    527      1.1     pooka 
    528      1.1     pooka int
    529      1.1     pooka rump_sys_lchown(const char * path, uid_t uid, gid_t gid, int *error)
    530      1.1     pooka {
    531  1.5.2.2  christos 	register_t retval = 0;
    532      1.1     pooka 	struct sys_lchown_args arg;
    533      1.1     pooka 
    534      1.1     pooka 	SPARG(&arg, path) = path;
    535      1.1     pooka 	SPARG(&arg, uid) = uid;
    536      1.1     pooka 	SPARG(&arg, gid) = gid;
    537      1.1     pooka 
    538      1.1     pooka 	*error = sys_lchown(curlwp, &arg, &retval);
    539  1.5.2.2  christos 	if (*error)
    540  1.5.2.2  christos 		retval = -1;
    541  1.5.2.2  christos 	return retval;
    542  1.5.2.2  christos }
    543  1.5.2.2  christos __weak_alias(sys_lchown,rump_enosys);
    544  1.5.2.2  christos 
    545  1.5.2.2  christos int
    546  1.5.2.2  christos rump_sys_lutimes(const char * path, const struct timeval50 * tptr, int *error)
    547  1.5.2.2  christos {
    548  1.5.2.2  christos 	register_t retval = 0;
    549  1.5.2.2  christos 	struct sys_lutimescompat_50__args arg;
    550  1.5.2.2  christos 
    551  1.5.2.2  christos 	SPARG(&arg, path) = path;
    552  1.5.2.2  christos 	SPARG(&arg, tptr) = tptr;
    553  1.5.2.2  christos 
    554  1.5.2.2  christos 	*error = sys_lutimes(curlwp, &arg, &retval);
    555  1.5.2.2  christos 	if (*error)
    556  1.5.2.2  christos 		retval = -1;
    557  1.5.2.2  christos 	return retval;
    558  1.5.2.2  christos }
    559  1.5.2.2  christos __weak_alias(sys_lutimes,rump_enosys);
    560  1.5.2.2  christos 
    561  1.5.2.2  christos int
    562  1.5.2.2  christos rump_sys_lchflags(const char * path, u_long flags, int *error)
    563  1.5.2.2  christos {
    564  1.5.2.2  christos 	register_t retval = 0;
    565  1.5.2.2  christos 	struct sys_lchflags_args arg;
    566  1.5.2.2  christos 
    567  1.5.2.2  christos 	SPARG(&arg, path) = path;
    568  1.5.2.2  christos 	SPARG(&arg, flags) = flags;
    569  1.5.2.2  christos 
    570  1.5.2.2  christos 	*error = sys_lchflags(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_lchflags,rump_enosys);
    576  1.5.2.2  christos 
    577  1.5.2.2  christos int
    578  1.5.2.2  christos rump_sys___stat30(const char * path, struct stat30 * ub, 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___stat30compat_50__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, ub) = ub;
    585  1.5.2.2  christos 
    586  1.5.2.2  christos 	*error = sys___stat30(curlwp, &arg, &retval);
    587  1.5.2.2  christos 	if (*error)
    588  1.5.2.2  christos 		retval = -1;
    589      1.1     pooka 	return retval;
    590      1.1     pooka }
    591  1.5.2.2  christos __weak_alias(sys___stat30,rump_enosys);
    592  1.5.2.2  christos 
    593  1.5.2.2  christos int
    594  1.5.2.2  christos rump_sys___lstat30(const char * path, struct stat30 * 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___lstat30compat_50__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___lstat30(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___lstat30,rump_enosys);
    608  1.5.2.2  christos 
    609  1.5.2.2  christos int
    610  1.5.2.2  christos rump_sys___socket30(int domain, int type, int protocol, 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___socket30_args arg;
    614  1.5.2.2  christos 
    615  1.5.2.2  christos 	SPARG(&arg, domain) = domain;
    616  1.5.2.2  christos 	SPARG(&arg, type) = type;
    617  1.5.2.2  christos 	SPARG(&arg, protocol) = protocol;
    618  1.5.2.2  christos 
    619  1.5.2.2  christos 	*error = sys___socket30(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___socket30,rump_enosys);
    625  1.5.2.2  christos 
    626  1.5.2.2  christos int
    627  1.5.2.2  christos rump_sys___lutimes50(const char * path, const struct timeval * tptr, int *error)
    628  1.5.2.2  christos {
    629  1.5.2.2  christos 	register_t retval = 0;
    630  1.5.2.2  christos 	struct sys___lutimes50_args arg;
    631  1.5.2.2  christos 
    632  1.5.2.2  christos 	SPARG(&arg, path) = path;
    633  1.5.2.2  christos 	SPARG(&arg, tptr) = tptr;
    634  1.5.2.2  christos 
    635  1.5.2.2  christos 	*error = sys___lutimes50(curlwp, &arg, &retval);
    636  1.5.2.2  christos 	if (*error)
    637  1.5.2.2  christos 		retval = -1;
    638  1.5.2.2  christos 	return retval;
    639  1.5.2.2  christos }
    640  1.5.2.2  christos __weak_alias(sys___lutimes50,rump_enosys);
    641  1.5.2.2  christos 
    642  1.5.2.2  christos int
    643  1.5.2.2  christos rump_sys___stat50(const char * path, struct stat * ub, int *error)
    644  1.5.2.2  christos {
    645  1.5.2.2  christos 	register_t retval = 0;
    646  1.5.2.2  christos 	struct sys___stat50_args arg;
    647  1.5.2.2  christos 
    648  1.5.2.2  christos 	SPARG(&arg, path) = path;
    649  1.5.2.2  christos 	SPARG(&arg, ub) = ub;
    650  1.5.2.2  christos 
    651  1.5.2.2  christos 	*error = sys___stat50(curlwp, &arg, &retval);
    652  1.5.2.2  christos 	if (*error)
    653  1.5.2.2  christos 		retval = -1;
    654  1.5.2.2  christos 	return retval;
    655  1.5.2.2  christos }
    656  1.5.2.2  christos __weak_alias(sys___stat50,rump_enosys);
    657  1.5.2.2  christos 
    658  1.5.2.2  christos int
    659  1.5.2.2  christos rump_sys___lstat50(const char * path, struct stat * ub, int *error)
    660  1.5.2.2  christos {
    661  1.5.2.2  christos 	register_t retval = 0;
    662  1.5.2.2  christos 	struct sys___lstat50_args arg;
    663  1.5.2.2  christos 
    664  1.5.2.2  christos 	SPARG(&arg, path) = path;
    665  1.5.2.2  christos 	SPARG(&arg, ub) = ub;
    666  1.5.2.2  christos 
    667  1.5.2.2  christos 	*error = sys___lstat50(curlwp, &arg, &retval);
    668  1.5.2.2  christos 	if (*error)
    669  1.5.2.2  christos 		retval = -1;
    670  1.5.2.2  christos 	return retval;
    671  1.5.2.2  christos }
    672  1.5.2.2  christos __weak_alias(sys___lstat50,rump_enosys);
    673      1.1     pooka 
    674  1.5.2.1  christos int
    675  1.5.2.1  christos rump_sys___mknod50(const char * path, mode_t mode, dev_t dev, int *error)
    676  1.5.2.1  christos {
    677  1.5.2.2  christos 	register_t retval = 0;
    678  1.5.2.1  christos 	struct sys___mknod50_args arg;
    679  1.5.2.1  christos 
    680  1.5.2.1  christos 	SPARG(&arg, path) = path;
    681  1.5.2.1  christos 	SPARG(&arg, mode) = mode;
    682  1.5.2.1  christos 	SPARG(&arg, dev) = dev;
    683  1.5.2.1  christos 
    684  1.5.2.1  christos 	*error = sys___mknod50(curlwp, &arg, &retval);
    685  1.5.2.2  christos 	if (*error)
    686  1.5.2.2  christos 		retval = -1;
    687  1.5.2.1  christos 	return retval;
    688  1.5.2.1  christos }
    689  1.5.2.2  christos __weak_alias(sys___mknod50,rump_enosys);
    690