summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4/svr4_stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/svr4/svr4_stat.c')
-rw-r--r--sys/compat/svr4/svr4_stat.c148
1 files changed, 74 insertions, 74 deletions
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;
OpenPOWER on IntegriCloud