Module Name:    src
Committed By:   christos
Date:           Mon Sep 23 21:07:39 UTC 2019

Modified Files:
        src/sys/compat/sunos32: sunos32_misc.c

Log Message:
make this compile again


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/sunos32/sunos32_misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/sunos32/sunos32_misc.c
diff -u src/sys/compat/sunos32/sunos32_misc.c:1.81 src/sys/compat/sunos32/sunos32_misc.c:1.82
--- src/sys/compat/sunos32/sunos32_misc.c:1.81	Tue Sep 17 11:19:27 2019
+++ src/sys/compat/sunos32/sunos32_misc.c	Mon Sep 23 17:07:39 2019
@@ -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 @@ sunos32_sys_setsockopt(struct lwp *l, co
 			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 @@ sunos32_sys_statfs(struct lwp *l, const 
 		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 @@ sunos32_sys_fstatfs(struct lwp *l, const
 		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 @@ static const int sreq2breq[] = {
 	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)

Reply via email to