diff options
author | alfred <alfred@FreeBSD.org> | 2002-12-14 01:56:26 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-12-14 01:56:26 +0000 |
commit | d070c0a52d25d76fe9298c4217dc07e9439decca (patch) | |
tree | f2f1c63d7a3acfeb3493534ac55908632c5769ee /sys/compat | |
parent | 069ffa44b51ac78013fd8505fb1faf6c57b4bb12 (diff) | |
download | FreeBSD-src-d070c0a52d25d76fe9298c4217dc07e9439decca.zip FreeBSD-src-d070c0a52d25d76fe9298c4217dc07e9439decca.tar.gz |
SCARGS removal take II.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/freebsd32/freebsd32_misc.c | 256 | ||||
-rw-r--r-- | sys/compat/freebsd32/freebsd32_util.h | 5 | ||||
-rw-r--r-- | sys/compat/ia32/ia32_util.h | 5 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_fcntl.c | 122 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_filio.c | 34 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_ioctl.c | 10 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_ipc.c | 166 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_misc.c | 280 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_resource.c | 16 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_signal.c | 82 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_socket.c | 12 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_stat.c | 148 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_stream.c | 166 |
13 files changed, 646 insertions, 656 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index b5dc006..10eb642 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -237,11 +237,11 @@ ia32_wait4(struct thread *td, struct ia32_wait4_args *uap) struct rusage32 *rusage32, ru32; struct rusage *rusage = NULL, ru; - rusage32 = SCARG(uap, rusage); + rusage32 = uap->rusage; if (rusage32) { sg = stackgap_init(); rusage = stackgap_alloc(&sg, sizeof(struct rusage)); - SCARG(uap, rusage) = (struct rusage32 *)rusage; + uap->rusage = (struct rusage32 *)rusage; } error = wait4(td, (struct wait_args *)uap); if (error) @@ -304,13 +304,13 @@ ia32_getfsstat(struct thread *td, struct ia32_getfsstat_args *uap) struct statfs *sp = NULL, stat; int maxcount, count, i; - sp32 = SCARG(uap, buf); - maxcount = SCARG(uap, bufsize) / sizeof(struct statfs32); + sp32 = uap->buf; + maxcount = uap->bufsize / sizeof(struct statfs32); if (sp32) { sg = stackgap_init(); sp = stackgap_alloc(&sg, sizeof(struct statfs) * maxcount); - SCARG(uap, buf) = (struct statfs32 *)sp; + uap->buf = (struct statfs32 *)sp; } error = getfsstat(td, (struct getfsstat_args *) uap); if (sp32 && !error) { @@ -364,11 +364,11 @@ ia32_sigaltstack(struct thread *td, struct ia32_sigaltstack_args *uap) struct sigaltstack32 *p32, *op32, s32; struct sigaltstack *p = NULL, *op = NULL, s; - p32 = SCARG(uap, ss); + p32 = uap->ss; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct sigaltstack)); - SCARG(uap, ss) = (struct sigaltstack32 *)p; + uap->ss = (struct sigaltstack32 *)p; error = copyin(p32, &s32, sizeof(s32)); if (error) return (error); @@ -379,11 +379,11 @@ ia32_sigaltstack(struct thread *td, struct ia32_sigaltstack_args *uap) if (error) return (error); } - op32 = SCARG(uap, oss); + op32 = uap->oss; if (op32) { sg = stackgap_init(); op = stackgap_alloc(&sg, sizeof(struct sigaltstack)); - SCARG(uap, oss) = (struct sigaltstack32 *)op; + uap->oss = (struct sigaltstack32 *)op; } error = sigaltstack(td, (struct sigaltstack_args *) uap); if (error) @@ -411,12 +411,12 @@ ia32_execve(struct thread *td, struct ia32_execve_args *uap) int count; sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, fname)); - SCARG(&ap, fname) = SCARG(uap, fname); + CHECKALTEXIST(td, &sg, uap->fname); + ap.fname = uap->fname; - if (SCARG(uap, argv)) { + if (uap->argv) { count = 0; - p32 = SCARG(uap, argv); + p32 = uap->argv; do { error = copyin(p32++, &arg, sizeof(arg)); if (error) @@ -424,8 +424,8 @@ ia32_execve(struct thread *td, struct ia32_execve_args *uap) count++; } while (arg != 0); p = stackgap_alloc(&sg, count * sizeof(char *)); - SCARG(&ap, argv) = p; - p32 = SCARG(uap, argv); + ap.argv = p; + p32 = uap->argv; do { error = copyin(p32++, &arg, sizeof(arg)); if (error) @@ -433,9 +433,9 @@ ia32_execve(struct thread *td, struct ia32_execve_args *uap) *p++ = PTRIN(arg); } while (arg != 0); } - if (SCARG(uap, envv)) { + if (uap->envv) { count = 0; - p32 = SCARG(uap, envv); + p32 = uap->envv; do { error = copyin(p32++, &arg, sizeof(arg)); if (error) @@ -443,8 +443,8 @@ ia32_execve(struct thread *td, struct ia32_execve_args *uap) count++; } while (arg != 0); p = stackgap_alloc(&sg, count * sizeof(char *)); - SCARG(&ap, envv) = p; - p32 = SCARG(uap, envv); + ap.envv = p; + p32 = uap->envv; do { error = copyin(p32++, &arg, sizeof(arg)); if (error) @@ -489,10 +489,10 @@ ia32_mmap_partial(struct thread *td, vm_offset_t start, vm_offset_t end, if (fd != -1) { struct pread_args r; - SCARG(&r, fd) = fd; - SCARG(&r, buf) = (void *) start; - SCARG(&r, nbyte) = end - start; - SCARG(&r, offset) = pos; + r.fd = fd; + r.buf = (void *) start; + r.nbyte = end - start; + r.offset = pos; return (pread(td, &r)); } else { while (start < end) { @@ -507,13 +507,13 @@ int ia32_mmap(struct thread *td, struct ia32_mmap_args *uap) { struct mmap_args ap; - vm_offset_t addr = (vm_offset_t) SCARG(uap, addr); - vm_size_t len = SCARG(uap, len); - int prot = SCARG(uap, prot); - int flags = SCARG(uap, flags); - int fd = SCARG(uap, fd); - off_t pos = (SCARG(uap, poslo) - | ((off_t)SCARG(uap, poshi) << 32)); + vm_offset_t addr = (vm_offset_t) uap->addr; + vm_size_t len = uap->len; + int prot = uap->prot; + int flags = uap->flags; + int fd = uap->fd; + off_t pos = (uap->poslo + | ((off_t)uap->poshi << 32)); vm_size_t pageoff; int error; @@ -562,10 +562,10 @@ ia32_mmap(struct thread *td, struct ia32_mmap_args *uap) prot, VM_PROT_ALL, 0); if (rv != KERN_SUCCESS) return (EINVAL); - SCARG(&r, fd) = fd; - SCARG(&r, buf) = (void *) start; - SCARG(&r, nbyte) = end - start; - SCARG(&r, offset) = pos; + r.fd = fd; + r.buf = (void *) start; + r.nbyte = end - start; + r.offset = pos; error = pread(td, &r); if (error) return (error); @@ -585,12 +585,12 @@ ia32_mmap(struct thread *td, struct ia32_mmap_args *uap) len = end - start; } - SCARG(&ap, addr) = (void *) addr; - SCARG(&ap, len) = len; - SCARG(&ap, prot) = prot; - SCARG(&ap, flags) = flags; - SCARG(&ap, fd) = fd; - SCARG(&ap, pos) = pos; + ap.addr = (void *) addr; + ap.len = len; + ap.prot = prot; + ap.flags = flags; + ap.fd = fd; + ap.pos = pos; return (mmap(td, &ap)); } @@ -608,11 +608,11 @@ ia32_setitimer(struct thread *td, struct ia32_setitimer_args *uap) struct itimerval32 *p32, *op32, s32; struct itimerval *p = NULL, *op = NULL, s; - p32 = SCARG(uap, itv); + p32 = uap->itv; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct itimerval)); - SCARG(uap, itv) = (struct itimerval32 *)p; + uap->itv = (struct itimerval32 *)p; error = copyin(p32, &s32, sizeof(s32)); if (error) return (error); @@ -622,11 +622,11 @@ ia32_setitimer(struct thread *td, struct ia32_setitimer_args *uap) if (error) return (error); } - op32 = SCARG(uap, oitv); + op32 = uap->oitv; if (op32) { sg = stackgap_init(); op = stackgap_alloc(&sg, sizeof(struct itimerval)); - SCARG(uap, oitv) = (struct itimerval32 *)op; + uap->oitv = (struct itimerval32 *)op; } error = setitimer(td, (struct setitimer_args *) uap); if (error) @@ -650,11 +650,11 @@ ia32_select(struct thread *td, struct ia32_select_args *uap) struct timeval32 *p32, s32; struct timeval *p = NULL, s; - p32 = SCARG(uap, tv); + p32 = uap->tv; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct timeval)); - SCARG(uap, tv) = (struct timeval32 *)p; + uap->tv = (struct timeval32 *)p; error = copyin(p32, &s32, sizeof(s32)); if (error) return (error); @@ -678,11 +678,11 @@ ia32_gettimeofday(struct thread *td, struct ia32_gettimeofday_args *uap) struct timeval32 *p32, s32; struct timeval *p = NULL, s; - p32 = SCARG(uap, tp); + p32 = uap->tp; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct timeval)); - SCARG(uap, tp) = (struct timeval32 *)p; + uap->tp = (struct timeval32 *)p; } error = gettimeofday(td, (struct gettimeofday_args *) uap); if (error) @@ -708,11 +708,11 @@ ia32_getrusage(struct thread *td, struct ia32_getrusage_args *uap) struct rusage32 *p32, s32; struct rusage *p = NULL, s; - p32 = SCARG(uap, rusage); + p32 = uap->rusage; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct rusage)); - SCARG(uap, rusage) = (struct rusage32 *)p; + uap->rusage = (struct rusage32 *)p; } error = getrusage(td, (struct getrusage_args *) uap); if (error) @@ -763,28 +763,28 @@ ia32_readv(struct thread *td, struct ia32_readv_args *uap) sg = stackgap_init(); - if (SCARG(uap, iovcnt) > (STACKGAPLEN / sizeof (struct iovec))) + if (uap->iovcnt > (STACKGAPLEN / sizeof (struct iovec))) return (EINVAL); - osize = SCARG(uap, iovcnt) * sizeof (struct iovec32); - nsize = SCARG(uap, iovcnt) * sizeof (struct iovec); + osize = uap->iovcnt * sizeof (struct iovec32); + nsize = uap->iovcnt * sizeof (struct iovec); oio = malloc(osize, M_TEMP, M_WAITOK); nio = malloc(nsize, M_TEMP, M_WAITOK); error = 0; - if ((error = copyin(SCARG(uap, iovp), oio, osize))) + if ((error = copyin(uap->iovp, oio, osize))) goto punt; - for (i = 0; i < SCARG(uap, iovcnt); i++) { + for (i = 0; i < uap->iovcnt; i++) { nio[i].iov_base = PTRIN(oio[i].iov_base); nio[i].iov_len = oio[i].iov_len; } - SCARG(&a, fd) = SCARG(uap, fd); - SCARG(&a, iovp) = stackgap_alloc(&sg, nsize); - SCARG(&a, iovcnt) = SCARG(uap, iovcnt); + a.fd = uap->fd; + a.iovp = stackgap_alloc(&sg, nsize); + a.iovcnt = uap->iovcnt; - if ((error = copyout(nio, (caddr_t)SCARG(&a, iovp), nsize))) + if ((error = copyout(nio, (caddr_t)a.iovp, nsize))) goto punt; error = readv(td, &a); @@ -809,28 +809,28 @@ ia32_writev(struct thread *td, struct ia32_writev_args *uap) sg = stackgap_init(); - if (SCARG(uap, iovcnt) > (STACKGAPLEN / sizeof (struct iovec))) + if (uap->iovcnt > (STACKGAPLEN / sizeof (struct iovec))) return (EINVAL); - osize = SCARG(uap, iovcnt) * sizeof (struct iovec32); - nsize = SCARG(uap, iovcnt) * sizeof (struct iovec); + osize = uap->iovcnt * sizeof (struct iovec32); + nsize = uap->iovcnt * sizeof (struct iovec); oio = malloc(osize, M_TEMP, M_WAITOK); nio = malloc(nsize, M_TEMP, M_WAITOK); error = 0; - if ((error = copyin(SCARG(uap, iovp), oio, osize))) + if ((error = copyin(uap->iovp, oio, osize))) goto punt; - for (i = 0; i < SCARG(uap, iovcnt); i++) { + for (i = 0; i < uap->iovcnt; i++) { nio[i].iov_base = PTRIN(oio[i].iov_base); nio[i].iov_len = oio[i].iov_len; } - SCARG(&a, fd) = SCARG(uap, fd); - SCARG(&a, iovp) = stackgap_alloc(&sg, nsize); - SCARG(&a, iovcnt) = SCARG(uap, iovcnt); + a.fd = uap->fd; + a.iovp = stackgap_alloc(&sg, nsize); + a.iovcnt = uap->iovcnt; - if ((error = copyout(nio, (caddr_t)SCARG(&a, iovp), nsize))) + if ((error = copyout(nio, (caddr_t)a.iovp, nsize))) goto punt; error = writev(td, &a); @@ -848,11 +848,11 @@ ia32_settimeofday(struct thread *td, struct ia32_settimeofday_args *uap) struct timeval32 *p32, s32; struct timeval *p = NULL, s; - p32 = SCARG(uap, tv); + p32 = uap->tv; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct timeval)); - SCARG(uap, tv) = (struct timeval32 *)p; + uap->tv = (struct timeval32 *)p; error = copyin(p32, &s32, sizeof(s32)); if (error) return (error); @@ -873,11 +873,11 @@ ia32_utimes(struct thread *td, struct ia32_utimes_args *uap) struct timeval32 *p32, s32[2]; struct timeval *p = NULL, s[2]; - p32 = SCARG(uap, tptr); + p32 = uap->tptr; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, 2*sizeof(struct timeval)); - SCARG(uap, tptr) = (struct timeval32 *)p; + uap->tptr = (struct timeval32 *)p; error = copyin(p32, s32, sizeof(s32)); if (error) return (error); @@ -900,11 +900,11 @@ ia32_adjtime(struct thread *td, struct ia32_adjtime_args *uap) struct timeval32 *p32, *op32, s32; struct timeval *p = NULL, *op = NULL, s; - p32 = SCARG(uap, delta); + p32 = uap->delta; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct timeval)); - SCARG(uap, delta) = (struct timeval32 *)p; + uap->delta = (struct timeval32 *)p; error = copyin(p32, &s32, sizeof(s32)); if (error) return (error); @@ -914,11 +914,11 @@ ia32_adjtime(struct thread *td, struct ia32_adjtime_args *uap) if (error) return (error); } - op32 = SCARG(uap, olddelta); + op32 = uap->olddelta; if (op32) { sg = stackgap_init(); op = stackgap_alloc(&sg, sizeof(struct timeval)); - SCARG(uap, olddelta) = (struct timeval32 *)op; + uap->olddelta = (struct timeval32 *)op; } error = utimes(td, (struct utimes_args *) uap); if (error) @@ -942,11 +942,11 @@ ia32_statfs(struct thread *td, struct ia32_statfs_args *uap) struct statfs32 *p32, s32; struct statfs *p = NULL, s; - p32 = SCARG(uap, buf); + p32 = uap->buf; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct statfs)); - SCARG(uap, buf) = (struct statfs32 *)p; + uap->buf = (struct statfs32 *)p; } error = statfs(td, (struct statfs_args *) uap); if (error) @@ -969,11 +969,11 @@ ia32_fstatfs(struct thread *td, struct ia32_fstatfs_args *uap) struct statfs32 *p32, s32; struct statfs *p = NULL, s; - p32 = SCARG(uap, buf); + p32 = uap->buf; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct statfs)); - SCARG(uap, buf) = (struct statfs32 *)p; + uap->buf = (struct statfs32 *)p; } error = fstatfs(td, (struct fstatfs_args *) uap); if (error) @@ -1020,11 +1020,11 @@ ia32_pread(struct thread *td, struct ia32_pread_args *uap) { struct pread_args ap; - SCARG(&ap, fd) = SCARG(uap, fd); - SCARG(&ap, buf) = SCARG(uap, buf); - SCARG(&ap, nbyte) = SCARG(uap, nbyte); - SCARG(&ap, offset) = (SCARG(uap, offsetlo) - | ((off_t)SCARG(uap, offsethi) << 32)); + ap.fd = uap->fd; + ap.buf = uap->buf; + ap.nbyte = uap->nbyte; + ap.offset = (uap->offsetlo + | ((off_t)uap->offsethi << 32)); return (pread(td, &ap)); } @@ -1033,11 +1033,11 @@ ia32_pwrite(struct thread *td, struct ia32_pwrite_args *uap) { struct pwrite_args ap; - SCARG(&ap, fd) = SCARG(uap, fd); - SCARG(&ap, buf) = SCARG(uap, buf); - SCARG(&ap, nbyte) = SCARG(uap, nbyte); - SCARG(&ap, offset) = (SCARG(uap, offsetlo) - | ((off_t)SCARG(uap, offsethi) << 32)); + ap.fd = uap->fd; + ap.buf = uap->buf; + ap.nbyte = uap->nbyte; + ap.offset = (uap->offsetlo + | ((off_t)uap->offsethi << 32)); return (pwrite(td, &ap)); } @@ -1048,10 +1048,10 @@ ia32_lseek(struct thread *td, struct ia32_lseek_args *uap) struct lseek_args ap; off_t pos; - SCARG(&ap, fd) = SCARG(uap, fd); - SCARG(&ap, offset) = (SCARG(uap, offsetlo) - | ((off_t)SCARG(uap, offsethi) << 32)); - SCARG(&ap, whence) = SCARG(uap, whence); + ap.fd = uap->fd; + ap.offset = (uap->offsetlo + | ((off_t)uap->offsethi << 32)); + ap.whence = uap->whence; error = lseek(td, &ap); /* Expand the quad return into two parts for eax and edx */ pos = *(off_t *)(td->td_retval); @@ -1065,9 +1065,9 @@ ia32_truncate(struct thread *td, struct ia32_truncate_args *uap) { struct truncate_args ap; - SCARG(&ap, path) = SCARG(uap, path); - SCARG(&ap, length) = (SCARG(uap, lengthlo) - | ((off_t)SCARG(uap, lengthhi) << 32)); + ap.path = uap->path; + ap.length = (uap->lengthlo + | ((off_t)uap->lengthhi << 32)); return (truncate(td, &ap)); } @@ -1076,9 +1076,9 @@ ia32_ftruncate(struct thread *td, struct ia32_ftruncate_args *uap) { struct ftruncate_args ap; - SCARG(&ap, fd) = SCARG(uap, fd); - SCARG(&ap, length) = (SCARG(uap, lengthlo) - | ((off_t)SCARG(uap, lengthhi) << 32)); + ap.fd = uap->fd; + ap.length = (uap->lengthlo + | ((off_t)uap->lengthhi << 32)); return (ftruncate(td, &ap)); } @@ -1089,14 +1089,14 @@ freebsd4_ia32_sendfile(struct thread *td, { struct freebsd4_sendfile_args ap; - SCARG(&ap, fd) = SCARG(uap, fd); - SCARG(&ap, s) = SCARG(uap, s); - SCARG(&ap, offset) = (SCARG(uap, offsetlo) - | ((off_t)SCARG(uap, offsethi) << 32)); - SCARG(&ap, nbytes) = SCARG(uap, nbytes); /* XXX check */ - SCARG(&ap, hdtr) = SCARG(uap, hdtr); /* XXX check */ - SCARG(&ap, sbytes) = SCARG(uap, sbytes); /* XXX FIXME!! */ - SCARG(&ap, flags) = SCARG(uap, flags); + ap.fd = uap->fd; + ap.s = uap->s; + ap.offset = (uap->offsetlo + | ((off_t)uap->offsethi << 32)); + ap.nbytes = uap->nbytes; /* XXX check */ + ap.hdtr = uap->hdtr; /* XXX check */ + ap.sbytes = uap->sbytes; /* XXX FIXME!! */ + ap.flags = uap->flags; return (freebsd4_sendfile(td, &ap)); } #endif @@ -1106,14 +1106,14 @@ ia32_sendfile(struct thread *td, struct ia32_sendfile_args *uap) { struct sendfile_args ap; - SCARG(&ap, fd) = SCARG(uap, fd); - SCARG(&ap, s) = SCARG(uap, s); - SCARG(&ap, offset) = (SCARG(uap, offsetlo) - | ((off_t)SCARG(uap, offsethi) << 32)); - SCARG(&ap, nbytes) = SCARG(uap, nbytes); /* XXX check */ - SCARG(&ap, hdtr) = SCARG(uap, hdtr); /* XXX check */ - SCARG(&ap, sbytes) = SCARG(uap, sbytes); /* XXX FIXME!! */ - SCARG(&ap, flags) = SCARG(uap, flags); + ap.fd = uap->fd; + ap.s = uap->s; + ap.offset = (uap->offsetlo + | ((off_t)uap->offsethi << 32)); + ap.nbytes = uap->nbytes; /* XXX check */ + ap.hdtr = uap->hdtr; /* XXX check */ + ap.sbytes = uap->sbytes; /* XXX FIXME!! */ + ap.flags = uap->flags; return (sendfile(td, &ap)); } @@ -1163,11 +1163,11 @@ ia32_stat(struct thread *td, struct ia32_stat_args *uap) struct stat32 *p32, s32; struct stat *p = NULL, s; - p32 = SCARG(uap, ub); + p32 = uap->ub; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct stat)); - SCARG(uap, ub) = (struct stat32 *)p; + uap->ub = (struct stat32 *)p; } error = stat(td, (struct stat_args *) uap); if (error) @@ -1190,11 +1190,11 @@ ia32_fstat(struct thread *td, struct ia32_fstat_args *uap) struct stat32 *p32, s32; struct stat *p = NULL, s; - p32 = SCARG(uap, ub); + p32 = uap->ub; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct stat)); - SCARG(uap, ub) = (struct stat32 *)p; + uap->ub = (struct stat32 *)p; } error = fstat(td, (struct fstat_args *) uap); if (error) @@ -1217,11 +1217,11 @@ ia32_lstat(struct thread *td, struct ia32_lstat_args *uap) struct stat32 *p32, s32; struct stat *p = NULL, s; - p32 = SCARG(uap, ub); + p32 = uap->ub; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct stat)); - SCARG(uap, ub) = (struct stat32 *)p; + uap->ub = (struct stat32 *)p; } error = lstat(td, (struct lstat_args *) uap); if (error) @@ -1285,11 +1285,11 @@ ia32_sigaction(struct thread *td, struct ia32_sigaction_args *uap) struct sigaction32 *p32, *op32, s32; struct sigaction *p = NULL, *op = NULL, s; - p32 = SCARG(uap, act); + p32 = uap->act; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct sigaction)); - SCARG(uap, act) = (struct sigaction32 *)p; + uap->act = (struct sigaction32 *)p; error = copyin(p32, &s32, sizeof(s32)); if (error) return (error); @@ -1300,11 +1300,11 @@ ia32_sigaction(struct thread *td, struct ia32_sigaction_args *uap) if (error) return (error); } - op32 = SCARG(uap, oact); + op32 = uap->oact; if (op32) { sg = stackgap_init(); op = stackgap_alloc(&sg, sizeof(struct sigaction)); - SCARG(uap, oact) = (struct sigaction32 *)op; + uap->oact = (struct sigaction32 *)op; } error = sigaction(td, (struct sigaction_args *) uap); if (error) @@ -1331,11 +1331,11 @@ ia32_xxx(struct thread *td, struct ia32_xxx_args *uap) struct yyy32 *p32, s32; struct yyy *p = NULL, s; - p32 = SCARG(uap, zzz); + p32 = uap->zzz; if (p32) { sg = stackgap_init(); p = stackgap_alloc(&sg, sizeof(struct yyy)); - SCARG(uap, zzz) = (struct yyy32 *)p; + uap->zzz = (struct yyy32 *)p; error = copyin(p32, &s32, sizeof(s32)); if (error) return (error); diff --git a/sys/compat/freebsd32/freebsd32_util.h b/sys/compat/freebsd32/freebsd32_util.h index b9e0a7c..23f2aba 100644 --- a/sys/compat/freebsd32/freebsd32_util.h +++ b/sys/compat/freebsd32/freebsd32_util.h @@ -37,11 +37,6 @@ #include <sys/sysent.h> #include <sys/cdefs.h> - -#ifndef SCARG -#define SCARG(p, x) (p)->x -#endif - struct ia32_ps_strings { u_int32_t ps_argvstr; /* first of 0 or more argument strings */ int ps_nargvstr; /* the number of argument strings */ diff --git a/sys/compat/ia32/ia32_util.h b/sys/compat/ia32/ia32_util.h index b9e0a7c..23f2aba 100644 --- a/sys/compat/ia32/ia32_util.h +++ b/sys/compat/ia32/ia32_util.h @@ -37,11 +37,6 @@ #include <sys/sysent.h> #include <sys/cdefs.h> - -#ifndef SCARG -#define SCARG(p, x) (p)->x -#endif - struct ia32_ps_strings { u_int32_t ps_argvstr; /* first of 0 or more argument strings */ int ps_nargvstr; /* the number of argument strings */ diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c index fa4ddf2..60d5edf 100644 --- a/sys/compat/svr4/svr4_fcntl.c +++ b/sys/compat/svr4/svr4_fcntl.c @@ -349,8 +349,8 @@ fd_truncate(td, fd, flp) return EINVAL; } - SCARG(&ft, fd) = fd; - SCARG(&ft, length) = start; + ft.fd = fd; + ft.length = start; error = ftruncate(td, &ft); @@ -368,7 +368,7 @@ svr4_sys_open(td, uap) struct open_args cup; caddr_t sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); (&cup)->path = uap->path; (&cup)->flags = svr4_to_bsd_flags(uap->flags); @@ -384,7 +384,7 @@ svr4_sys_open(td, uap) retval = td->td_retval[0]; PROC_LOCK(p); - if (!(SCARG(&cup, flags) & O_NOCTTY) && SESS_LEADER(p) && + if (!(cup.flags & O_NOCTTY) && SESS_LEADER(p) && !(td->td_proc->p_flag & P_CONTROLT)) { #if defined(NOTYET) struct file *fp; @@ -428,11 +428,11 @@ svr4_sys_creat(td, uap) struct open_args cup; caddr_t sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); - SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, mode) = SCARG(uap, mode); - SCARG(&cup, flags) = O_WRONLY | O_CREAT | O_TRUNC; + cup.path = uap->path; + cup.mode = uap->mode; + cup.flags = O_WRONLY | O_CREAT | O_TRUNC; return open(td, &cup); } @@ -452,16 +452,16 @@ svr4_sys_llseek(td, uap) { struct lseek_args ap; - SCARG(&ap, fd) = SCARG(uap, fd); + ap.fd = uap->fd; #if BYTE_ORDER == BIG_ENDIAN - SCARG(&ap, offset) = (((u_int64_t) SCARG(uap, offset1)) << 32) | - SCARG(uap, offset2); + ap.offset = (((u_int64_t) uap->offset1) << 32) | + uap->offset2; #else - SCARG(&ap, offset) = (((u_int64_t) SCARG(uap, offset2)) << 32) | - SCARG(uap, offset1); + ap.offset = (((u_int64_t) uap->offset2) << 32) | + uap->offset1; #endif - SCARG(&ap, whence) = SCARG(uap, whence); + ap.whence = uap->whence; return lseek(td, &ap); } @@ -475,12 +475,12 @@ svr4_sys_access(td, uap) int *retval; caddr_t sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); retval = td->td_retval; - SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, flags) = SCARG(uap, flags); + cup.path = uap->path; + cup.flags = uap->flags; return access(td, &cup); } @@ -497,10 +497,10 @@ svr4_sys_pread(td, uap) * Just translate the args structure and call the NetBSD * pread(2) system call (offset type is 64-bit in NetBSD). */ - SCARG(&pra, fd) = SCARG(uap, fd); - SCARG(&pra, buf) = SCARG(uap, buf); - SCARG(&pra, nbyte) = SCARG(uap, nbyte); - SCARG(&pra, offset) = SCARG(uap, off); + pra.fd = uap->fd; + pra.buf = uap->buf; + pra.nbyte = uap->nbyte; + pra.offset = uap->off; return pread(td, &pra); } @@ -521,10 +521,10 @@ svr4_sys_pread64(td, v, retval) * Just translate the args structure and call the NetBSD * pread(2) system call (offset type is 64-bit in NetBSD). */ - SCARG(&pra, fd) = SCARG(uap, fd); - SCARG(&pra, buf) = SCARG(uap, buf); - SCARG(&pra, nbyte) = SCARG(uap, nbyte); - SCARG(&pra, offset) = SCARG(uap, off); + pra.fd = uap->fd; + pra.buf = uap->buf; + pra.nbyte = uap->nbyte; + pra.offset = uap->off; return (sys_pread(td, &pra, retval)); } @@ -542,10 +542,10 @@ svr4_sys_pwrite(td, uap) * Just translate the args structure and call the NetBSD * pwrite(2) system call (offset type is 64-bit in NetBSD). */ - SCARG(&pwa, fd) = SCARG(uap, fd); - SCARG(&pwa, buf) = SCARG(uap, buf); - SCARG(&pwa, nbyte) = SCARG(uap, nbyte); - SCARG(&pwa, offset) = SCARG(uap, off); + pwa.fd = uap->fd; + pwa.buf = uap->buf; + pwa.nbyte = uap->nbyte; + pwa.offset = uap->off; return pwrite(td, &pwa); } @@ -565,10 +565,10 @@ svr4_sys_pwrite64(td, v, retval) * Just translate the args structure and call the NetBSD * pwrite(2) system call (offset type is 64-bit in NetBSD). */ - SCARG(&pwa, fd) = SCARG(uap, fd); - SCARG(&pwa, buf) = SCARG(uap, buf); - SCARG(&pwa, nbyte) = SCARG(uap, nbyte); - SCARG(&pwa, offset) = SCARG(uap, off); + pwa.fd = uap->fd; + pwa.buf = uap->buf; + pwa.nbyte = uap->nbyte; + pwa.offset = uap->off; return (sys_pwrite(td, &pwa, retval)); } @@ -585,18 +585,18 @@ svr4_sys_fcntl(td, uap) retval = td->td_retval; - SCARG(&fa, fd) = SCARG(uap, fd); - SCARG(&fa, cmd) = svr4_to_bsd_cmd(SCARG(uap, cmd)); + fa.fd = uap->fd; + fa.cmd = svr4_to_bsd_cmd(uap->cmd); - switch (SCARG(&fa, cmd)) { + switch (fa.cmd) { case F_DUPFD: case F_GETFD: case F_SETFD: - SCARG(&fa, arg) = (long) SCARG(uap, arg); + fa.arg = (long) uap->arg; return fcntl(td, &fa); case F_GETFL: - SCARG(&fa, arg) = (long) SCARG(uap, arg); + fa.arg = (long) uap->arg; error = fcntl(td, &fa); if (error) return error; @@ -612,17 +612,17 @@ svr4_sys_fcntl(td, uap) long cmd; int flags; - DPRINTF(("Setting flags %p\n", SCARG(uap, arg))); - cmd = SCARG(&fa, cmd); /* save it for a while */ + DPRINTF(("Setting flags %p\n", uap->arg)); + cmd = fa.cmd; /* save it for a while */ - SCARG(&fa, cmd) = F_GETFL; + fa.cmd = F_GETFL; if ((error = fcntl(td, &fa)) != 0) return error; flags = *retval; flags &= O_ASYNC; - flags |= svr4_to_bsd_flags((u_long) SCARG(uap, arg)); - SCARG(&fa, cmd) = cmd; - SCARG(&fa, arg) = (long) flags; + flags |= svr4_to_bsd_flags((u_long) uap->arg); + fa.cmd = cmd; + fa.arg = (long) flags; return fcntl(td, &fa); } @@ -635,9 +635,9 @@ svr4_sys_fcntl(td, uap) caddr_t sg = stackgap_init(); flp = stackgap_alloc(&sg, sizeof(struct flock)); - SCARG(&fa, arg) = (long) flp; + fa.arg = (long) flp; - error = copyin(SCARG(uap, arg), &ifl, sizeof ifl); + error = copyin(uap->arg, &ifl, sizeof ifl); if (error) return error; @@ -648,7 +648,7 @@ svr4_sys_fcntl(td, uap) return error; error = fcntl(td, &fa); - if (error || SCARG(&fa, cmd) != F_GETLK) + if (error || fa.cmd != F_GETLK) return error; error = copyin(flp, &fl, sizeof fl); @@ -657,20 +657,20 @@ svr4_sys_fcntl(td, uap) bsd_to_svr4_flock(&fl, &ifl); - return copyout(&ifl, SCARG(uap, arg), sizeof ifl); + return copyout(&ifl, uap->arg, sizeof ifl); } case -1: - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case SVR4_F_DUP2FD: { struct dup2_args du; - SCARG(&du, from) = SCARG(uap, fd); - SCARG(&du, to) = (int)SCARG(uap, arg); + du.from = uap->fd; + du.to = (int)uap->arg; error = dup2(td, &du); if (error) return error; - *retval = SCARG(&du, to); + *retval = du.to; return 0; } @@ -679,12 +679,12 @@ svr4_sys_fcntl(td, uap) struct svr4_flock ifl; struct flock fl; - error = copyin(SCARG(uap, arg), &ifl, + error = copyin(uap->arg, &ifl, sizeof ifl); if (error) return error; svr4_to_bsd_flock(&ifl, &fl); - return fd_truncate(td, SCARG(uap, fd), &fl); + return fd_truncate(td, uap->fd, &fl); } case SVR4_F_GETLK64: @@ -696,9 +696,9 @@ svr4_sys_fcntl(td, uap) caddr_t sg = stackgap_init(); flp = stackgap_alloc(&sg, sizeof(struct flock)); - SCARG(&fa, arg) = (long) flp; + fa.arg = (long) flp; - error = copyin(SCARG(uap, arg), &ifl, + error = copyin(uap->arg, &ifl, sizeof ifl); if (error) return error; @@ -710,7 +710,7 @@ svr4_sys_fcntl(td, uap) return error; error = fcntl(td, &fa); - if (error || SCARG(&fa, cmd) != F_GETLK) + if (error || fa.cmd != F_GETLK) return error; error = copyin(flp, &fl, sizeof fl); @@ -719,7 +719,7 @@ svr4_sys_fcntl(td, uap) bsd_to_svr4_flock64(&fl, &ifl); - return copyout(&ifl, SCARG(uap, arg), + return copyout(&ifl, uap->arg, sizeof ifl); } @@ -728,16 +728,16 @@ svr4_sys_fcntl(td, uap) struct svr4_flock64 ifl; struct flock fl; - error = copyin(SCARG(uap, arg), &ifl, + error = copyin(uap->arg, &ifl, sizeof ifl); if (error) return error; svr4_to_bsd_flock64(&ifl, &fl); - return fd_truncate(td, SCARG(uap, fd), &fl); + return fd_truncate(td, uap->fd, &fl); } case SVR4_F_REVOKE: - return fd_revoke(td, SCARG(uap, fd)); + return fd_revoke(td, uap->fd); default: return ENOSYS; diff --git a/sys/compat/svr4/svr4_filio.c b/sys/compat/svr4/svr4_filio.c index c2bad1d..f4b0950 100644 --- a/sys/compat/svr4/svr4_filio.c +++ b/sys/compat/svr4/svr4_filio.c @@ -63,26 +63,26 @@ svr4_sys_poll(td, uap) int idx = 0, cerr; u_long siz; - SCARG(&pa, fds) = SCARG(uap, fds); - SCARG(&pa, nfds) = SCARG(uap, nfds); - SCARG(&pa, timeout) = SCARG(uap, timeout); + pa.fds = uap->fds; + pa.nfds = uap->nfds; + pa.timeout = uap->timeout; - siz = SCARG(uap, nfds) * sizeof(struct pollfd); + siz = uap->nfds * sizeof(struct pollfd); pfd = (struct pollfd *)malloc(siz, M_TEMP, M_WAITOK); error = poll(td, (struct poll_args *)uap); - if ((cerr = copyin(SCARG(uap, fds), pfd, siz)) != 0) { + if ((cerr = copyin(uap->fds, pfd, siz)) != 0) { error = cerr; goto done; } - for (idx = 0; idx < SCARG(uap, nfds); idx++) { + for (idx = 0; idx < uap->nfds; idx++) { /* POLLWRNORM already equals POLLOUT, so we don't worry about that */ if (pfd[idx].revents & (POLLOUT | POLLWRNORM | POLLWRBAND)) pfd[idx].revents |= (POLLOUT | POLLWRNORM | POLLWRBAND); } - if ((cerr = copyout(pfd, SCARG(uap, fds), siz)) != 0) { + if ((cerr = copyout(pfd, uap->fds, siz)) != 0) { error = cerr; goto done; /* yeah, I know it's the next line, but this way I won't forget to update it if I add more code */ @@ -105,9 +105,9 @@ svr4_sys_read(td, uap) sigset_t sigmask; int rv; - SCARG(&ra, fd) = SCARG(uap, fd); - SCARG(&ra, buf) = SCARG(uap, buf); - SCARG(&ra, nbyte) = SCARG(uap, nbyte); + ra.fd = uap->fd; + ra.buf = uap->buf; + ra.nbyte = uap->nbyte; if (fget(td, uap->fd, &fp) != 0) { DPRINTF(("Something fishy with the user-supplied file descriptor...\n")); @@ -116,9 +116,9 @@ svr4_sys_read(td, uap) if (fp->f_type == DTYPE_SOCKET) { so = (struct socket *)fp->f_data; - DPRINTF(("fd %d is a socket\n", SCARG(uap, fd))); + DPRINTF(("fd %d is a socket\n", uap->fd)); if (so->so_state & SS_ASYNC) { - DPRINTF(("fd %d is an ASYNC socket!\n", SCARG(uap, fd))); + DPRINTF(("fd %d is an ASYNC socket!\n", uap->fd)); } DPRINTF(("Here are its flags: 0x%x\n", so->so_state)); #if defined(GROTTY_READ_HACK) @@ -130,7 +130,7 @@ svr4_sys_read(td, uap) rv = read(td, &ra); DPRINTF(("svr4_read(%d, 0x%0x, %d) = %d\n", - SCARG(uap, fd), SCARG(uap, buf), SCARG(uap, nbyte), rv)); + uap->fd, uap->buf, uap->nbyte, rv)); if (rv == EAGAIN) { DPRINTF(("sigmask = 0x%x\n", td->td_proc->p_sigmask)); DPRINTF(("sigignore = 0x%x\n", td->td_proc->p_sigignore)); @@ -159,14 +159,14 @@ svr4_sys_write(td, uap) struct file *fp; int rv; - SCARG(&wa, fd) = SCARG(uap, fd); - SCARG(&wa, buf) = SCARG(uap, buf); - SCARG(&wa, nbyte) = SCARG(uap, nbyte); + wa.fd = uap->fd; + wa.buf = uap->buf; + wa.nbyte = uap->nbyte; rv = write(td, &wa); DPRINTF(("svr4_write(%d, 0x%0x, %d) = %d\n", - SCARG(uap, fd), SCARG(uap, buf), SCARG(uap, nbyte), rv)); + uap->fd, uap->buf, uap->nbyte, rv)); return(rv); } diff --git a/sys/compat/svr4/svr4_ioctl.c b/sys/compat/svr4/svr4_ioctl.c index 50d28ee..cabfcb3 100644 --- a/sys/compat/svr4/svr4_ioctl.c +++ b/sys/compat/svr4/svr4_ioctl.c @@ -94,13 +94,13 @@ svr4_sys_ioctl(td, uap) int num; int argsiz; - svr4_decode_cmd(SCARG(uap, com), dir, &c, &num, &argsiz); + svr4_decode_cmd(uap->com, dir, &c, &num, &argsiz); - DPRINTF(("svr4_ioctl[%lx](%d, _IO%s(%c, %d, %d), %p);\n", SCARG(uap, com), SCARG(uap, fd), - dir, c, num, argsiz, SCARG(uap, data))); + DPRINTF(("svr4_ioctl[%lx](%d, _IO%s(%c, %d, %d), %p);\n", uap->com, uap->fd, + dir, c, num, argsiz, uap->data)); #endif retval = td->td_retval; - cmd = SCARG(uap, com); + cmd = uap->com; if ((error = fget(td, uap->fd, &fp)) != 0) return (error); @@ -161,7 +161,7 @@ svr4_sys_ioctl(td, uap) DPRINTF((">>> OUT: so_state = 0x%x\n", so->so_state)); } #endif - error = (*fun)(fp, td, retval, SCARG(uap, fd), cmd, SCARG(uap, data)); + error = (*fun)(fp, td, retval, uap->fd, cmd, uap->data); fdrop(fp, td); return (error); } diff --git a/sys/compat/svr4/svr4_ipc.c b/sys/compat/svr4/svr4_ipc.c index 17caaa5..28d3321 100644 --- a/sys/compat/svr4/svr4_ipc.c +++ b/sys/compat/svr4/svr4_ipc.c @@ -221,55 +221,55 @@ svr4_semctl(p, v, retval) struct semid_ds bs, *bsp; caddr_t sg = stackgap_init(); - SCARG(&ap, semid) = SCARG(uap, semid); - SCARG(&ap, semnum) = SCARG(uap, semnum); + ap.semid = uap->semid; + ap.semnum = uap->semnum; - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case SVR4_SEM_GETZCNT: case SVR4_SEM_GETNCNT: case SVR4_SEM_GETPID: case SVR4_SEM_GETVAL: - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case SVR4_SEM_GETZCNT: - SCARG(&ap, cmd) = GETZCNT; + ap.cmd = GETZCNT; break; case SVR4_SEM_GETNCNT: - SCARG(&ap, cmd) = GETNCNT; + ap.cmd = GETNCNT; break; case SVR4_SEM_GETPID: - SCARG(&ap, cmd) = GETPID; + ap.cmd = GETPID; break; case SVR4_SEM_GETVAL: - SCARG(&ap, cmd) = GETVAL; + ap.cmd = GETVAL; break; } return sys___semctl(p, &ap, retval); case SVR4_SEM_SETVAL: - error = svr4_setsemun(&sg, &SCARG(&ap, arg), &SCARG(uap, arg)); + error = svr4_setsemun(&sg, &ap.arg, &uap->arg); if (error) return error; - SCARG(&ap, cmd) = SETVAL; + ap.cmd = SETVAL; return sys___semctl(p, &ap, retval); case SVR4_SEM_GETALL: - error = svr4_setsemun(&sg, &SCARG(&ap, arg), &SCARG(uap, arg)); + error = svr4_setsemun(&sg, &ap.arg, &uap->arg); if (error) return error; - SCARG(&ap, cmd) = GETVAL; + ap.cmd = GETVAL; return sys___semctl(p, &ap, retval); case SVR4_SEM_SETALL: - error = svr4_setsemun(&sg, &SCARG(&ap, arg), &SCARG(uap, arg)); + error = svr4_setsemun(&sg, &ap.arg, &uap->arg); if (error) return error; - SCARG(&ap, cmd) = SETVAL; + ap.cmd = SETVAL; return sys___semctl(p, &ap, retval); case SVR4_IPC_STAT: - SCARG(&ap, cmd) = IPC_STAT; + ap.cmd = IPC_STAT; bsp = stackgap_alloc(&sg, sizeof(bs)); - error = svr4_setsemun(&sg, &SCARG(&ap, arg), + error = svr4_setsemun(&sg, &ap.arg, (union semun *)&bsp); if (error) return error; @@ -279,16 +279,16 @@ svr4_semctl(p, v, retval) if (error) return error; bsd_to_svr4_semid_ds(&bs, &ss); - return copyout(&ss, SCARG(uap, arg).buf, sizeof(ss)); + return copyout(&ss, uap->arg.buf, sizeof(ss)); case SVR4_IPC_SET: - SCARG(&ap, cmd) = IPC_SET; + ap.cmd = IPC_SET; bsp = stackgap_alloc(&sg, sizeof(bs)); - error = svr4_setsemun(&sg, &SCARG(&ap, arg), + error = svr4_setsemun(&sg, &ap.arg, (union semun *)&bsp); if (error) return error; - error = copyin(SCARG(uap, arg).buf, (caddr_t) &ss, sizeof ss); + error = copyin(uap->arg.buf, (caddr_t) &ss, sizeof ss); if (error) return error; svr4_to_bsd_semid_ds(&ss, &bs); @@ -298,13 +298,13 @@ svr4_semctl(p, v, retval) return sys___semctl(p, &ap, retval); case SVR4_IPC_RMID: - SCARG(&ap, cmd) = IPC_RMID; + ap.cmd = IPC_RMID; bsp = stackgap_alloc(&sg, sizeof(bs)); - error = svr4_setsemun(&sg, &SCARG(&ap, arg), + error = svr4_setsemun(&sg, &ap.arg, (union semun *)&bsp); if (error) return error; - error = copyin(SCARG(uap, arg).buf, &ss, sizeof ss); + error = copyin(uap->arg.buf, &ss, sizeof ss); if (error) return error; svr4_to_bsd_semid_ds(&ss, &bs); @@ -334,9 +334,9 @@ svr4_semget(p, v, retval) struct svr4_sys_semget_args *uap = v; struct sys_semget_args ap; - SCARG(&ap, key) = SCARG(uap, key); - SCARG(&ap, nsems) = SCARG(uap, nsems); - SCARG(&ap, semflg) = SCARG(uap, semflg); + ap.key = uap->key; + ap.nsems = uap->nsems; + ap.semflg = uap->semflg; return sys_semget(p, &ap, retval); } @@ -357,10 +357,10 @@ svr4_semop(p, v, retval) struct svr4_sys_semop_args *uap = v; struct sys_semop_args ap; - SCARG(&ap, semid) = SCARG(uap, semid); + ap.semid = uap->semid; /* These are the same */ - SCARG(&ap, sops) = (struct sembuf *) SCARG(uap, sops); - SCARG(&ap, nsops) = SCARG(uap, nsops); + ap.sops = (struct sembuf *) uap->sops; + ap.nsops = uap->nsops; return sys_semop(p, &ap, retval); } @@ -373,9 +373,9 @@ svr4_sys_semsys(p, v, retval) { struct svr4_sys_semsys_args *uap = v; - DPRINTF(("svr4_semsys(%d)\n", SCARG(uap, what))); + DPRINTF(("svr4_semsys(%d)\n", uap->what)); - switch (SCARG(uap, what)) { + switch (uap->what) { case SVR4_semctl: return svr4_semctl(p, v, retval); case SVR4_semget: @@ -462,10 +462,10 @@ svr4_msgsnd(p, v, retval) struct svr4_sys_msgsnd_args *uap = v; struct sys_msgsnd_args ap; - SCARG(&ap, msqid) = SCARG(uap, msqid); - SCARG(&ap, msgp) = SCARG(uap, msgp); - SCARG(&ap, msgsz) = SCARG(uap, msgsz); - SCARG(&ap, msgflg) = SCARG(uap, msgflg); + ap.msqid = uap->msqid; + ap.msgp = uap->msgp; + ap.msgsz = uap->msgsz; + ap.msgflg = uap->msgflg; return sys_msgsnd(p, &ap, retval); } @@ -488,11 +488,11 @@ svr4_msgrcv(p, v, retval) struct svr4_sys_msgrcv_args *uap = v; struct sys_msgrcv_args ap; - SCARG(&ap, msqid) = SCARG(uap, msqid); - SCARG(&ap, msgp) = SCARG(uap, msgp); - SCARG(&ap, msgsz) = SCARG(uap, msgsz); - SCARG(&ap, msgtyp) = SCARG(uap, msgtyp); - SCARG(&ap, msgflg) = SCARG(uap, msgflg); + ap.msqid = uap->msqid; + ap.msgp = uap->msgp; + ap.msgsz = uap->msgsz; + ap.msgtyp = uap->msgtyp; + ap.msgflg = uap->msgflg; return sys_msgrcv(p, &ap, retval); } @@ -512,8 +512,8 @@ svr4_msgget(p, v, retval) struct svr4_sys_msgget_args *uap = v; struct sys_msgget_args ap; - SCARG(&ap, key) = SCARG(uap, key); - SCARG(&ap, msgflg) = SCARG(uap, msgflg); + ap.key = uap->key; + ap.msgflg = uap->msgflg; return sys_msgget(p, &ap, retval); } @@ -538,39 +538,39 @@ svr4_msgctl(p, v, retval) struct msqid_ds bs; caddr_t sg = stackgap_init(); - SCARG(&ap, msqid) = SCARG(uap, msqid); - SCARG(&ap, cmd) = SCARG(uap, cmd); - SCARG(&ap, buf) = stackgap_alloc(&sg, sizeof(bs)); + ap.msqid = uap->msqid; + ap.cmd = uap->cmd; + ap.buf = stackgap_alloc(&sg, sizeof(bs)); - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case SVR4_IPC_STAT: - SCARG(&ap, cmd) = IPC_STAT; + ap.cmd = IPC_STAT; if ((error = sys_msgctl(p, &ap, retval)) != 0) return error; - error = copyin(&bs, SCARG(&ap, buf), sizeof bs); + error = copyin(&bs, ap.buf, sizeof bs); if (error) return error; bsd_to_svr4_msqid_ds(&bs, &ss); - return copyout(&ss, SCARG(uap, buf), sizeof ss); + return copyout(&ss, uap->buf, sizeof ss); case SVR4_IPC_SET: - SCARG(&ap, cmd) = IPC_SET; - error = copyin(SCARG(uap, buf), &ss, sizeof ss); + ap.cmd = IPC_SET; + error = copyin(uap->buf, &ss, sizeof ss); if (error) return error; svr4_to_bsd_msqid_ds(&ss, &bs); - error = copyout(&bs, SCARG(&ap, buf), sizeof bs); + error = copyout(&bs, ap.buf, sizeof bs); if (error) return error; return sys_msgctl(p, &ap, retval); case SVR4_IPC_RMID: - SCARG(&ap, cmd) = IPC_RMID; - error = copyin(SCARG(uap, buf), &ss, sizeof ss); + ap.cmd = IPC_RMID; + error = copyin(uap->buf, &ss, sizeof ss); if (error) return error; svr4_to_bsd_msqid_ds(&ss, &bs); - error = copyout(&bs, SCARG(&ap, buf), sizeof bs); + error = copyout(&bs, ap.buf, sizeof bs); if (error) return error; return sys_msgctl(p, &ap, retval); @@ -588,9 +588,9 @@ svr4_sys_msgsys(p, v, retval) { struct svr4_sys_msgsys_args *uap = v; - DPRINTF(("svr4_msgsys(%d)\n", SCARG(uap, what))); + DPRINTF(("svr4_msgsys(%d)\n", uap->what)); - switch (SCARG(uap, what)) { + switch (uap->what) { case SVR4_msgsnd: return svr4_msgsnd(p, v, retval); case SVR4_msgrcv: @@ -660,9 +660,9 @@ svr4_shmat(p, v, retval) struct svr4_sys_shmat_args *uap = v; struct sys_shmat_args ap; - SCARG(&ap, shmid) = SCARG(uap, shmid); - SCARG(&ap, shmaddr) = SCARG(uap, shmaddr); - SCARG(&ap, shmflg) = SCARG(uap, shmflg); + ap.shmid = uap->shmid; + ap.shmaddr = uap->shmaddr; + ap.shmflg = uap->shmflg; return sys_shmat(p, &ap, retval); } @@ -681,7 +681,7 @@ svr4_shmdt(p, v, retval) struct svr4_sys_shmdt_args *uap = v; struct sys_shmdt_args ap; - SCARG(&ap, shmaddr) = SCARG(uap, shmaddr); + ap.shmaddr = uap->shmaddr; return sys_shmdt(p, &ap, retval); } @@ -702,9 +702,9 @@ svr4_shmget(p, v, retval) struct svr4_sys_shmget_args *uap = v; struct sys_shmget_args ap; - SCARG(&ap, key) = SCARG(uap, key); - SCARG(&ap, size) = SCARG(uap, size); - SCARG(&ap, shmflg) = SCARG(uap, shmflg); + ap.key = uap->key; + ap.size = uap->size; + ap.shmflg = uap->shmflg; return sys_shmget(p, &ap, retval); } @@ -729,21 +729,21 @@ svr4_shmctl(p, v, retval) struct shmid_ds bs; struct svr4_shmid_ds ss; - SCARG(&ap, shmid) = SCARG(uap, shmid); + ap.shmid = uap->shmid; - if (SCARG(uap, buf) != NULL) { - SCARG(&ap, buf) = stackgap_alloc(&sg, sizeof (struct shmid_ds)); - switch (SCARG(uap, cmd)) { + if (uap->buf != NULL) { + ap.buf = stackgap_alloc(&sg, sizeof (struct shmid_ds)); + switch (uap->cmd) { case SVR4_IPC_SET: case SVR4_IPC_RMID: case SVR4_SHM_LOCK: case SVR4_SHM_UNLOCK: - error = copyin(SCARG(uap, buf), (caddr_t) &ss, + error = copyin(uap->buf, (caddr_t) &ss, sizeof ss); if (error) return error; svr4_to_bsd_shmid_ds(&ss, &bs); - error = copyout(&bs, SCARG(&ap, buf), sizeof bs); + error = copyout(&bs, ap.buf, sizeof bs); if (error) return error; break; @@ -752,38 +752,38 @@ svr4_shmctl(p, v, retval) } } else - SCARG(&ap, buf) = NULL; + ap.buf = NULL; - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case SVR4_IPC_STAT: - SCARG(&ap, cmd) = IPC_STAT; + ap.cmd = IPC_STAT; if ((error = sys_shmctl(p, &ap, retval)) != 0) return error; - if (SCARG(uap, buf) == NULL) + if (uap->buf == NULL) return 0; - error = copyin(&bs, SCARG(&ap, buf), sizeof bs); + error = copyin(&bs, ap.buf, sizeof bs); if (error) return error; bsd_to_svr4_shmid_ds(&bs, &ss); - return copyout(&ss, SCARG(uap, buf), sizeof ss); + return copyout(&ss, uap->buf, sizeof ss); case SVR4_IPC_SET: - SCARG(&ap, cmd) = IPC_SET; + ap.cmd = IPC_SET; return sys_shmctl(p, &ap, retval); case SVR4_IPC_RMID: case SVR4_SHM_LOCK: case SVR4_SHM_UNLOCK: - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case SVR4_IPC_RMID: - SCARG(&ap, cmd) = IPC_RMID; + ap.cmd = IPC_RMID; break; case SVR4_SHM_LOCK: - SCARG(&ap, cmd) = SHM_LOCK; + ap.cmd = SHM_LOCK; break; case SVR4_SHM_UNLOCK: - SCARG(&ap, cmd) = SHM_UNLOCK; + ap.cmd = SHM_UNLOCK; break; default: return EINVAL; @@ -803,9 +803,9 @@ svr4_sys_shmsys(p, v, retval) { struct svr4_sys_shmsys_args *uap = v; - DPRINTF(("svr4_shmsys(%d)\n", SCARG(uap, what))); + DPRINTF(("svr4_shmsys(%d)\n", uap->what)); - switch (SCARG(uap, what)) { + switch (uap->what) { case SVR4_shmat: return svr4_shmat(p, v, retval); case SVR4_shmdt: diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 859420d..d7a30e9 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -132,25 +132,25 @@ svr4_sys_wait(td, uap) { struct wait_args w4; int error, *retval = td->td_retval, st, sig; - size_t sz = sizeof(*SCARG(&w4, status)); + size_t sz = sizeof(*w4.status); - SCARG(&w4, rusage) = NULL; - SCARG(&w4, options) = 0; + w4.rusage = NULL; + w4.options = 0; - if (SCARG(uap, status) == NULL) { + if (uap->status == NULL) { caddr_t sg = stackgap_init(); - SCARG(&w4, status) = stackgap_alloc(&sg, sz); + w4.status = stackgap_alloc(&sg, sz); } else - SCARG(&w4, status) = SCARG(uap, status); + w4.status = uap->status; - SCARG(&w4, pid) = WAIT_ANY; + w4.pid = WAIT_ANY; if ((error = wait4(td, &w4)) != 0) return error; - if ((error = copyin(SCARG(&w4, status), &st, sizeof(st))) != 0) + if ((error = copyin(w4.status, &st, sizeof(st))) != 0) return error; if (WIFSIGNALED(st)) { @@ -169,8 +169,8 @@ svr4_sys_wait(td, uap) */ retval[1] = st; - if (SCARG(uap, status)) - if ((error = copyout(&st, SCARG(uap, status), sizeof(st))) != 0) + if (uap->status) + if ((error = copyout(&st, uap->status, sizeof(st))) != 0) return error; return 0; @@ -185,11 +185,11 @@ svr4_sys_execv(td, uap) caddr_t sg; sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); - SCARG(&ap, fname) = SCARG(uap, path); - SCARG(&ap, argv) = SCARG(uap, argp); - SCARG(&ap, envv) = NULL; + ap.fname = uap->path; + ap.argv = uap->argp; + ap.envv = NULL; return execve(td, &ap); } @@ -205,9 +205,9 @@ svr4_sys_execve(td, uap) sg = stackgap_init(); CHECKALTEXIST(td, &sg, uap->path); - SCARG(&ap, fname) = SCARG(uap, path); - SCARG(&ap, argv) = SCARG(uap, argp); - SCARG(&ap, envv) = SCARG(uap, envp); + ap.fname = uap->path; + ap.argv = uap->argp; + ap.envv = uap->envp; return execve(td, &ap); } @@ -222,9 +222,9 @@ svr4_sys_time(td, v) struct timeval tv; microtime(&tv); - if (SCARG(uap, t)) - error = copyout(&tv.tv_sec, SCARG(uap, t), - sizeof(*(SCARG(uap, t)))); + if (uap->t) + error = copyout(&tv.tv_sec, uap->t, + sizeof(*(uap->t))); td->td_retval[0] = (int) tv.tv_sec; return error; @@ -261,8 +261,8 @@ svr4_sys_getdents64(td, uap) int ncookies; DPRINTF(("svr4_sys_getdents64(%d, *, %d)\n", - SCARG(uap, fd), SCARG(uap, nbytes))); - if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) { + uap->fd, uap->nbytes)); + if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) { return (error); } @@ -283,7 +283,7 @@ svr4_sys_getdents64(td, uap) return error; } - nbytes = SCARG(uap, nbytes); + nbytes = uap->nbytes; if (nbytes == 1) { nbytes = sizeof (struct svr4_dirent64); justone = 1; @@ -326,7 +326,7 @@ again: } inp = buf; - outp = (caddr_t) SCARG(uap, dp); + outp = (caddr_t) uap->dp; resid = nbytes; if ((len = buflen - auio.uio_resid) <= 0) { goto eof; @@ -404,7 +404,7 @@ again: break; } - if (outp == (caddr_t) SCARG(uap, dp)) + if (outp == (caddr_t) uap->dp) goto again; fp->f_offset = off; @@ -443,7 +443,7 @@ svr4_sys_getdents(td, uap) u_long *cookiebuf = NULL, *cookie; int ncookies = 0, *retval = td->td_retval; - if ((error = getvnode(td->td_proc->p_fd, SCARG(uap, fd), &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { @@ -457,7 +457,7 @@ svr4_sys_getdents(td, uap) return (EINVAL); } - buflen = min(MAXBSIZE, SCARG(uap, nbytes)); + buflen = min(MAXBSIZE, uap->nbytes); buf = malloc(buflen, M_TEMP, M_WAITOK); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); off = fp->f_offset; @@ -489,8 +489,8 @@ again: } inp = buf; - outp = SCARG(uap, buf); - resid = SCARG(uap, nbytes); + outp = uap->buf; + resid = uap->nbytes; if ((len = buflen - auio.uio_resid) == 0) goto eof; @@ -534,12 +534,12 @@ again: } /* if we squished out the whole block, try again */ - if (outp == SCARG(uap, buf)) + if (outp == uap->buf) goto again; fp->f_offset = off; /* update the vnode offset */ eof: - *retval = SCARG(uap, nbytes) - resid; + *retval = uap->nbytes - resid; out: VOP_UNLOCK(vp, 0, td); fdrop(fp, td); @@ -563,18 +563,18 @@ svr4_sys_mmap(td, uap) /* * Verify the arguments. */ - if (SCARG(uap, prot) & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) + if (uap->prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) return EINVAL; /* XXX still needed? */ - if (SCARG(uap, len) == 0) + if (uap->len == 0) return EINVAL; - SCARG(&mm, prot) = SCARG(uap, prot); - SCARG(&mm, len) = SCARG(uap, len); - SCARG(&mm, flags) = SCARG(uap, flags) & ~_MAP_NEW; - SCARG(&mm, fd) = SCARG(uap, fd); - SCARG(&mm, addr) = SCARG(uap, addr); - SCARG(&mm, pos) = SCARG(uap, pos); + mm.prot = uap->prot; + mm.len = uap->len; + mm.flags = uap->flags & ~_MAP_NEW; + mm.fd = uap->fd; + mm.addr = uap->addr; + mm.pos = uap->pos; return mmap(td, &mm); } @@ -591,23 +591,23 @@ svr4_sys_mmap64(td, uap) /* * Verify the arguments. */ - if (SCARG(uap, prot) & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) + if (uap->prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) return EINVAL; /* XXX still needed? */ - if (SCARG(uap, len) == 0) + if (uap->len == 0) return EINVAL; - SCARG(&mm, prot) = SCARG(uap, prot); - SCARG(&mm, len) = SCARG(uap, len); - SCARG(&mm, flags) = SCARG(uap, flags) & ~_MAP_NEW; - SCARG(&mm, fd) = SCARG(uap, fd); - SCARG(&mm, addr) = SCARG(uap, addr); - SCARG(&mm, pos) = SCARG(uap, pos); + mm.prot = uap->prot; + mm.len = uap->len; + mm.flags = uap->flags & ~_MAP_NEW; + mm.fd = uap->fd; + mm.addr = uap->addr; + mm.pos = uap->pos; rp = (void *) round_page((vm_offset_t)(td->td_proc->p_vmspace->vm_daddr + maxdsiz)); - if ((SCARG(&mm, flags) & MAP_FIXED) == 0 && - SCARG(&mm, addr) != 0 && (void *)SCARG(&mm, addr) < rp) - SCARG(&mm, addr) = rp; + if ((mm.flags & MAP_FIXED) == 0 && + mm.addr != 0 && (void *)mm.addr < rp) + mm.addr = rp; return mmap(td, &mm); } @@ -625,7 +625,7 @@ svr4_sys_fchroot(td, uap) if ((error = suser(td)) != 0) return error; - if ((error = getvnode(fdp, SCARG(uap, fd), &fp)) != 0) + if ((error = getvnode(fdp, uap->fd, &fp)) != 0) return error; vp = (struct vnode *) fp->f_data; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); @@ -664,14 +664,14 @@ svr4_mknod(td, retval, path, mode, dev) if (S_ISFIFO(mode)) { struct mkfifo_args ap; - SCARG(&ap, path) = path; - SCARG(&ap, mode) = mode; + ap.path = path; + ap.mode = mode; return mkfifo(td, &ap); } else { struct mknod_args ap; - SCARG(&ap, path) = path; - SCARG(&ap, mode) = mode; - SCARG(&ap, dev) = dev; + ap.path = path; + ap.mode = mode; + ap.dev = dev; return mknod(td, &ap); } } @@ -684,8 +684,8 @@ svr4_sys_mknod(td, uap) { int *retval = td->td_retval; return svr4_mknod(td, retval, - SCARG(uap, path), SCARG(uap, mode), - (svr4_dev_t)svr4_to_bsd_odev_t(SCARG(uap, dev))); + uap->path, uap->mode, + (svr4_dev_t)svr4_to_bsd_odev_t(uap->dev)); } @@ -696,8 +696,8 @@ svr4_sys_xmknod(td, uap) { int *retval = td->td_retval; return svr4_mknod(td, retval, - SCARG(uap, path), SCARG(uap, mode), - (svr4_dev_t)svr4_to_bsd_dev_t(SCARG(uap, dev))); + uap->path, uap->mode, + (svr4_dev_t)svr4_to_bsd_dev_t(uap->dev)); } @@ -719,7 +719,7 @@ svr4_sys_sysconfig(td, uap) retval = &(td->td_retval[0]); - switch (SCARG(uap, name)) { + switch (uap->name) { case SVR4_CONFIG_UNUSED: *retval = 0; break; @@ -823,7 +823,7 @@ svr4_sys_break(td, uap) int rv; base = round_page((vm_offset_t) vm->vm_daddr); - ns = (vm_offset_t)SCARG(uap, nsize); + ns = (vm_offset_t)uap->nsize; new = round_page(ns); /* For p_rlimit. */ mtx_assert(&Giant, MA_OWNED); @@ -890,8 +890,8 @@ svr4_sys_times(td, uap) caddr_t sg = stackgap_init(); ru = stackgap_alloc(&sg, sizeof(struct rusage)); - SCARG(&ga, who) = RUSAGE_SELF; - SCARG(&ga, rusage) = ru; + ga.who = RUSAGE_SELF; + ga.rusage = ru; error = getrusage(td, &ga); if (error) @@ -903,7 +903,7 @@ svr4_sys_times(td, uap) tms.tms_utime = timeval_to_clock_t(&r.ru_utime); tms.tms_stime = timeval_to_clock_t(&r.ru_stime); - SCARG(&ga, who) = RUSAGE_CHILDREN; + ga.who = RUSAGE_CHILDREN; error = getrusage(td, &ga); if (error) return error; @@ -917,7 +917,7 @@ svr4_sys_times(td, uap) microtime(&t); *retval = timeval_to_clock_t(&t); - return copyout(&tms, SCARG(uap, tp), sizeof(tms)); + return copyout(&tms, uap->tp, sizeof(tms)); } @@ -928,7 +928,7 @@ svr4_sys_ulimit(td, uap) { int *retval = td->td_retval; - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case SVR4_GFILLIM: /* For p_rlimit below. */ mtx_assert(&Giant, MA_OWNED); @@ -946,7 +946,7 @@ svr4_sys_ulimit(td, uap) struct rlimit *url = (struct rlimit *) stackgap_alloc(&sg, sizeof *url); - krl.rlim_cur = SCARG(uap, newlimit) * 512; + krl.rlim_cur = uap->newlimit * 512; mtx_assert(&Giant, MA_OWNED); krl.rlim_max = td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_max; @@ -954,8 +954,8 @@ svr4_sys_ulimit(td, uap) if (error) return error; - SCARG(&srl, which) = RLIMIT_FSIZE; - SCARG(&srl, rlp) = url; + srl.which = RLIMIT_FSIZE; + srl.rlp = url; error = setrlimit(td, &srl); if (error) @@ -1020,7 +1020,7 @@ svr4_sys_pgrpsys(td, uap) int *retval = td->td_retval; struct proc *p = td->td_proc; - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case 1: /* setpgrp() */ /* * SVR4 setpgrp() (which takes no arguments) has the @@ -1039,9 +1039,9 @@ svr4_sys_pgrpsys(td, uap) return 0; case 2: /* getsid(pid) */ - if (SCARG(uap, pid) == 0) + if (uap->pid == 0) PROC_LOCK(p); - else if ((p = svr4_pfind(SCARG(uap, pid))) == NULL) + else if ((p = svr4_pfind(uap->pid)) == NULL) return ESRCH; /* * This has already been initialized to the pid of @@ -1056,9 +1056,9 @@ svr4_sys_pgrpsys(td, uap) case 4: /* getpgid(pid) */ - if (SCARG(uap, pid) == 0) + if (uap->pid == 0) PROC_LOCK(p); - else if ((p = svr4_pfind(SCARG(uap, pid))) == NULL) + else if ((p = svr4_pfind(uap->pid)) == NULL) return ESRCH; *retval = (int) p->p_pgrp->pg_id; @@ -1069,8 +1069,8 @@ svr4_sys_pgrpsys(td, uap) { struct setpgid_args sa; - SCARG(&sa, pid) = SCARG(uap, pid); - SCARG(&sa, pgid) = SCARG(uap, pgid); + sa.pid = uap->pid; + sa.pgid = uap->pgid; return setpgid(td, &sa); } @@ -1096,7 +1096,7 @@ svr4_hrtcntl(td, uap, retval) struct svr4_hrtcntl_args *uap; register_t *retval; { - switch (SCARG(uap, fun)) { + switch (uap->fun) { case SVR4_HRT_CNTL_RES: DPRINTF(("htrcntl(RES)\n")); *retval = SVR4_HRT_USEC; @@ -1107,11 +1107,11 @@ svr4_hrtcntl(td, uap, retval) { struct timeval tv; svr4_hrt_time_t t; - if (SCARG(uap, clk) != SVR4_HRT_CLK_STD) { - DPRINTF(("clk == %d\n", SCARG(uap, clk))); + if (uap->clk != SVR4_HRT_CLK_STD) { + DPRINTF(("clk == %d\n", uap->clk)); return EINVAL; } - if (SCARG(uap, ti) == NULL) { + if (uap->ti == NULL) { DPRINTF(("ti NULL\n")); return EINVAL; } @@ -1119,7 +1119,7 @@ svr4_hrtcntl(td, uap, retval) t.h_sec = tv.tv_sec; t.h_rem = tv.tv_usec; t.h_res = SVR4_HRT_USEC; - return copyout(&t, SCARG(uap, ti), sizeof(t)); + return copyout(&t, uap->ti, sizeof(t)); } case SVR4_HRT_CNTL_START: @@ -1130,7 +1130,7 @@ svr4_hrtcntl(td, uap, retval) DPRINTF(("htrcntl(GET)\n")); return ENOSYS; default: - DPRINTF(("Bad htrcntl command %d\n", SCARG(uap, fun))); + DPRINTF(("Bad htrcntl command %d\n", uap->fun)); return ENOSYS; } } @@ -1143,7 +1143,7 @@ svr4_sys_hrtsys(td, uap) { int *retval = td->td_retval; - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case SVR4_HRT_CNTL: return svr4_hrtcntl(td, (struct svr4_hrtcntl_args *) uap, retval); @@ -1161,7 +1161,7 @@ svr4_sys_hrtsys(td, uap) return ENOSYS; default: - DPRINTF(("Bad hrtsys command %d\n", SCARG(uap, cmd))); + DPRINTF(("Bad hrtsys command %d\n", uap->cmd)); return EINVAL; } } @@ -1235,18 +1235,18 @@ svr4_sys_waitsys(td, uap) struct proc *q, *t; - switch (SCARG(uap, grp)) { + switch (uap->grp) { case SVR4_P_PID: break; case SVR4_P_PGID: PROC_LOCK(td->td_proc); - SCARG(uap, id) = -td->td_proc->p_pgid; + uap->id = -td->td_proc->p_pgid; PROC_UNLOCK(td->td_proc); break; case SVR4_P_ALL: - SCARG(uap, id) = WAIT_ANY; + uap->id = WAIT_ANY; break; default: @@ -1254,37 +1254,37 @@ svr4_sys_waitsys(td, uap) } DPRINTF(("waitsys(%d, %d, %p, %x)\n", - SCARG(uap, grp), SCARG(uap, id), - SCARG(uap, info), SCARG(uap, options))); + uap->grp, uap->id, + uap->info, uap->options)); loop: nfound = 0; sx_slock(&proctree_lock); LIST_FOREACH(q, &td->td_proc->p_children, p_sibling) { PROC_LOCK(q); - if (SCARG(uap, id) != WAIT_ANY && - q->p_pid != SCARG(uap, id) && - q->p_pgid != -SCARG(uap, id)) { + if (uap->id != WAIT_ANY && + q->p_pid != uap->id && + q->p_pgid != -uap->id) { PROC_UNLOCK(q); DPRINTF(("pid %d pgid %d != %d\n", q->p_pid, - q->p_pgid, SCARG(uap, id))); + q->p_pgid, uap->id)); continue; } nfound++; mtx_lock_spin(&sched_lock); if ((q->p_state == PRS_ZOMBIE) && - ((SCARG(uap, options) & (SVR4_WEXITED|SVR4_WTRAPPED)))) { + ((uap->options & (SVR4_WEXITED|SVR4_WTRAPPED)))) { mtx_unlock_spin(&sched_lock); PROC_UNLOCK(q); sx_sunlock(&proctree_lock); *retval = 0; DPRINTF(("found %d\n", q->p_pid)); - error = svr4_setinfo(q, q->p_xstat, SCARG(uap, info)); + error = svr4_setinfo(q, q->p_xstat, uap->info); if (error != 0) return error; - if ((SCARG(uap, options) & SVR4_WNOWAIT)) { + if ((uap->options & SVR4_WNOWAIT)) { DPRINTF(("Don't wait\n")); return 0; } @@ -1391,15 +1391,15 @@ loop: /* XXXKSE this needs clarification */ if (P_SHOULDSTOP(q) && ((q->p_flag & P_WAITED) == 0) && (q->p_flag & P_TRACED || - (SCARG(uap, options) & (SVR4_WSTOPPED|SVR4_WCONTINUED)))) { + (uap->options & (SVR4_WSTOPPED|SVR4_WCONTINUED)))) { mtx_unlock_spin(&sched_lock); DPRINTF(("jobcontrol %d\n", q->p_pid)); - if (((SCARG(uap, options) & SVR4_WNOWAIT)) == 0) + if (((uap->options & SVR4_WNOWAIT)) == 0) q->p_flag |= P_WAITED; PROC_UNLOCK(q); *retval = 0; return svr4_setinfo(q, W_STOPCODE(q->p_xstat), - SCARG(uap, info)); + uap->info); } mtx_unlock_spin(&sched_lock); PROC_UNLOCK(q); @@ -1408,9 +1408,9 @@ loop: if (nfound == 0) return ECHILD; - if (SCARG(uap, options) & SVR4_WNOHANG) { + if (uap->options & SVR4_WNOHANG) { *retval = 0; - if ((error = svr4_setinfo(NULL, 0, SCARG(uap, info))) != 0) + if ((error = svr4_setinfo(NULL, 0, uap->info)) != 0) return error; return 0; } @@ -1485,9 +1485,9 @@ svr4_sys_statvfs(td, uap) struct svr4_statvfs sfs; int error; - CHECKALTEXIST(td, &sg, SCARG(uap, path)); - SCARG(&fs_args, path) = SCARG(uap, path); - SCARG(&fs_args, buf) = fs; + CHECKALTEXIST(td, &sg, uap->path); + fs_args.path = uap->path; + fs_args.buf = fs; if ((error = statfs(td, &fs_args)) != 0) return error; @@ -1497,7 +1497,7 @@ svr4_sys_statvfs(td, uap) bsd_statfs_to_svr4_statvfs(&bfs, &sfs); - return copyout(&sfs, SCARG(uap, fs), sizeof(sfs)); + return copyout(&sfs, uap->fs, sizeof(sfs)); } @@ -1513,8 +1513,8 @@ svr4_sys_fstatvfs(td, uap) struct svr4_statvfs sfs; int error; - SCARG(&fs_args, fd) = SCARG(uap, fd); - SCARG(&fs_args, buf) = fs; + fs_args.fd = uap->fd; + fs_args.buf = fs; if ((error = fstatfs(td, &fs_args)) != 0) return error; @@ -1524,7 +1524,7 @@ svr4_sys_fstatvfs(td, uap) bsd_statfs_to_svr4_statvfs(&bfs, &sfs); - return copyout(&sfs, SCARG(uap, fs), sizeof(sfs)); + return copyout(&sfs, uap->fs, sizeof(sfs)); } @@ -1540,9 +1540,9 @@ svr4_sys_statvfs64(td, uap) struct svr4_statvfs64 sfs; int error; - CHECKALTEXIST(td, &sg, SCARG(uap, path)); - SCARG(&fs_args, path) = SCARG(uap, path); - SCARG(&fs_args, buf) = fs; + CHECKALTEXIST(td, &sg, uap->path); + fs_args.path = uap->path; + fs_args.buf = fs; if ((error = statfs(td, &fs_args)) != 0) return error; @@ -1552,7 +1552,7 @@ svr4_sys_statvfs64(td, uap) bsd_statfs_to_svr4_statvfs64(&bfs, &sfs); - return copyout(&sfs, SCARG(uap, fs), sizeof(sfs)); + return copyout(&sfs, uap->fs, sizeof(sfs)); } @@ -1568,8 +1568,8 @@ svr4_sys_fstatvfs64(td, uap) struct svr4_statvfs64 sfs; int error; - SCARG(&fs_args, fd) = SCARG(uap, fd); - SCARG(&fs_args, buf) = fs; + fs_args.fd = uap->fd; + fs_args.buf = fs; if ((error = fstatfs(td, &fs_args)) != 0) return error; @@ -1579,7 +1579,7 @@ svr4_sys_fstatvfs64(td, uap) bsd_statfs_to_svr4_statvfs64(&bfs, &sfs); - return copyout(&sfs, SCARG(uap, fs), sizeof(sfs)); + return copyout(&sfs, uap->fs, sizeof(sfs)); } int @@ -1595,12 +1595,12 @@ svr4_sys_alarm(td, uap) itp = stackgap_alloc(&sg, sizeof(*itp)); oitp = stackgap_alloc(&sg, sizeof(*oitp)); timevalclear(&itp->it_interval); - itp->it_value.tv_sec = SCARG(uap, sec); + itp->it_value.tv_sec = uap->sec; itp->it_value.tv_usec = 0; - SCARG(&sa, which) = ITIMER_REAL; - SCARG(&sa, itv) = itp; - SCARG(&sa, oitv) = oitp; + sa.which = ITIMER_REAL; + sa.itv = itp; + sa.oitv = oitp; error = setitimer(td, &sa); if (error) return error; @@ -1616,11 +1616,11 @@ svr4_sys_gettimeofday(td, uap) struct thread *td; struct svr4_sys_gettimeofday_args *uap; { - if (SCARG(uap, tp)) { + if (uap->tp) { struct timeval atv; microtime(&atv); - return copyout(&atv, SCARG(uap, tp), sizeof (atv)); + return copyout(&atv, uap->tp, sizeof (atv)); } return 0; @@ -1636,14 +1636,14 @@ svr4_sys_facl(td, uap) retval = td->td_retval; *retval = 0; - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case SVR4_SYS_SETACL: /* We don't support acls on any filesystem */ return ENOSYS; case SVR4_SYS_GETACL: - return copyout(retval, &SCARG(uap, num), - sizeof(SCARG(uap, num))); + return copyout(retval, &uap->num, + sizeof(uap->num)); case SVR4_SYS_GETACLCNT: return 0; @@ -1679,14 +1679,14 @@ svr4_sys_memcntl(td, uap) struct thread *td; struct svr4_sys_memcntl_args *uap; { - switch (SCARG(uap, cmd)) { + switch (uap->cmd) { case SVR4_MC_SYNC: { struct msync_args msa; - SCARG(&msa, addr) = SCARG(uap, addr); - SCARG(&msa, len) = SCARG(uap, len); - SCARG(&msa, flags) = (int)SCARG(uap, arg); + msa.addr = uap->addr; + msa.len = uap->len; + msa.flags = (int)uap->arg; return msync(td, &msa); } @@ -1694,9 +1694,9 @@ svr4_sys_memcntl(td, uap) { struct madvise_args maa; - SCARG(&maa, addr) = SCARG(uap, addr); - SCARG(&maa, len) = SCARG(uap, len); - SCARG(&maa, behav) = (int)SCARG(uap, arg); + maa.addr = uap->addr; + maa.len = uap->len; + maa.behav = (int)uap->arg; return madvise(td, &maa); } @@ -1719,9 +1719,9 @@ svr4_sys_nice(td, uap) struct setpriority_args ap; int error; - SCARG(&ap, which) = PRIO_PROCESS; - SCARG(&ap, who) = 0; - SCARG(&ap, prio) = SCARG(uap, prio); + ap.which = PRIO_PROCESS; + ap.who = 0; + ap.prio = uap->prio; if ((error = setpriority(td, &ap)) != 0) return error; @@ -1742,17 +1742,17 @@ svr4_sys_resolvepath(td, uap) int error, *retval = td->td_retval; NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME, UIO_USERSPACE, - SCARG(uap, path), td); + uap->path, td); if ((error = namei(&nd)) != 0) return error; - if ((error = copyout(nd.ni_cnd.cn_pnbuf, SCARG(uap, buf), - SCARG(uap, bufsiz))) != 0) + if ((error = copyout(nd.ni_cnd.cn_pnbuf, uap->buf, + uap->bufsiz)) != 0) goto bad; - *retval = strlen(nd.ni_cnd.cn_pnbuf) < SCARG(uap, bufsiz) ? - strlen(nd.ni_cnd.cn_pnbuf) + 1 : SCARG(uap, bufsiz); + *retval = strlen(nd.ni_cnd.cn_pnbuf) < uap->bufsiz ? + strlen(nd.ni_cnd.cn_pnbuf) + 1 : uap->bufsiz; bad: NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); diff --git a/sys/compat/svr4/svr4_resource.c b/sys/compat/svr4/svr4_resource.c index 2d7a0ea..e9adace 100644 --- a/sys/compat/svr4/svr4_resource.c +++ b/sys/compat/svr4/svr4_resource.c @@ -133,7 +133,7 @@ svr4_sys_getrlimit(td, uap) register struct thread *td; struct svr4_sys_getrlimit_args *uap; { - int rl = svr4_to_native_rl(SCARG(uap, which)); + int rl = svr4_to_native_rl(uap->which); struct rlimit blim; struct svr4_rlimit slim; @@ -171,7 +171,7 @@ svr4_sys_getrlimit(td, uap) else slim.rlim_cur = SVR4_RLIM_SAVED_CUR; - return copyout(&slim, SCARG(uap, rlp), sizeof(*SCARG(uap, rlp))); + return copyout(&slim, uap->rlp, sizeof(*uap->rlp)); } @@ -180,7 +180,7 @@ svr4_sys_setrlimit(td, uap) register struct thread *td; struct svr4_sys_setrlimit_args *uap; { - int rl = svr4_to_native_rl(SCARG(uap, which)); + int rl = svr4_to_native_rl(uap->which); struct rlimit blim, *limp; struct svr4_rlimit slim; int error; @@ -192,7 +192,7 @@ svr4_sys_setrlimit(td, uap) mtx_assert(&Giant, MA_OWNED); limp = &td->td_proc->p_rlimit[rl]; - if ((error = copyin(SCARG(uap, rlp), &slim, sizeof(slim))) != 0) + if ((error = copyin(uap->rlp, &slim, sizeof(slim))) != 0) return error; /* @@ -231,7 +231,7 @@ svr4_sys_getrlimit64(td, uap) register struct thread *td; struct svr4_sys_getrlimit64_args *uap; { - int rl = svr4_to_native_rl(SCARG(uap, which)); + int rl = svr4_to_native_rl(uap->which); struct rlimit blim; struct svr4_rlimit64 slim; @@ -269,7 +269,7 @@ svr4_sys_getrlimit64(td, uap) else slim.rlim_cur = SVR4_RLIM64_SAVED_CUR; - return copyout(&slim, SCARG(uap, rlp), sizeof(*SCARG(uap, rlp))); + return copyout(&slim, uap->rlp, sizeof(*uap->rlp)); } @@ -278,7 +278,7 @@ svr4_sys_setrlimit64(td, uap) register struct thread *td; struct svr4_sys_setrlimit64_args *uap; { - int rl = svr4_to_native_rl(SCARG(uap, which)); + int rl = svr4_to_native_rl(uap->which); struct rlimit blim, *limp; struct svr4_rlimit64 slim; int error; @@ -290,7 +290,7 @@ svr4_sys_setrlimit64(td, uap) mtx_assert(&Giant, MA_OWNED); limp = &td->td_proc->p_rlimit[rl]; - if ((error = copyin(SCARG(uap, rlp), &slim, sizeof(slim))) != 0) + if ((error = copyin(uap->rlp, &slim, sizeof(slim))) != 0) return error; /* diff --git a/sys/compat/svr4/svr4_signal.c b/sys/compat/svr4/svr4_signal.c index fea5317..3e688e6 100644 --- a/sys/compat/svr4/svr4_signal.c +++ b/sys/compat/svr4/svr4_signal.c @@ -269,12 +269,12 @@ svr4_sys_sigaction(td, uap) int error; DPRINTF(("@@@ svr4_sys_sigaction(%d, %d, %d)\n", td->td_proc->p_pid, - SCARG(uap, signum), - SVR4_SVR42BSD_SIG(SCARG(uap, signum)))); + uap->signum, + SVR4_SVR42BSD_SIG(uap->signum))); sg = stackgap_init(); - nisa = SCARG(uap, nsa); - oisa = SCARG(uap, osa); + nisa = uap->nsa; + oisa = uap->osa; if (oisa != NULL) obsa = stackgap_alloc(&sg, sizeof(struct sigaction)); @@ -301,9 +301,9 @@ svr4_sys_sigaction(td, uap) } #endif - SCARG(&sa, sig) = SVR4_SVR42BSD_SIG(SCARG(uap, signum)); - SCARG(&sa, act) = nbsa; - SCARG(&sa, oact) = obsa; + sa.sig = SVR4_SVR42BSD_SIG(uap->signum); + sa.act = nbsa; + sa.oact = obsa; if ((error = sigaction(td, &sa)) != 0) return error; @@ -332,8 +332,8 @@ svr4_sys_sigaltstack(td, uap) retval = td->td_retval; sg = stackgap_init(); - nsss = SCARG(uap, nss); - osss = SCARG(uap, oss); + nsss = uap->nss; + osss = uap->oss; if (osss != NULL) obss = stackgap_alloc(&sg, sizeof(struct sigaltstack)); @@ -350,8 +350,8 @@ svr4_sys_sigaltstack(td, uap) } else nbss = NULL; - SCARG(&sa, ss) = nbss; - SCARG(&sa, oss) = obss; + sa.ss = nbss; + sa.oss = obss; if ((error = sigaltstack(td, &sa)) != 0) return error; @@ -381,13 +381,13 @@ svr4_sys_signal(td, uap) DPRINTF(("@@@ svr4_sys_signal(%d)\n", td->td_proc->p_pid)); - signum = SVR4_SVR42BSD_SIG(SVR4_SIGNO(SCARG(uap, signum))); + signum = SVR4_SVR42BSD_SIG(SVR4_SIGNO(uap->signum)); if (signum <= 0 || signum > SVR4_NSIG) return (EINVAL); - switch (SVR4_SIGCALL(SCARG(uap, signum))) { + switch (SVR4_SIGCALL(uap->signum)) { case SVR4_SIGDEFER_MASK: - if (SCARG(uap, handler) == SVR4_SIG_HOLD) + if (uap->handler == SVR4_SIG_HOLD) goto sighold; /* FALLTHROUGH */ @@ -398,11 +398,11 @@ svr4_sys_signal(td, uap) nbsa = stackgap_alloc(&sg, sizeof(struct sigaction)); obsa = stackgap_alloc(&sg, sizeof(struct sigaction)); - SCARG(&sa_args, sig) = signum; - SCARG(&sa_args, act) = nbsa; - SCARG(&sa_args, oact) = obsa; + sa_args.sig = signum; + sa_args.act = nbsa; + sa_args.oact = obsa; - sa.sa_handler = (sig_t) SCARG(uap, handler); + sa.sa_handler = (sig_t) uap->handler; SIGEMPTYSET(sa.sa_mask); sa.sa_flags = 0; @@ -432,9 +432,9 @@ sighold: set = stackgap_alloc(&sg, sizeof(sigset_t)); SIGEMPTYSET(*set); SIGADDSET(*set, signum); - SCARG(&sa, how) = SIG_BLOCK; - SCARG(&sa, set) = set; - SCARG(&sa, oset) = NULL; + sa.how = SIG_BLOCK; + sa.set = set; + sa.oset = NULL; return sigprocmask(td, &sa); } @@ -446,9 +446,9 @@ sighold: set = stackgap_alloc(&sg, sizeof(sigset_t)); SIGEMPTYSET(*set); SIGADDSET(*set, signum); - SCARG(&sa, how) = SIG_UNBLOCK; - SCARG(&sa, set) = set; - SCARG(&sa, oset) = NULL; + sa.how = SIG_UNBLOCK; + sa.set = set; + sa.oset = NULL; return sigprocmask(td, &sa); } @@ -458,9 +458,9 @@ sighold: struct sigaction *bsa, sa; bsa = stackgap_alloc(&sg, sizeof(struct sigaction)); - SCARG(&sa_args, sig) = signum; - SCARG(&sa_args, act) = bsa; - SCARG(&sa_args, oact) = NULL; + sa_args.sig = signum; + sa_args.act = bsa; + sa_args.oact = NULL; sa.sa_handler = SIG_IGN; SIGEMPTYSET(sa.sa_mask); @@ -484,7 +484,7 @@ sighold: *set = td->td_proc->p_sigmask; PROC_UNLOCK(td->td_proc); SIGDELSET(*set, signum); - SCARG(&sa, sigmask) = set; + sa.sigmask = set; return sigsuspend(td, &sa); } @@ -504,26 +504,26 @@ svr4_sys_sigprocmask(td, uap) int error = 0, *retval; retval = td->td_retval; - if (SCARG(uap, oset) != NULL) { + if (uap->oset != NULL) { /* Fix the return value first if needed */ PROC_LOCK(td->td_proc); bsd_to_svr4_sigset(&td->td_proc->p_sigmask, &sss); PROC_UNLOCK(td->td_proc); - if ((error = copyout(&sss, SCARG(uap, oset), sizeof(sss))) != 0) + if ((error = copyout(&sss, uap->oset, sizeof(sss))) != 0) return error; } - if (SCARG(uap, set) == NULL) + if (uap->set == NULL) /* Just examine */ return 0; - if ((error = copyin(SCARG(uap, set), &sss, sizeof(sss))) != 0) + if ((error = copyin(uap->set, &sss, sizeof(sss))) != 0) return error; svr4_to_bsd_sigset(&sss, &bss); PROC_LOCK(td->td_proc); - switch (SCARG(uap, how)) { + switch (uap->how) { case SVR4_SIG_BLOCK: SIGSETOR(td->td_proc->p_sigmask, bss); SIG_CANTMASK(td->td_proc->p_sigmask); @@ -560,9 +560,9 @@ svr4_sys_sigpending(td, uap) DPRINTF(("@@@ svr4_sys_sigpending(%d)\n", td->td_proc->p_pid)); retval = td->td_retval; - switch (SCARG(uap, what)) { + switch (uap->what) { case 1: /* sigpending */ - if (SCARG(uap, mask) == NULL) + if (uap->mask == NULL) return 0; PROC_LOCK(td->td_proc); bss = td->td_proc->p_siglist; @@ -586,7 +586,7 @@ svr4_sys_sigpending(td, uap) return EINVAL; } - return copyout(&sss, SCARG(uap, mask), sizeof(sss)); + return copyout(&sss, uap->mask, sizeof(sss)); } int @@ -600,13 +600,13 @@ svr4_sys_sigsuspend(td, uap) int error; caddr_t sg = stackgap_init(); - if ((error = copyin(SCARG(uap, ss), &sss, sizeof(sss))) != 0) + if ((error = copyin(uap->ss, &sss, sizeof(sss))) != 0) return error; bss = stackgap_alloc(&sg, sizeof(sigset_t)); svr4_to_bsd_sigset(&sss, bss); - SCARG(&sa, sigmask) = bss; + sa.sigmask = bss; return sigsuspend(td, &sa); } @@ -618,8 +618,8 @@ svr4_sys_kill(td, uap) { struct kill_args ka; - SCARG(&ka, pid) = SCARG(uap, pid); - SCARG(&ka, signum) = SVR4_SVR42BSD_SIG(SCARG(uap, signum)); + ka.pid = uap->pid; + ka.signum = SVR4_SVR42BSD_SIG(uap->signum); return kill(td, &ka); } @@ -671,6 +671,6 @@ svr4_sys_pause(td, uap) { struct sigsuspend_args bsa; - SCARG(&bsa, sigmask) = &td->td_proc->p_sigmask; + bsa.sigmask = &td->td_proc->p_sigmask; return sigsuspend(td, &bsa); } diff --git a/sys/compat/svr4/svr4_socket.c b/sys/compat/svr4/svr4_socket.c index b4f2b55..bea6306 100644 --- a/sys/compat/svr4/svr4_socket.c +++ b/sys/compat/svr4/svr4_socket.c @@ -166,25 +166,25 @@ svr4_sys_socket(td, uap) struct thread *td; struct svr4_sys_socket_args *uap; { - switch (SCARG(uap, type)) { + switch (uap->type) { case SVR4_SOCK_DGRAM: - SCARG(uap, type) = SOCK_DGRAM; + uap->type = SOCK_DGRAM; break; case SVR4_SOCK_STREAM: - SCARG(uap, type) = SOCK_STREAM; + uap->type = SOCK_STREAM; break; case SVR4_SOCK_RAW: - SCARG(uap, type) = SOCK_RAW; + uap->type = SOCK_RAW; break; case SVR4_SOCK_RDM: - SCARG(uap, type) = SOCK_RDM; + uap->type = SOCK_RDM; break; case SVR4_SOCK_SEQPACKET: - SCARG(uap, type) = SOCK_SEQPACKET; + uap->type = SOCK_SEQPACKET; break; default: return EINVAL; diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index 351c6c7..51576b9 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -164,24 +164,24 @@ svr4_sys_stat(td, uap) int error; caddr_t sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); - SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); + cup.path = uap->path; + cup.ub = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = stat(td, &cup)) != 0) return error; - if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0) + if ((error = copyin(cup.ub, &st, sizeof st)) != 0) return error; bsd_to_svr4_stat(&st, &svr4_st); if (S_ISSOCK(st.st_mode)) - (void) svr4_add_socket(td, SCARG(uap, path), &st); + (void) svr4_add_socket(td, uap->path, &st); - if ((error = copyout(&svr4_st, SCARG(uap, ub), sizeof svr4_st)) != 0) + if ((error = copyout(&svr4_st, uap->ub, sizeof svr4_st)) != 0) return error; return 0; @@ -199,23 +199,23 @@ svr4_sys_lstat(td, uap) int error; caddr_t sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); - SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); + cup.path = uap->path; + cup.ub = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = lstat(td, &cup)) != 0) return error; - if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0) + if ((error = copyin(cup.ub, &st, sizeof st)) != 0) return error; bsd_to_svr4_stat(&st, &svr4_st); if (S_ISSOCK(st.st_mode)) - (void) svr4_add_socket(td, SCARG(uap, path), &st); + (void) svr4_add_socket(td, uap->path, &st); - if ((error = copyout(&svr4_st, SCARG(uap, ub), sizeof svr4_st)) != 0) + if ((error = copyout(&svr4_st, uap->ub, sizeof svr4_st)) != 0) return error; return 0; @@ -233,18 +233,18 @@ svr4_sys_fstat(td, uap) int error; caddr_t sg = stackgap_init(); - SCARG(&cup, fd) = SCARG(uap, fd); - SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(struct stat)); + cup.fd = uap->fd; + cup.sb = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = fstat(td, &cup)) != 0) return error; - if ((error = copyin(SCARG(&cup, sb), &st, sizeof st)) != 0) + if ((error = copyin(cup.sb, &st, sizeof st)) != 0) return error; bsd_to_svr4_stat(&st, &svr4_st); - if ((error = copyout(&svr4_st, SCARG(uap, sb), sizeof svr4_st)) != 0) + if ((error = copyout(&svr4_st, uap->sb, sizeof svr4_st)) != 0) return error; return 0; @@ -262,25 +262,25 @@ svr4_sys_xstat(td, uap) int error; caddr_t sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); - SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); + cup.path = uap->path; + cup.ub = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = stat(td, &cup)) != 0) return error; - if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0) + if ((error = copyin(cup.ub, &st, sizeof st)) != 0) return error; bsd_to_svr4_xstat(&st, &svr4_st); #if defined(SOCKET_NOTYET) if (S_ISSOCK(st.st_mode)) - (void) svr4_add_socket(td, SCARG(uap, path), &st); + (void) svr4_add_socket(td, uap->path, &st); #endif - if ((error = copyout(&svr4_st, SCARG(uap, ub), sizeof svr4_st)) != 0) + if ((error = copyout(&svr4_st, uap->ub, sizeof svr4_st)) != 0) return error; return 0; @@ -296,24 +296,24 @@ svr4_sys_lxstat(td, uap) struct lstat_args cup; int error; caddr_t sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); - SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); + cup.path = uap->path; + cup.ub = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = lstat(td, &cup)) != 0) return error; - if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0) + if ((error = copyin(cup.ub, &st, sizeof st)) != 0) return error; bsd_to_svr4_xstat(&st, &svr4_st); #if defined(SOCKET_NOTYET) if (S_ISSOCK(st.st_mode)) - (void) svr4_add_socket(td, SCARG(uap, path), &st); + (void) svr4_add_socket(td, uap->path, &st); #endif - if ((error = copyout(&svr4_st, SCARG(uap, ub), sizeof svr4_st)) != 0) + if ((error = copyout(&svr4_st, uap->ub, sizeof svr4_st)) != 0) return error; return 0; @@ -332,18 +332,18 @@ svr4_sys_fxstat(td, uap) caddr_t sg = stackgap_init(); - SCARG(&cup, fd) = SCARG(uap, fd); - SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(struct stat)); + cup.fd = uap->fd; + cup.sb = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = fstat(td, &cup)) != 0) return error; - if ((error = copyin(SCARG(&cup, sb), &st, sizeof st)) != 0) + if ((error = copyin(cup.sb, &st, sizeof st)) != 0) return error; bsd_to_svr4_xstat(&st, &svr4_st); - if ((error = copyout(&svr4_st, SCARG(uap, sb), sizeof svr4_st)) != 0) + if ((error = copyout(&svr4_st, uap->sb, sizeof svr4_st)) != 0) return error; return 0; @@ -360,23 +360,23 @@ svr4_sys_stat64(td, uap) int error; caddr_t sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); - SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); + cup.path = uap->path; + cup.ub = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = stat(td, &cup)) != 0) return error; - if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0) + if ((error = copyin(cup.ub, &st, sizeof st)) != 0) return error; bsd_to_svr4_stat64(&st, &svr4_st); if (S_ISSOCK(st.st_mode)) - (void) svr4_add_socket(td, SCARG(uap, path), &st); + (void) svr4_add_socket(td, uap->path, &st); - if ((error = copyout(&svr4_st, SCARG(uap, sb), sizeof svr4_st)) != 0) + if ((error = copyout(&svr4_st, uap->sb, sizeof svr4_st)) != 0) return error; return 0; @@ -394,23 +394,23 @@ svr4_sys_lstat64(td, uap) int error; caddr_t sg = stackgap_init(); - CHECKALTEXIST(td, &sg, (char *) SCARG(uap, path)); + CHECKALTEXIST(td, &sg, (char *) uap->path); - SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); + cup.path = uap->path; + cup.ub = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = lstat(td, (struct lstat_args *)&cup)) != 0) return error; - if ((error = copyin(SCARG(&cup, ub), &st, sizeof st)) != 0) + if ((error = copyin(cup.ub, &st, sizeof st)) != 0) return error; bsd_to_svr4_stat64(&st, &svr4_st); if (S_ISSOCK(st.st_mode)) - (void) svr4_add_socket(td, SCARG(uap, path), &st); + (void) svr4_add_socket(td, uap->path, &st); - if ((error = copyout(&svr4_st, SCARG(uap, sb), sizeof svr4_st)) != 0) + if ((error = copyout(&svr4_st, uap->sb, sizeof svr4_st)) != 0) return error; return 0; @@ -428,18 +428,18 @@ svr4_sys_fstat64(td, uap) int error; caddr_t sg = stackgap_init(); - SCARG(&cup, fd) = SCARG(uap, fd); - SCARG(&cup, sb) = stackgap_alloc(&sg, sizeof(struct stat)); + cup.fd = uap->fd; + cup.sb = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = fstat(td, &cup)) != 0) return error; - if ((error = copyin(SCARG(&cup, sb), &st, sizeof st)) != 0) + if ((error = copyin(cup.sb, &st, sizeof st)) != 0) return error; bsd_to_svr4_stat64(&st, &svr4_st); - if ((error = copyout(&svr4_st, SCARG(uap, sb), sizeof svr4_st)) != 0) + if ((error = copyout(&svr4_st, uap->sb, sizeof svr4_st)) != 0) return error; return 0; @@ -460,7 +460,7 @@ svr4_ustat(td, uap) * XXX: should set f_tfree and f_tinode at least * How do we translate dev -> fstat? (and then to svr4_ustat) */ - if ((error = copyout(&us, SCARG(uap, name), sizeof us)) != 0) + if ((error = copyout(&us, uap->name, sizeof us)) != 0) return (error); return 0; @@ -483,7 +483,7 @@ svr4_sys_uname(td, uap) strlcpy(sut.version, version, sizeof(sut.version)); strlcpy(sut.machine, machine, sizeof(sut.machine)); - return copyout((caddr_t) &sut, (caddr_t) SCARG(uap, name), + return copyout((caddr_t) &sut, (caddr_t) uap->name, sizeof(struct svr4_utsname)); } @@ -499,9 +499,9 @@ svr4_sys_systeminfo(td, uap) char buf[1]; /* XXX NetBSD uses 256, but that seems like awfully excessive kstack usage for an empty string... */ - u_int rlen = SCARG(uap, len); + u_int rlen = uap->len; - switch (SCARG(uap, what)) { + switch (uap->what) { case SVR4_SI_SYSNAME: str = ostype; break; @@ -554,13 +554,13 @@ svr4_sys_systeminfo(td, uap) if ((error = suser(td)) != 0) return error; name = KERN_HOSTNAME; - return kern_sysctl(&name, 1, 0, 0, SCARG(uap, buf), rlen, td); + return kern_sysctl(&name, 1, 0, 0, uap->buf, rlen, td); case SVR4_SI_SET_SRPC_DOMAIN: if ((error = suser(td)) != 0) return error; name = KERN_NISDOMAINNAME; - return kern_sysctl(&name, 1, 0, 0, SCARG(uap, buf), rlen, td); + return kern_sysctl(&name, 1, 0, 0, uap->buf, rlen, td); #else case SVR4_SI_SET_HOSTNAME: case SVR4_SI_SET_SRPC_DOMAIN: @@ -570,7 +570,7 @@ svr4_sys_systeminfo(td, uap) return 0; default: - DPRINTF(("Bad systeminfo command %d\n", SCARG(uap, what))); + DPRINTF(("Bad systeminfo command %d\n", uap->what)); return ENOSYS; } @@ -579,13 +579,13 @@ svr4_sys_systeminfo(td, uap) if (len > rlen) len = rlen; - if (SCARG(uap, buf)) { - error = copyout(str, SCARG(uap, buf), len); + if (uap->buf) { + error = copyout(str, uap->buf, len); if (error) return error; /* make sure we are NULL terminated */ buf[0] = '\0'; - error = copyout(buf, &(SCARG(uap, buf)[len - 1]), 1); + error = copyout(buf, &(uap->buf[len - 1]), 1); } else error = 0; @@ -602,19 +602,19 @@ svr4_sys_utssys(td, uap) register struct thread *td; struct svr4_sys_utssys_args *uap; { - switch (SCARG(uap, sel)) { + switch (uap->sel) { case 0: /* uname(2) */ { struct svr4_sys_uname_args ua; - SCARG(&ua, name) = SCARG(uap, a1); + ua.name = uap->a1; return svr4_sys_uname(td, &ua); } case 2: /* ustat(2) */ { struct svr4_ustat_args ua; - SCARG(&ua, dev) = (svr4_dev_t) SCARG(uap, a2); - SCARG(&ua, name) = SCARG(uap, a1); + ua.dev = (svr4_dev_t) uap->a2; + ua.name = uap->a1; return svr4_ustat(td, &ua); } @@ -640,10 +640,10 @@ svr4_sys_utime(td, uap) caddr_t sg = stackgap_init(); void *ttp; - CHECKALTEXIST(td, &sg, SCARG(uap, path)); - SCARG(&ap, path) = SCARG(uap, path); - if (SCARG(uap, ubuf) != NULL) { - if ((error = copyin(SCARG(uap, ubuf), &ub, sizeof(ub))) != 0) + CHECKALTEXIST(td, &sg, uap->path); + ap.path = uap->path; + if (uap->ubuf != NULL) { + if ((error = copyin(uap->ubuf, &ub, sizeof(ub))) != 0) return error; tbuf[0].tv_sec = ub.actime; tbuf[0].tv_usec = 0; @@ -653,10 +653,10 @@ svr4_sys_utime(td, uap) error = copyout(tbuf, ttp, sizeof(tbuf)); if (error) return error; - SCARG(&ap, tptr) = ttp; + ap.tptr = ttp; } else - SCARG(&ap, tptr) = NULL; + ap.tptr = NULL; return utimes(td, &ap); } @@ -667,7 +667,7 @@ svr4_sys_utimes(td, uap) struct svr4_sys_utimes_args *uap; { caddr_t sg = stackgap_init(); - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); return utimes(td, (struct utimes_args *)uap); } @@ -728,11 +728,11 @@ svr4_sys_pathconf(td, uap) caddr_t sg = stackgap_init(); register_t *retval = td->td_retval; - CHECKALTEXIST(td, &sg, SCARG(uap, path)); + CHECKALTEXIST(td, &sg, uap->path); - SCARG(uap, name) = svr4_to_bsd_pathconf(SCARG(uap, name)); + uap->name = svr4_to_bsd_pathconf(uap->name); - switch (SCARG(uap, name)) { + switch (uap->name) { case -1: *retval = -1; return EINVAL; @@ -752,9 +752,9 @@ svr4_sys_fpathconf(td, uap) { register_t *retval = td->td_retval; - SCARG(uap, name) = svr4_to_bsd_pathconf(SCARG(uap, name)); + uap->name = svr4_to_bsd_pathconf(uap->name); - switch (SCARG(uap, name)) { + switch (uap->name) { case -1: *retval = -1; return EINVAL; diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index 468bcae..ea75ba7 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -524,17 +524,17 @@ clean_pipe(td, path) void *tpath; tpath = stackgap_alloc(&sg, l); - SCARG(&la, ub) = stackgap_alloc(&sg, sizeof(struct stat)); + la.ub = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = copyout(path, tpath, l)) != 0) return error; - SCARG(&la, path) = tpath; + la.path = tpath; if ((error = lstat(td, &la)) != 0) return 0; - if ((error = copyin(SCARG(&la, ub), &st, sizeof(st))) != 0) + if ((error = copyin(la.ub, &st, sizeof(st))) != 0) return 0; /* @@ -546,7 +546,7 @@ clean_pipe(td, path) if ((st.st_mode & ALLPERMS) != 0) return 0; - SCARG(&ua, path) = SCARG(&la, path); + ua.path = la.path; if ((error = unlink(td, &ua)) != 0) { DPRINTF(("clean_pipe: unlink failed %d\n", error)); @@ -773,9 +773,9 @@ si_listen(fp, fd, ioc, td) /* * We are making assumptions again... */ - SCARG(&la, s) = fd; + la.s = fd; DPRINTF(("SI_LISTEN: fileno %d backlog = %d\n", fd, 5)); - SCARG(&la, backlog) = 5; + la.backlog = 5; if ((error = listen(td, &la)) != 0) { DPRINTF(("SI_LISTEN: listen failed %d\n", error)); @@ -880,16 +880,16 @@ si_shutdown(fp, fd, ioc, td) int error; struct shutdown_args ap; - if (ioc->len != sizeof(SCARG(&ap, how))) { + if (ioc->len != sizeof(ap.how)) { DPRINTF(("SI_SHUTDOWN: Wrong size %d != %d\n", - sizeof(SCARG(&ap, how)), ioc->len)); + sizeof(ap.how), ioc->len)); return EINVAL; } - if ((error = copyin(ioc->buf, &SCARG(&ap, how), ioc->len)) != 0) + if ((error = copyin(ioc->buf, &ap.how, ioc->len)) != 0) return error; - SCARG(&ap, s) = fd; + ap.s = fd; return shutdown(td, &ap); } @@ -1066,10 +1066,10 @@ ti_bind(fp, fd, ioc, td) if ((error = copyout(skp, sup, sasize)) != 0) return error; - SCARG(&ba, s) = fd; + ba.s = fd; DPRINTF(("TI_BIND: fileno %d\n", fd)); - SCARG(&ba, name) = (void *) sup; - SCARG(&ba, namelen) = sasize; + ba.name = (void *) sup; + ba.namelen = sasize; if ((error = bind(td, &ba)) != 0) { DPRINTF(("TI_BIND: bind failed %d\n", error)); @@ -1186,9 +1186,9 @@ svr4_stream_ti_ioctl(fp, td, retval, fd, cmd, dat) DPRINTF(("TI_GETMYNAME\n")); { struct getsockname_args ap; - SCARG(&ap, fdes) = fd; - SCARG(&ap, asa) = sup; - SCARG(&ap, alen) = lenp; + ap.fdes = fd; + ap.asa = sup; + ap.alen = lenp; if ((error = getsockname(td, &ap)) != 0) { DPRINTF(("ti_ioctl: getsockname error\n")); return error; @@ -1200,9 +1200,9 @@ svr4_stream_ti_ioctl(fp, td, retval, fd, cmd, dat) DPRINTF(("TI_GETPEERNAME\n")); { struct getpeername_args ap; - SCARG(&ap, fdes) = fd; - SCARG(&ap, asa) = sup; - SCARG(&ap, alen) = lenp; + ap.fdes = fd; + ap.asa = sup; + ap.alen = lenp; if ((error = getpeername(td, &ap)) != 0) { DPRINTF(("ti_ioctl: getpeername error\n")); return error; @@ -1334,8 +1334,8 @@ i_fdinsert(fp, td, retval, fd, cmd, dat) return error; } - SCARG(&d2p, from) = st->s_afd; - SCARG(&d2p, to) = fdi.fd; + d2p.from = st->s_afd; + d2p.to = fdi.fd; if ((error = dup2(td, &d2p)) != 0) { DPRINTF(("fdinsert: dup2(%d, %d) failed %d\n", @@ -1343,7 +1343,7 @@ i_fdinsert(fp, td, retval, fd, cmd, dat) return error; } - SCARG(&clp, fd) = st->s_afd; + clp.fd = st->s_afd; if ((error = close(td, &clp)) != 0) { DPRINTF(("fdinsert: close(%d) failed %d\n", @@ -1376,8 +1376,8 @@ _i_bind_rsvd(fp, td, retval, fd, cmd, dat) * ``reserve'' it. I don't know how this get reserved inside * the kernel, but we are going to create it nevertheless. */ - SCARG(&ap, path) = dat; - SCARG(&ap, mode) = S_IFIFO; + ap.path = dat; + ap.mode = S_IFIFO; return mkfifo(td, &ap); } @@ -1397,7 +1397,7 @@ _i_rele_rsvd(fp, td, retval, fd, cmd, dat) * This is a supposed to be a kernel and library only ioctl. * I guess it is supposed to release the socket. */ - SCARG(&ap, path) = dat; + ap.path = dat; return unlink(td, &ap); } @@ -1473,8 +1473,8 @@ i_setsig(fp, td, retval, fd, cmd, dat) return EINVAL; } /* get old status flags */ - SCARG(&fa, fd) = fd; - SCARG(&fa, cmd) = F_GETFL; + fa.fd = fd; + fa.cmd = F_GETFL; if ((error = fcntl(td, &fa)) != 0) return error; @@ -1502,8 +1502,8 @@ i_setsig(fp, td, retval, fd, cmd, dat) /* set the new flags, if changed */ if (flags != oflags) { - SCARG(&fa, cmd) = F_SETFL; - SCARG(&fa, arg) = (long) flags; + fa.cmd = F_SETFL; + fa.arg = (long) flags; if ((error = fcntl(td, &fa)) != 0) return error; flags = td->td_retval[0]; @@ -1511,8 +1511,8 @@ i_setsig(fp, td, retval, fd, cmd, dat) /* set up SIGIO receiver if needed */ if (dat != NULL) { - SCARG(&fa, cmd) = F_SETOWN; - SCARG(&fa, arg) = (long) td->td_proc->p_pid; + fa.cmd = F_SETOWN; + fa.arg = (long) td->td_proc->p_pid; return fcntl(td, &fa); } return 0; @@ -1760,14 +1760,14 @@ svr4_do_putmsg(td, uap, fp) retval = td->td_retval; #ifdef DEBUG_SVR4 - show_msg(">putmsg", SCARG(uap, fd), SCARG(uap, ctl), - SCARG(uap, dat), SCARG(uap, flags)); + show_msg(">putmsg", uap->fd, uap->ctl, + uap->dat, uap->flags); #endif /* DEBUG_SVR4 */ FILE_LOCK_ASSERT(fp, MA_NOTOWNED); - if (SCARG(uap, ctl) != NULL) { - if ((error = copyin(SCARG(uap, ctl), &ctl, sizeof(ctl))) != 0) { + if (uap->ctl != NULL) { + if ((error = copyin(uap->ctl, &ctl, sizeof(ctl))) != 0) { #ifdef DEBUG_SVR4 uprintf("putmsg: copyin(): %d\n", error); #endif @@ -1777,8 +1777,8 @@ svr4_do_putmsg(td, uap, fp) else ctl.len = -1; - if (SCARG(uap, dat) != NULL) { - if ((error = copyin(SCARG(uap, dat), &dat, sizeof(dat))) != 0) { + if (uap->dat != NULL) { + if ((error = copyin(uap->dat, &dat, sizeof(dat))) != 0) { #ifdef DEBUG_SVR4 uprintf("putmsg: copyin(): %d (2)\n", error); #endif @@ -1820,9 +1820,9 @@ svr4_do_putmsg(td, uap, fp) * is how it works. newton@atdot.dotat.org XXX */ DPRINTF(("sending expedited data ??\n")); - SCARG(&wa, fd) = SCARG(uap, fd); - SCARG(&wa, buf) = dat.buf; - SCARG(&wa, nbyte) = dat.len; + wa.fd = uap->fd; + wa.buf = dat.buf; + wa.nbyte = dat.len; return write(td, &wa); } DPRINTF(("putmsg: Invalid inet length %ld\n", sc.len)); @@ -1872,9 +1872,9 @@ svr4_do_putmsg(td, uap, fp) { struct connect_args co; - SCARG(&co, s) = SCARG(uap, fd); - SCARG(&co, name) = (void *) sup; - SCARG(&co, namelen) = (int) sasize; + co.s = uap->fd; + co.name = (void *) sup; + co.namelen = (int) sasize; return connect(td, &co); } @@ -1896,8 +1896,8 @@ svr4_do_putmsg(td, uap, fp) error = so->so_proto->pr_usrreqs->pru_sosend(so, 0, uio, 0, 0, 0, uio->uio_td); #endif - error = svr4_sendit(td, SCARG(uap, fd), &msg, - SCARG(uap, flags)); + error = svr4_sendit(td, uap->fd, &msg, + uap->flags); DPRINTF(("sendto_request error: %d\n", error)); *retval = 0; return error; @@ -1957,12 +1957,12 @@ svr4_do_getmsg(td, uap, fp) memset(&sc, 0, sizeof(sc)); #ifdef DEBUG_SVR4 - show_msg(">getmsg", SCARG(uap, fd), SCARG(uap, ctl), - SCARG(uap, dat), 0); + show_msg(">getmsg", uap->fd, uap->ctl, + uap->dat, 0); #endif /* DEBUG_SVR4 */ - if (SCARG(uap, ctl) != NULL) { - if ((error = copyin(SCARG(uap, ctl), &ctl, sizeof(ctl))) != 0) + if (uap->ctl != NULL) { + if ((error = copyin(uap->ctl, &ctl, sizeof(ctl))) != 0) return error; } else { @@ -1970,8 +1970,8 @@ svr4_do_getmsg(td, uap, fp) ctl.maxlen = 0; } - if (SCARG(uap, dat) != NULL) { - if ((error = copyin(SCARG(uap, dat), &dat, sizeof(dat))) != 0) + if (uap->dat != NULL) { + if ((error = copyin(uap->dat, &dat, sizeof(dat))) != 0) return error; } else { @@ -2040,9 +2040,9 @@ svr4_do_getmsg(td, uap, fp) * a connect verification. */ - SCARG(&ga, fdes) = SCARG(uap, fd); - SCARG(&ga, asa) = (void *) sup; - SCARG(&ga, alen) = flen; + ga.fdes = uap->fd; + ga.asa = (void *) sup; + ga.alen = flen; if ((error = getpeername(td, &ga)) != 0) { DPRINTF(("getmsg: getpeername failed %d\n", error)); @@ -2099,9 +2099,9 @@ svr4_do_getmsg(td, uap, fp) /* * We are after a listen, so we try to accept... */ - SCARG(&aa, s) = SCARG(uap, fd); - SCARG(&aa, name) = (void *) sup; - SCARG(&aa, anamelen) = flen; + aa.s = uap->fd; + aa.name = (void *) sup; + aa.anamelen = flen; if ((error = accept(td, &aa)) != 0) { DPRINTF(("getmsg: accept failed %d\n", error)); @@ -2174,7 +2174,7 @@ svr4_do_getmsg(td, uap, fp) aiov.iov_len = dat.maxlen; msg.msg_flags = 0; - error = svr4_recvit(td, SCARG(uap, fd), &msg, (caddr_t) flen); + error = svr4_recvit(td, uap->fd, &msg, (caddr_t) flen); if (error) { DPRINTF(("getmsg: recvit failed %d\n", error)); @@ -2222,9 +2222,9 @@ svr4_do_getmsg(td, uap, fp) * appropriately (or inappropriately :-) * -- newton@atdot.dotat.org XXX */ - SCARG(&ra, fd) = SCARG(uap, fd); - SCARG(&ra, buf) = dat.buf; - SCARG(&ra, nbyte) = dat.maxlen; + ra.fd = uap->fd; + ra.buf = dat.buf; + ra.nbyte = dat.maxlen; if ((error = read(td, &ra)) != 0) { return error; } @@ -2237,30 +2237,30 @@ svr4_do_getmsg(td, uap, fp) return EINVAL; } - if (SCARG(uap, ctl)) { + if (uap->ctl) { if (ctl.len != -1) if ((error = copyout(&sc, ctl.buf, ctl.len)) != 0) return error; - if ((error = copyout(&ctl, SCARG(uap, ctl), sizeof(ctl))) != 0) + if ((error = copyout(&ctl, uap->ctl, sizeof(ctl))) != 0) return error; } - if (SCARG(uap, dat)) { - if ((error = copyout(&dat, SCARG(uap, dat), sizeof(dat))) != 0) + if (uap->dat) { + if ((error = copyout(&dat, uap->dat, sizeof(dat))) != 0) return error; } - if (SCARG(uap, flags)) { /* XXX: Need translation */ - if ((error = copyout(&fl, SCARG(uap, flags), sizeof(fl))) != 0) + if (uap->flags) { /* XXX: Need translation */ + if ((error = copyout(&fl, uap->flags, sizeof(fl))) != 0) return error; } *retval = 0; #ifdef DEBUG_SVR4 - show_msg("<getmsg", SCARG(uap, fd), SCARG(uap, ctl), - SCARG(uap, dat), fl); + show_msg("<getmsg", uap->fd, uap->ctl, + uap->dat, fl); #endif /* DEBUG_SVR4 */ return error; } @@ -2270,10 +2270,10 @@ int svr4_sys_send(td, uap) struct svr4_sys_send_args *uap; { struct osend_args osa; - SCARG(&osa, s) = SCARG(uap, s); - SCARG(&osa, buf) = SCARG(uap, buf); - SCARG(&osa, len) = SCARG(uap, len); - SCARG(&osa, flags) = SCARG(uap, flags); + osa.s = uap->s; + osa.buf = uap->buf; + osa.len = uap->len; + osa.flags = uap->flags; return osend(td, &osa); } @@ -2282,10 +2282,10 @@ int svr4_sys_recv(td, uap) struct svr4_sys_recv_args *uap; { struct orecv_args ora; - SCARG(&ora, s) = SCARG(uap, s); - SCARG(&ora, buf) = SCARG(uap, buf); - SCARG(&ora, len) = SCARG(uap, len); - SCARG(&ora, flags) = SCARG(uap, flags); + ora.s = uap->s; + ora.buf = uap->buf; + ora.len = uap->len; + ora.flags = uap->flags; return orecv(td, &ora); } @@ -2300,12 +2300,12 @@ svr4_sys_sendto(td, uap) { struct sendto_args sa; - SCARG(&sa, s) = SCARG(uap, s); - SCARG(&sa, buf) = SCARG(uap, buf); - SCARG(&sa, len) = SCARG(uap, len); - SCARG(&sa, flags) = SCARG(uap, flags); - SCARG(&sa, to) = (caddr_t)SCARG(uap, to); - SCARG(&sa, tolen) = SCARG(uap, tolen); + sa.s = uap->s; + sa.buf = uap->buf; + sa.len = uap->len; + sa.flags = uap->flags; + sa.to = (caddr_t)uap->to; + sa.tolen = uap->tolen; DPRINTF(("calling sendto()\n")); return sendto(td, &sa); |