Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/sunos32 make this compile again
details: https://anonhg.NetBSD.org/src/rev/384668976233
branches: trunk
changeset: 454652:384668976233
user: christos <christos%NetBSD.org@localhost>
date: Mon Sep 23 21:07:39 2019 +0000
description:
make this compile again
diffstat:
sys/compat/sunos32/sunos32_misc.c | 50 ++++++++++++--------------------------
1 files changed, 16 insertions(+), 34 deletions(-)
diffs (98 lines):
diff -r bc6cc1ce7603 -r 384668976233 sys/compat/sunos32/sunos32_misc.c
--- a/sys/compat/sunos32/sunos32_misc.c Mon Sep 23 20:42:29 2019 +0000
+++ b/sys/compat/sunos32/sunos32_misc.c Mon Sep 23 21:07:39 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos32_misc.c,v 1.81 2019/09/17 15:19:27 christos Exp $ */
+/* $NetBSD: sunos32_misc.c,v 1.82 2019/09/23 21:07:39 christos Exp $ */
/* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp */
/*
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.81 2019/09/17 15:19:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.82 2019/09/23 21:07:39 christos Exp $");
#define COMPAT_SUNOS 1
@@ -838,7 +838,7 @@
name = ipoptxlat[name - SUNOS_IP_MULTICAST_IF];
}
}
- if (SCARG(uap, valsize) > MLEN) {
+ if ((unsigned)SCARG(uap, valsize) > MLEN) {
error = EINVAL;
goto out;
}
@@ -1081,25 +1081,15 @@
syscallarg(const netbsd32_charp) path;
syscallarg(sunos32_statfsp_t) buf;
} */
- struct mount *mp;
struct statvfs *sp;
int error;
- struct vnode *vp;
- struct sys_statvfs1_args ua;
- SUNOS32TOP_UAP(path, const char);
-
- error = namei_simple_user(SCARG(&ua, path),
- NSM_FOLLOW_TRYEMULROOT, &vp);
- if (error != 0)
- return (error);
- mp = vp->v_mount;
- sp = &mp->mnt_stat;
- vrele(vp);
- if ((error = VFS_STATVFS(mp, sp)) != 0)
- return (error);
- sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
- return sunstatfs(sp, SCARG_P32(uap, buf));
+ sp = STATVFSBUF_GET();
+ error = do_sys_pstatvfs(l, SCARG_P32(uap, path), 0, sp);
+ if (error == 0)
+ error = sunstatfs(sp, SCARG_P32(uap, buf));
+ STATVFSBUF_PUT(sp);
+ return error;
}
int
@@ -1109,23 +1099,15 @@
syscallarg(int) fd;
syscallarg(sunos32_statfsp_t) buf;
} */
- file_t *fp;
- struct mount *mp;
struct statvfs *sp;
int error;
- /* fd_getvnode() will use the descriptor for us */
- if ((error = fd_getvnode(SCARG(uap, fd), &fp)) != 0)
- return (error);
- mp = fp->f_vnode->v_mount;
- sp = &mp->mnt_stat;
- if ((error = VFS_STATVFS(mp, sp)) != 0)
- goto out;
- sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
- error = sunstatfs(sp, SCARG_P32(uap, buf));
- out:
- fd_putfile(SCARG(uap, fd));
- return (error);
+ sp = STATVFSBUF_GET();
+ error = do_sys_fstatvfs(l, SCARG(uap, fd), 0, sp);
+ if (error == 0)
+ error = sunstatfs(sp, SCARG_P32(uap, buf));
+ STATVFSBUF_PUT(sp);
+ return error;
}
int
@@ -1258,7 +1240,7 @@
PT_KILL, -1, PT_ATTACH, PT_DETACH,
PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS
};
-static const int nreqs = sizeof(sreq2breq) / sizeof(sreq2breq[0]);
+static const size_t nreqs = __arraycount(sreq2breq);
int
sunos32_sys_ptrace(struct lwp *l, const struct sunos32_sys_ptrace_args *uap, register_t *retval)
Home |
Main Index |
Thread Index |
Old Index