Fri Jul 24 13:02:52 2015 UTC ()
Unused inits (harmless).

Found by Brainy.


(maxv)
diff -r1.28 -r1.29 src/sys/compat/common/kern_time_50.c
diff -r1.38 -r1.39 src/sys/compat/common/vfs_syscalls_20.c
diff -r1.125 -r1.126 src/sys/compat/linux/common/linux_socket.c
diff -r1.19 -r1.20 src/sys/compat/linux32/common/linux32_socket.c
diff -r1.29 -r1.30 src/sys/compat/netbsd32/netbsd32_compat_50.c
diff -r1.54 -r1.55 src/sys/compat/ultrix/ultrix_fs.c
diff -r1.55 -r1.56 src/sys/kern/kern_ntptime.c
diff -r1.179 -r1.180 src/sys/kern/kern_time.c
diff -r1.8 -r1.9 src/sys/kern/kern_veriexec.c
diff -r1.56 -r1.57 src/sys/kern/sys_lwp.c
diff -r1.499 -r1.500 src/sys/kern/vfs_syscalls.c
diff -r1.70 -r1.71 src/sys/miscfs/procfs/procfs_linux.c
diff -r1.334 -r1.335 src/sys/ufs/ffs/ffs_vfsops.c

cvs diff -r1.28 -r1.29 src/sys/compat/common/kern_time_50.c (expand / switch to unified diff)

--- src/sys/compat/common/kern_time_50.c 2014/11/09 17:48:07 1.28
+++ src/sys/compat/common/kern_time_50.c 2015/07/24 13:02:52 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: kern_time_50.c,v 1.28 2014/11/09 17:48:07 maxv Exp $ */ 1/* $NetBSD: kern_time_50.c,v 1.29 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas. 8 * by Christos Zoulas.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.28 2014/11/09 17:48:07 maxv Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.29 2015/07/24 13:02:52 maxv Exp $");
33 33
34#ifdef _KERNEL_OPT 34#ifdef _KERNEL_OPT
35#include "opt_aio.h" 35#include "opt_aio.h"
36#include "opt_ntp.h" 36#include "opt_ntp.h"
37#include "opt_mqueue.h" 37#include "opt_mqueue.h"
38#endif 38#endif
39 39
40#include <sys/param.h> 40#include <sys/param.h>
41#include <sys/conf.h> 41#include <sys/conf.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <sys/namei.h> 43#include <sys/namei.h>
44#include <sys/filedesc.h> 44#include <sys/filedesc.h>
45#include <sys/kernel.h> 45#include <sys/kernel.h>
@@ -113,27 +113,27 @@ compat_50_sys_clock_settime(struct lwp * @@ -113,27 +113,27 @@ compat_50_sys_clock_settime(struct lwp *
113} 113}
114 114
115 115
116int 116int
117compat_50_sys_clock_getres(struct lwp *l, 117compat_50_sys_clock_getres(struct lwp *l,
118 const struct compat_50_sys_clock_getres_args *uap, register_t *retval) 118 const struct compat_50_sys_clock_getres_args *uap, register_t *retval)
119{ 119{
120 /* { 120 /* {
121 syscallarg(clockid_t) clock_id; 121 syscallarg(clockid_t) clock_id;
122 syscallarg(struct timespec50 *) tp; 122 syscallarg(struct timespec50 *) tp;
123 } */ 123 } */
124 struct timespec50 ats50; 124 struct timespec50 ats50;
125 struct timespec ats; 125 struct timespec ats;
126 int error = 0; 126 int error;
127 127
128 error = clock_getres1(SCARG(uap, clock_id), &ats); 128 error = clock_getres1(SCARG(uap, clock_id), &ats);
129 if (error != 0) 129 if (error != 0)
130 return error; 130 return error;
131 131
132 if (SCARG(uap, tp)) { 132 if (SCARG(uap, tp)) {
133 timespec_to_timespec50(&ats, &ats50); 133 timespec_to_timespec50(&ats, &ats50);
134 error = copyout(&ats50, SCARG(uap, tp), sizeof(ats50)); 134 error = copyout(&ats50, SCARG(uap, tp), sizeof(ats50));
135 } 135 }
136 136
137 return error; 137 return error;
138} 138}
139 139

cvs diff -r1.38 -r1.39 src/sys/compat/common/vfs_syscalls_20.c (expand / switch to unified diff)

--- src/sys/compat/common/vfs_syscalls_20.c 2014/09/05 09:21:54 1.38
+++ src/sys/compat/common/vfs_syscalls_20.c 2015/07/24 13:02:52 1.39
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vfs_syscalls_20.c,v 1.38 2014/09/05 09:21:54 matt Exp $ */ 1/* $NetBSD: vfs_syscalls_20.c,v 1.39 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1989, 1993 4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc. 6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed 7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph 8 * to the University of California by American Telephone and Telegraph
9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10 * the permission of UNIX System Laboratories, Inc. 10 * the permission of UNIX System Laboratories, Inc.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 * 35 *
36 * @(#)vfs_syscalls.c 8.42 (Berkeley) 7/31/95 36 * @(#)vfs_syscalls.c 8.42 (Berkeley) 7/31/95
37 */ 37 */
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.38 2014/09/05 09:21:54 matt Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.39 2015/07/24 13:02:52 maxv Exp $");
41 41
42#ifdef _KERNEL_OPT 42#ifdef _KERNEL_OPT
43#include "opt_compat_netbsd.h" 43#include "opt_compat_netbsd.h"
44#endif 44#endif
45 45
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/namei.h> 48#include <sys/namei.h>
49#include <sys/filedesc.h> 49#include <sys/filedesc.h>
50#include <sys/kernel.h> 50#include <sys/kernel.h>
51#include <sys/file.h> 51#include <sys/file.h>
52#include <sys/stat.h> 52#include <sys/stat.h>
53#include <sys/vnode.h> 53#include <sys/vnode.h>
@@ -80,27 +80,27 @@ static const struct { @@ -80,27 +80,27 @@ static const struct {
80 { MOUNT_NFS, MOUNTNO_NFS }, 80 { MOUNT_NFS, MOUNTNO_NFS },
81 { MOUNT_MFS, MOUNTNO_MFS }, 81 { MOUNT_MFS, MOUNTNO_MFS },
82 { MOUNT_MSDOS, MOUNTNO_MSDOS }, 82 { MOUNT_MSDOS, MOUNTNO_MSDOS },
83 { MOUNT_CD9660, MOUNTNO_CD9660 }, 83 { MOUNT_CD9660, MOUNTNO_CD9660 },
84 { MOUNT_FDESC, MOUNTNO_FDESC }, 84 { MOUNT_FDESC, MOUNTNO_FDESC },
85 { MOUNT_KERNFS, MOUNTNO_KERNFS }, 85 { MOUNT_KERNFS, MOUNTNO_KERNFS },
86 { MOUNT_AFS, MOUNTNO_AFS }, 86 { MOUNT_AFS, MOUNTNO_AFS },
87}; 87};
88 88
89static int 89static int
90vfs2fs(struct statfs12 *bfs, const struct statvfs *fs) 90vfs2fs(struct statfs12 *bfs, const struct statvfs *fs)
91{ 91{
92 struct statfs12 ofs; 92 struct statfs12 ofs;
93 int i = 0; 93 int i;
94 ofs.f_type = 0; 94 ofs.f_type = 0;
95 ofs.f_oflags = (short)fs->f_flag; 95 ofs.f_oflags = (short)fs->f_flag;
96 96
97 for (i = 0; i < sizeof(nv) / sizeof(nv[0]); i++) { 97 for (i = 0; i < sizeof(nv) / sizeof(nv[0]); i++) {
98 if (strcmp(nv[i].name, fs->f_fstypename) == 0) { 98 if (strcmp(nv[i].name, fs->f_fstypename) == 0) {
99 ofs.f_type = nv[i].value; 99 ofs.f_type = nv[i].value;
100 break; 100 break;
101 } 101 }
102 } 102 }
103#define CLAMP(a) (long)(((a) & ~LONG_MAX) ? LONG_MAX : (a)) 103#define CLAMP(a) (long)(((a) & ~LONG_MAX) ? LONG_MAX : (a))
104 ofs.f_bsize = CLAMP(fs->f_frsize); 104 ofs.f_bsize = CLAMP(fs->f_frsize);
105 ofs.f_iosize = CLAMP(fs->f_iosize); 105 ofs.f_iosize = CLAMP(fs->f_iosize);
106 ofs.f_blocks = CLAMP(fs->f_blocks); 106 ofs.f_blocks = CLAMP(fs->f_blocks);
@@ -129,27 +129,27 @@ vfs2fs(struct statfs12 *bfs, const struc @@ -129,27 +129,27 @@ vfs2fs(struct statfs12 *bfs, const struc
129/* 129/*
130 * Get filesystem statistics. 130 * Get filesystem statistics.
131 */ 131 */
132/* ARGSUSED */ 132/* ARGSUSED */
133int 133int
134compat_20_sys_statfs(struct lwp *l, const struct compat_20_sys_statfs_args *uap, register_t *retval) 134compat_20_sys_statfs(struct lwp *l, const struct compat_20_sys_statfs_args *uap, register_t *retval)
135{ 135{
136 /* { 136 /* {
137 syscallarg(const char *) path; 137 syscallarg(const char *) path;
138 syscallarg(struct statfs12 *) buf; 138 syscallarg(struct statfs12 *) buf;
139 } */ 139 } */
140 struct mount *mp; 140 struct mount *mp;
141 struct statvfs *sbuf; 141 struct statvfs *sbuf;
142 int error = 0; 142 int error;
143 struct vnode *vp; 143 struct vnode *vp;
144 144
145 error = namei_simple_user(SCARG(uap, path), 145 error = namei_simple_user(SCARG(uap, path),
146 NSM_FOLLOW_TRYEMULROOT, &vp); 146 NSM_FOLLOW_TRYEMULROOT, &vp);
147 if (error != 0) 147 if (error != 0)
148 return error; 148 return error;
149 149
150 mp = vp->v_mount; 150 mp = vp->v_mount;
151 151
152 sbuf = malloc(sizeof(*sbuf), M_TEMP, M_WAITOK); 152 sbuf = malloc(sizeof(*sbuf), M_TEMP, M_WAITOK);
153 if ((error = dostatvfs(mp, sbuf, l, 0, 1)) != 0) 153 if ((error = dostatvfs(mp, sbuf, l, 0, 1)) != 0)
154 goto done; 154 goto done;
155 155

cvs diff -r1.125 -r1.126 src/sys/compat/linux/common/linux_socket.c (expand / switch to unified diff)

--- src/sys/compat/linux/common/linux_socket.c 2015/05/24 17:07:26 1.125
+++ src/sys/compat/linux/common/linux_socket.c 2015/07/24 13:02:52 1.126
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux_socket.c,v 1.125 2015/05/24 17:07:26 rtr Exp $ */ 1/* $NetBSD: linux_socket.c,v 1.126 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Frank van der Linden and Eric Haszlakiewicz. 8 * by Frank van der Linden and Eric Haszlakiewicz.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * Functions in multiarch: 33 * Functions in multiarch:
34 * linux_sys_socketcall : linux_socketcall.c 34 * linux_sys_socketcall : linux_socketcall.c
35 */ 35 */
36 36
37#include <sys/cdefs.h> 37#include <sys/cdefs.h>
38__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.125 2015/05/24 17:07:26 rtr Exp $"); 38__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.126 2015/07/24 13:02:52 maxv Exp $");
39 39
40#if defined(_KERNEL_OPT) 40#if defined(_KERNEL_OPT)
41#include "opt_inet.h" 41#include "opt_inet.h"
42#endif /* defined(_KERNEL_OPT) */ 42#endif /* defined(_KERNEL_OPT) */
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/kernel.h> 45#include <sys/kernel.h>
46#include <sys/systm.h> 46#include <sys/systm.h>
47#include <sys/buf.h> 47#include <sys/buf.h>
48#include <sys/ioctl.h> 48#include <sys/ioctl.h>
49#include <sys/tty.h> 49#include <sys/tty.h>
50#include <sys/file.h> 50#include <sys/file.h>
51#include <sys/filedesc.h> 51#include <sys/filedesc.h>
@@ -1105,27 +1105,27 @@ linux_getifname(struct lwp *l, register_ @@ -1105,27 +1105,27 @@ linux_getifname(struct lwp *l, register_
1105 1105
1106 return copyout(&ifr, data, sizeof(ifr)); 1106 return copyout(&ifr, data, sizeof(ifr));
1107} 1107}
1108 1108
1109int 1109int
1110linux_getifconf(struct lwp *l, register_t *retval, void *data) 1110linux_getifconf(struct lwp *l, register_t *retval, void *data)
1111{ 1111{
1112 struct linux_ifreq ifr, *ifrp = NULL; 1112 struct linux_ifreq ifr, *ifrp = NULL;
1113 struct linux_ifconf ifc; 1113 struct linux_ifconf ifc;
1114 struct ifnet *ifp; 1114 struct ifnet *ifp;
1115 struct ifaddr *ifa; 1115 struct ifaddr *ifa;
1116 struct sockaddr *sa; 1116 struct sockaddr *sa;
1117 struct osockaddr *osa; 1117 struct osockaddr *osa;
1118 int space = 0, error = 0; 1118 int space = 0, error;
1119 const int sz = (int)sizeof(ifr); 1119 const int sz = (int)sizeof(ifr);
1120 bool docopy; 1120 bool docopy;
1121 1121
1122 error = copyin(data, &ifc, sizeof(ifc)); 1122 error = copyin(data, &ifc, sizeof(ifc));
1123 if (error) 1123 if (error)
1124 return error; 1124 return error;
1125 1125
1126 docopy = ifc.ifc_req != NULL; 1126 docopy = ifc.ifc_req != NULL;
1127 if (docopy) { 1127 if (docopy) {
1128 space = ifc.ifc_len; 1128 space = ifc.ifc_len;
1129 ifrp = ifc.ifc_req; 1129 ifrp = ifc.ifc_req;
1130 } 1130 }
1131 1131

cvs diff -r1.19 -r1.20 src/sys/compat/linux32/common/linux32_socket.c (expand / switch to unified diff)

--- src/sys/compat/linux32/common/linux32_socket.c 2014/11/26 09:53:53 1.19
+++ src/sys/compat/linux32/common/linux32_socket.c 2015/07/24 13:02:52 1.20
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: linux32_socket.c,v 1.19 2014/11/26 09:53:53 ozaki-r Exp $ */ 1/* $NetBSD: linux32_socket.c,v 1.20 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. 4 * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS  24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE. 31 * POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35 35
36__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.19 2014/11/26 09:53:53 ozaki-r Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.20 2015/07/24 13:02:52 maxv Exp $");
37 37
38#include <sys/types.h> 38#include <sys/types.h>
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/fstypes.h> 40#include <sys/fstypes.h>
41#include <sys/signal.h> 41#include <sys/signal.h>
42#include <sys/dirent.h> 42#include <sys/dirent.h>
43#include <sys/kernel.h> 43#include <sys/kernel.h>
44#include <sys/fcntl.h> 44#include <sys/fcntl.h>
45#include <sys/select.h> 45#include <sys/select.h>
46#include <sys/proc.h> 46#include <sys/proc.h>
47#include <sys/ucred.h> 47#include <sys/ucred.h>
48#include <sys/swap.h> 48#include <sys/swap.h>
49#include <sys/file.h> 49#include <sys/file.h>
@@ -406,27 +406,27 @@ linux32_getifname(struct lwp *l, registe @@ -406,27 +406,27 @@ linux32_getifname(struct lwp *l, registe
406 406
407 return copyout(&ifr, data, sizeof(ifr)); 407 return copyout(&ifr, data, sizeof(ifr));
408} 408}
409 409
410int 410int
411linux32_getifconf(struct lwp *l, register_t *retval, void *data) 411linux32_getifconf(struct lwp *l, register_t *retval, void *data)
412{ 412{
413 struct linux32_ifreq ifr, *ifrp = NULL; 413 struct linux32_ifreq ifr, *ifrp = NULL;
414 struct linux32_ifconf ifc; 414 struct linux32_ifconf ifc;
415 struct ifnet *ifp; 415 struct ifnet *ifp;
416 struct ifaddr *ifa; 416 struct ifaddr *ifa;
417 struct sockaddr *sa; 417 struct sockaddr *sa;
418 struct osockaddr *osa; 418 struct osockaddr *osa;
419 int space = 0, error = 0; 419 int space = 0, error;
420 const int sz = (int)sizeof(ifr); 420 const int sz = (int)sizeof(ifr);
421 bool docopy; 421 bool docopy;
422 422
423 error = copyin(data, &ifc, sizeof(ifc)); 423 error = copyin(data, &ifc, sizeof(ifc));
424 if (error) 424 if (error)
425 return error; 425 return error;
426 426
427 docopy = NETBSD32PTR64(ifc.ifc_req) != NULL; 427 docopy = NETBSD32PTR64(ifc.ifc_req) != NULL;
428 if (docopy) { 428 if (docopy) {
429 space = ifc.ifc_len; 429 space = ifc.ifc_len;
430 ifrp = NETBSD32PTR64(ifc.ifc_req); 430 ifrp = NETBSD32PTR64(ifc.ifc_req);
431 } 431 }
432 432

cvs diff -r1.29 -r1.30 src/sys/compat/netbsd32/netbsd32_compat_50.c (expand / switch to unified diff)

--- src/sys/compat/netbsd32/netbsd32_compat_50.c 2015/06/21 08:47:15 1.29
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c 2015/07/24 13:02:52 1.30
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: netbsd32_compat_50.c,v 1.29 2015/06/21 08:47:15 martin Exp $ */ 1/* $NetBSD: netbsd32_compat_50.c,v 1.30 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas. 8 * by Christos Zoulas.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE. 36 * POSSIBILITY OF SUCH DAMAGE.
37 */ 37 */
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.29 2015/06/21 08:47:15 martin Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.30 2015/07/24 13:02:52 maxv Exp $");
40 40
41#if defined(_KERNEL_OPT) 41#if defined(_KERNEL_OPT)
42#include "opt_sysv.h" 42#include "opt_sysv.h"
43#endif 43#endif
44 44
45#include <sys/param.h> 45#include <sys/param.h>
46#include <sys/systm.h> 46#include <sys/systm.h>
47#include <sys/mount.h> 47#include <sys/mount.h>
48#include <sys/socket.h> 48#include <sys/socket.h>
49#include <sys/socketvar.h> 49#include <sys/socketvar.h>
50#include <sys/stat.h> 50#include <sys/stat.h>
51#include <sys/time.h> 51#include <sys/time.h>
52#include <sys/ktrace.h> 52#include <sys/ktrace.h>
@@ -342,27 +342,27 @@ compat_50_netbsd32_clock_settime(struct  @@ -342,27 +342,27 @@ compat_50_netbsd32_clock_settime(struct
342 return clock_settime1(l->l_proc, SCARG(uap, clock_id), &ats, true); 342 return clock_settime1(l->l_proc, SCARG(uap, clock_id), &ats, true);
343} 343}
344 344
345int 345int
346compat_50_netbsd32_clock_getres(struct lwp *l, 346compat_50_netbsd32_clock_getres(struct lwp *l,
347 const struct compat_50_netbsd32_clock_getres_args *uap, register_t *retval) 347 const struct compat_50_netbsd32_clock_getres_args *uap, register_t *retval)
348{ 348{
349 /* { 349 /* {
350 syscallarg(netbsd32_clockid_t) clock_id; 350 syscallarg(netbsd32_clockid_t) clock_id;
351 syscallarg(netbsd32_timespec50p_t) tp; 351 syscallarg(netbsd32_timespec50p_t) tp;
352 } */ 352 } */
353 struct netbsd32_timespec50 ts32; 353 struct netbsd32_timespec50 ts32;
354 struct timespec ts; 354 struct timespec ts;
355 int error = 0; 355 int error;
356 356
357 error = clock_getres1(SCARG(uap, clock_id), &ts); 357 error = clock_getres1(SCARG(uap, clock_id), &ts);
358 if (error != 0) 358 if (error != 0)
359 return error; 359 return error;
360 360
361 if (SCARG_P32(uap, tp)) { 361 if (SCARG_P32(uap, tp)) {
362 netbsd32_from_timespec50(&ts, &ts32); 362 netbsd32_from_timespec50(&ts, &ts32);
363 error = copyout(&ts32, SCARG_P32(uap, tp), sizeof(ts32)); 363 error = copyout(&ts32, SCARG_P32(uap, tp), sizeof(ts32));
364 } 364 }
365 365
366 return error; 366 return error;
367} 367}
368 368

cvs diff -r1.54 -r1.55 src/sys/compat/ultrix/ultrix_fs.c (expand / switch to unified diff)

--- src/sys/compat/ultrix/ultrix_fs.c 2013/11/27 17:24:44 1.54
+++ src/sys/compat/ultrix/ultrix_fs.c 2015/07/24 13:02:52 1.55
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ultrix_fs.c,v 1.54 2013/11/27 17:24:44 christos Exp $ */ 1/* $NetBSD: ultrix_fs.c,v 1.55 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995, 1997 Jonathan Stone 4 * Copyright (c) 1995, 1997 Jonathan Stone
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 25 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.54 2013/11/27 17:24:44 christos Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.55 2015/07/24 13:02:52 maxv Exp $");
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41#include <sys/exec.h> 41#include <sys/exec.h>
42#include <sys/namei.h> 42#include <sys/namei.h>
43#include <sys/mount.h> 43#include <sys/mount.h>
44#include <sys/proc.h> 44#include <sys/proc.h>
45#include <sys/vnode.h> 45#include <sys/vnode.h>
46#include <sys/vnode_if.h> 46#include <sys/vnode_if.h>
47#include <net/if.h> 47#include <net/if.h>
48#include <netinet/in.h> 48#include <netinet/in.h>
49 49
@@ -204,27 +204,27 @@ make_ultrix_mntent(struct statvfs *sp, s @@ -204,27 +204,27 @@ make_ultrix_mntent(struct statvfs *sp, s
204} 204}
205 205
206int 206int
207ultrix_sys_getmnt(struct lwp *l, const struct ultrix_sys_getmnt_args *uap, register_t *retval) 207ultrix_sys_getmnt(struct lwp *l, const struct ultrix_sys_getmnt_args *uap, register_t *retval)
208{ 208{
209 struct mount *mp, *nmp; 209 struct mount *mp, *nmp;
210 struct statvfs *sp; 210 struct statvfs *sp;
211 struct ultrix_fs_data *sfsp; 211 struct ultrix_fs_data *sfsp;
212 char *path; 212 char *path;
213 int mntflags; 213 int mntflags;
214 int skip; 214 int skip;
215 int start; 215 int start;
216 long count, maxcount; 216 long count, maxcount;
217 int error = 0; 217 int error;
218 218
219 nmp = NULL; /* XXX keep gcc quiet */ 219 nmp = NULL; /* XXX keep gcc quiet */
220 path = NULL; 220 path = NULL;
221 error = 0; 221 error = 0;
222 maxcount = SCARG(uap, bufsize) / sizeof(struct ultrix_fs_data); 222 maxcount = SCARG(uap, bufsize) / sizeof(struct ultrix_fs_data);
223 sfsp = SCARG(uap, buf); 223 sfsp = SCARG(uap, buf);
224 224
225 if (SCARG(uap, mode) == ULTRIX_STAT_ONE || 225 if (SCARG(uap, mode) == ULTRIX_STAT_ONE ||
226 SCARG(uap, mode) == ULTRIX_STAT_MANY) 226 SCARG(uap, mode) == ULTRIX_STAT_MANY)
227 mntflags = MNT_WAIT; 227 mntflags = MNT_WAIT;
228 else 228 else
229 mntflags = MNT_NOWAIT; 229 mntflags = MNT_NOWAIT;
230 230

cvs diff -r1.55 -r1.56 src/sys/kern/kern_ntptime.c (expand / switch to unified diff)

--- src/sys/kern/kern_ntptime.c 2014/02/25 18:30:11 1.55
+++ src/sys/kern/kern_ntptime.c 2015/07/24 13:02:52 1.56
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: kern_ntptime.c,v 1.55 2014/02/25 18:30:11 pooka Exp $ */ 1/* $NetBSD: kern_ntptime.c,v 1.56 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -50,27 +50,27 @@ @@ -50,27 +50,27 @@
50 * Poul-Henning Kamp <phk@FreeBSD.org>. 50 * Poul-Henning Kamp <phk@FreeBSD.org>.
51 * 51 *
52 * The 32bit version of the "LP" macros seems a bit past its "sell by"  52 * The 32bit version of the "LP" macros seems a bit past its "sell by"
53 * date so I have retained only the 64bit version and included it directly 53 * date so I have retained only the 64bit version and included it directly
54 * in this file. 54 * in this file.
55 * 55 *
56 * Only minor changes done to interface with the timecounters over in 56 * Only minor changes done to interface with the timecounters over in
57 * sys/kern/kern_clock.c. Some of the comments below may be (even more) 57 * sys/kern/kern_clock.c. Some of the comments below may be (even more)
58 * confusing and/or plain wrong in that context. 58 * confusing and/or plain wrong in that context.
59 */ 59 */
60 60
61#include <sys/cdefs.h> 61#include <sys/cdefs.h>
62/* __FBSDID("$FreeBSD: src/sys/kern/kern_ntptime.c,v 1.59 2005/05/28 14:34:41 rwatson Exp $"); */ 62/* __FBSDID("$FreeBSD: src/sys/kern/kern_ntptime.c,v 1.59 2005/05/28 14:34:41 rwatson Exp $"); */
63__KERNEL_RCSID(0, "$NetBSD: kern_ntptime.c,v 1.55 2014/02/25 18:30:11 pooka Exp $"); 63__KERNEL_RCSID(0, "$NetBSD: kern_ntptime.c,v 1.56 2015/07/24 13:02:52 maxv Exp $");
64 64
65#ifdef _KERNEL_OPT 65#ifdef _KERNEL_OPT
66#include "opt_ntp.h" 66#include "opt_ntp.h"
67#endif 67#endif
68 68
69#include <sys/param.h> 69#include <sys/param.h>
70#include <sys/resourcevar.h> 70#include <sys/resourcevar.h>
71#include <sys/systm.h> 71#include <sys/systm.h>
72#include <sys/kernel.h> 72#include <sys/kernel.h>
73#include <sys/proc.h> 73#include <sys/proc.h>
74#include <sys/sysctl.h> 74#include <sys/sysctl.h>
75#include <sys/timex.h> 75#include <sys/timex.h>
76#include <sys/vnode.h> 76#include <sys/vnode.h>
@@ -250,27 +250,27 @@ ntp_gettime(struct ntptimeval *ntv) @@ -250,27 +250,27 @@ ntp_gettime(struct ntptimeval *ntv)
250} 250}
251 251
252/* ARGSUSED */ 252/* ARGSUSED */
253/* 253/*
254 * ntp_adjtime() - NTP daemon application interface 254 * ntp_adjtime() - NTP daemon application interface
255 */ 255 */
256int 256int
257sys_ntp_adjtime(struct lwp *l, const struct sys_ntp_adjtime_args *uap, register_t *retval) 257sys_ntp_adjtime(struct lwp *l, const struct sys_ntp_adjtime_args *uap, register_t *retval)
258{ 258{
259 /* { 259 /* {
260 syscallarg(struct timex *) tp; 260 syscallarg(struct timex *) tp;
261 } */ 261 } */
262 struct timex ntv; 262 struct timex ntv;
263 int error = 0; 263 int error;
264 264
265 error = copyin((void *)SCARG(uap, tp), (void *)&ntv, sizeof(ntv)); 265 error = copyin((void *)SCARG(uap, tp), (void *)&ntv, sizeof(ntv));
266 if (error != 0) 266 if (error != 0)
267 return (error); 267 return (error);
268 268
269 if (ntv.modes != 0 && (error = kauth_authorize_system(l->l_cred, 269 if (ntv.modes != 0 && (error = kauth_authorize_system(l->l_cred,
270 KAUTH_SYSTEM_TIME, KAUTH_REQ_SYSTEM_TIME_NTPADJTIME, NULL, 270 KAUTH_SYSTEM_TIME, KAUTH_REQ_SYSTEM_TIME_NTPADJTIME, NULL,
271 NULL, NULL)) != 0) 271 NULL, NULL)) != 0)
272 return (error); 272 return (error);
273 273
274 ntp_adjtime1(&ntv); 274 ntp_adjtime1(&ntv);
275 275
276 error = copyout((void *)&ntv, (void *)SCARG(uap, tp), sizeof(ntv)); 276 error = copyout((void *)&ntv, (void *)SCARG(uap, tp), sizeof(ntv));

cvs diff -r1.179 -r1.180 src/sys/kern/kern_time.c (expand / switch to unified diff)

--- src/sys/kern/kern_time.c 2013/05/22 16:00:52 1.179
+++ src/sys/kern/kern_time.c 2015/07/24 13:02:52 1.180
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: kern_time.c,v 1.179 2013/05/22 16:00:52 christos Exp $ */ 1/* $NetBSD: kern_time.c,v 1.180 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christopher G. Demetriou, and by Andrew Doran. 8 * by Christopher G. Demetriou, and by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE. 58 * SUCH DAMAGE.
59 * 59 *
60 * @(#)kern_time.c 8.4 (Berkeley) 5/26/95 60 * @(#)kern_time.c 8.4 (Berkeley) 5/26/95
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.179 2013/05/22 16:00:52 christos Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.180 2015/07/24 13:02:52 maxv Exp $");
65 65
66#include <sys/param.h> 66#include <sys/param.h>
67#include <sys/resourcevar.h> 67#include <sys/resourcevar.h>
68#include <sys/kernel.h> 68#include <sys/kernel.h>
69#include <sys/systm.h> 69#include <sys/systm.h>
70#include <sys/proc.h> 70#include <sys/proc.h>
71#include <sys/vnode.h> 71#include <sys/vnode.h>
72#include <sys/signalvar.h> 72#include <sys/signalvar.h>
73#include <sys/syslog.h> 73#include <sys/syslog.h>
74#include <sys/timetc.h> 74#include <sys/timetc.h>
75#include <sys/timex.h> 75#include <sys/timex.h>
76#include <sys/kauth.h> 76#include <sys/kauth.h>
77#include <sys/mount.h> 77#include <sys/mount.h>
@@ -228,27 +228,27 @@ clock_settime1(struct proc *p, clockid_t @@ -228,27 +228,27 @@ clock_settime1(struct proc *p, clockid_t
228 228
229 return 0; 229 return 0;
230} 230}
231 231
232int 232int
233sys___clock_getres50(struct lwp *l, const struct sys___clock_getres50_args *uap, 233sys___clock_getres50(struct lwp *l, const struct sys___clock_getres50_args *uap,
234 register_t *retval) 234 register_t *retval)
235{ 235{
236 /* { 236 /* {
237 syscallarg(clockid_t) clock_id; 237 syscallarg(clockid_t) clock_id;
238 syscallarg(struct timespec *) tp; 238 syscallarg(struct timespec *) tp;
239 } */ 239 } */
240 struct timespec ts; 240 struct timespec ts;
241 int error = 0; 241 int error;
242 242
243 if ((error = clock_getres1(SCARG(uap, clock_id), &ts)) != 0) 243 if ((error = clock_getres1(SCARG(uap, clock_id), &ts)) != 0)
244 return error; 244 return error;
245 245
246 if (SCARG(uap, tp)) 246 if (SCARG(uap, tp))
247 error = copyout(&ts, SCARG(uap, tp), sizeof(ts)); 247 error = copyout(&ts, SCARG(uap, tp), sizeof(ts));
248 248
249 return error; 249 return error;
250} 250}
251 251
252int 252int
253clock_getres1(clockid_t clock_id, struct timespec *ts) 253clock_getres1(clockid_t clock_id, struct timespec *ts)
254{ 254{
@@ -444,27 +444,27 @@ settimeofday1(const struct timeval *utv, @@ -444,27 +444,27 @@ settimeofday1(const struct timeval *utv,
444} 444}
445 445
446int time_adjusted; /* set if an adjustment is made */ 446int time_adjusted; /* set if an adjustment is made */
447 447
448/* ARGSUSED */ 448/* ARGSUSED */
449int 449int
450sys___adjtime50(struct lwp *l, const struct sys___adjtime50_args *uap, 450sys___adjtime50(struct lwp *l, const struct sys___adjtime50_args *uap,
451 register_t *retval) 451 register_t *retval)
452{ 452{
453 /* { 453 /* {
454 syscallarg(const struct timeval *) delta; 454 syscallarg(const struct timeval *) delta;
455 syscallarg(struct timeval *) olddelta; 455 syscallarg(struct timeval *) olddelta;
456 } */ 456 } */
457 int error = 0; 457 int error;
458 struct timeval atv, oldatv; 458 struct timeval atv, oldatv;
459 459
460 if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_TIME, 460 if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_TIME,
461 KAUTH_REQ_SYSTEM_TIME_ADJTIME, NULL, NULL, NULL)) != 0) 461 KAUTH_REQ_SYSTEM_TIME_ADJTIME, NULL, NULL, NULL)) != 0)
462 return error; 462 return error;
463 463
464 if (SCARG(uap, delta)) { 464 if (SCARG(uap, delta)) {
465 error = copyin(SCARG(uap, delta), &atv, 465 error = copyin(SCARG(uap, delta), &atv,
466 sizeof(*SCARG(uap, delta))); 466 sizeof(*SCARG(uap, delta)));
467 if (error) 467 if (error)
468 return (error); 468 return (error);
469 } 469 }
470 adjtime1(SCARG(uap, delta) ? &atv : NULL, 470 adjtime1(SCARG(uap, delta) ? &atv : NULL,

cvs diff -r1.8 -r1.9 src/sys/kern/kern_veriexec.c (expand / switch to unified diff)

--- src/sys/kern/kern_veriexec.c 2015/04/27 20:21:19 1.8
+++ src/sys/kern/kern_veriexec.c 2015/07/24 13:02:52 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: kern_veriexec.c,v 1.8 2015/04/27 20:21:19 riastradh Exp $ */ 1/* $NetBSD: kern_veriexec.c,v 1.9 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2005, 2006 Elad Efrat <elad@NetBSD.org> 4 * Copyright (c) 2005, 2006 Elad Efrat <elad@NetBSD.org>
5 * Copyright (c) 2005, 2006 Brett Lymn <blymn@NetBSD.org> 5 * Copyright (c) 2005, 2006 Brett Lymn <blymn@NetBSD.org>
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 19 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 22 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: kern_veriexec.c,v 1.8 2015/04/27 20:21:19 riastradh Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: kern_veriexec.c,v 1.9 2015/07/24 13:02:52 maxv Exp $");
33 33
34#include "opt_veriexec.h" 34#include "opt_veriexec.h"
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/mount.h> 37#include <sys/mount.h>
38#include <sys/kmem.h> 38#include <sys/kmem.h>
39#include <sys/vnode.h> 39#include <sys/vnode.h>
40#include <sys/namei.h> 40#include <sys/namei.h>
41#include <sys/exec.h> 41#include <sys/exec.h>
42#include <sys/once.h> 42#include <sys/once.h>
43#include <sys/proc.h> 43#include <sys/proc.h>
44#include <sys/rwlock.h> 44#include <sys/rwlock.h>
45#include <sys/syslog.h> 45#include <sys/syslog.h>
@@ -545,27 +545,27 @@ veriexec_fp_cmp(struct veriexec_fpops *o @@ -545,27 +545,27 @@ veriexec_fp_cmp(struct veriexec_fpops *o
545 } 545 }
546 printf("\n"); 546 printf("\n");
547 } 547 }
548 548
549 return (memcmp(fp1, fp2, ops->hash_len)); 549 return (memcmp(fp1, fp2, ops->hash_len));
550} 550}
551 551
552static int 552static int
553veriexec_fp_status(struct lwp *l, struct vnode *vp, int file_lock_state, 553veriexec_fp_status(struct lwp *l, struct vnode *vp, int file_lock_state,
554 struct veriexec_file_entry *vfe, u_char *status) 554 struct veriexec_file_entry *vfe, u_char *status)
555{ 555{
556 size_t hash_len = vfe->ops->hash_len; 556 size_t hash_len = vfe->ops->hash_len;
557 u_char *digest; 557 u_char *digest;
558 int error = 0; 558 int error;
559 559
560 digest = kmem_zalloc(hash_len, KM_SLEEP); 560 digest = kmem_zalloc(hash_len, KM_SLEEP);
561 561
562 error = veriexec_fp_calc(l, vp, file_lock_state, vfe, digest); 562 error = veriexec_fp_calc(l, vp, file_lock_state, vfe, digest);
563 if (error) 563 if (error)
564 goto out; 564 goto out;
565 565
566 /* Compare fingerprint with loaded data. */ 566 /* Compare fingerprint with loaded data. */
567 if (veriexec_fp_cmp(vfe->ops, vfe->fp, digest) == 0) 567 if (veriexec_fp_cmp(vfe->ops, vfe->fp, digest) == 0)
568 *status = FINGERPRINT_VALID; 568 *status = FINGERPRINT_VALID;
569 else 569 else
570 *status = FINGERPRINT_NOMATCH; 570 *status = FINGERPRINT_NOMATCH;
571 571

cvs diff -r1.56 -r1.57 src/sys/kern/sys_lwp.c (expand / switch to unified diff)

--- src/sys/kern/sys_lwp.c 2013/03/29 01:08:17 1.56
+++ src/sys/kern/sys_lwp.c 2015/07/24 13:02:52 1.57
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sys_lwp.c,v 1.56 2013/03/29 01:08:17 christos Exp $ */ 1/* $NetBSD: sys_lwp.c,v 1.57 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Nathan J. Williams, and Andrew Doran. 8 * by Nathan J. Williams, and Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * Lightweight process (LWP) system calls. See kern_lwp.c for a description 33 * Lightweight process (LWP) system calls. See kern_lwp.c for a description
34 * of LWPs. 34 * of LWPs.
35 */ 35 */
36 36
37#include <sys/cdefs.h> 37#include <sys/cdefs.h>
38__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.56 2013/03/29 01:08:17 christos Exp $"); 38__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.57 2015/07/24 13:02:52 maxv Exp $");
39 39
40#include <sys/param.h> 40#include <sys/param.h>
41#include <sys/systm.h> 41#include <sys/systm.h>
42#include <sys/pool.h> 42#include <sys/pool.h>
43#include <sys/proc.h> 43#include <sys/proc.h>
44#include <sys/types.h> 44#include <sys/types.h>
45#include <sys/syscallargs.h> 45#include <sys/syscallargs.h>
46#include <sys/kauth.h> 46#include <sys/kauth.h>
47#include <sys/kmem.h> 47#include <sys/kmem.h>
48#include <sys/sleepq.h> 48#include <sys/sleepq.h>
49#include <sys/lwpctl.h> 49#include <sys/lwpctl.h>
50#include <sys/cpu.h> 50#include <sys/cpu.h>
51 51
@@ -124,27 +124,27 @@ do_lwp_create(lwp_t *l, void *arg, u_lon @@ -124,27 +124,27 @@ do_lwp_create(lwp_t *l, void *arg, u_lon
124 return 0; 124 return 0;
125} 125}
126 126
127int 127int
128sys__lwp_create(struct lwp *l, const struct sys__lwp_create_args *uap, 128sys__lwp_create(struct lwp *l, const struct sys__lwp_create_args *uap,
129 register_t *retval) 129 register_t *retval)
130{ 130{
131 /* { 131 /* {
132 syscallarg(const ucontext_t *) ucp; 132 syscallarg(const ucontext_t *) ucp;
133 syscallarg(u_long) flags; 133 syscallarg(u_long) flags;
134 syscallarg(lwpid_t *) new_lwp; 134 syscallarg(lwpid_t *) new_lwp;
135 } */ 135 } */
136 struct proc *p = l->l_proc; 136 struct proc *p = l->l_proc;
137 ucontext_t *newuc = NULL; 137 ucontext_t *newuc;
138 lwpid_t lid; 138 lwpid_t lid;
139 int error; 139 int error;
140 140
141 newuc = kmem_alloc(sizeof(ucontext_t), KM_SLEEP); 141 newuc = kmem_alloc(sizeof(ucontext_t), KM_SLEEP);
142 error = copyin(SCARG(uap, ucp), newuc, p->p_emul->e_ucsize); 142 error = copyin(SCARG(uap, ucp), newuc, p->p_emul->e_ucsize);
143 if (error) 143 if (error)
144 goto fail; 144 goto fail;
145 145
146 /* validate the ucontext */ 146 /* validate the ucontext */
147 if ((newuc->uc_flags & _UC_CPU) == 0) { 147 if ((newuc->uc_flags & _UC_CPU) == 0) {
148 error = EINVAL; 148 error = EINVAL;
149 goto fail; 149 goto fail;
150 } 150 }

cvs diff -r1.499 -r1.500 src/sys/kern/vfs_syscalls.c (expand / switch to unified diff)

--- src/sys/kern/vfs_syscalls.c 2015/06/12 19:06:32 1.499
+++ src/sys/kern/vfs_syscalls.c 2015/07/24 13:02:52 1.500
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vfs_syscalls.c,v 1.499 2015/06/12 19:06:32 dholland Exp $ */ 1/* $NetBSD: vfs_syscalls.c,v 1.500 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -60,27 +60,27 @@ @@ -60,27 +60,27 @@
60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 60 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 61 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE. 63 * SUCH DAMAGE.
64 * 64 *
65 * @(#)vfs_syscalls.c 8.42 (Berkeley) 7/31/95 65 * @(#)vfs_syscalls.c 8.42 (Berkeley) 7/31/95
66 */ 66 */
67 67
68/* 68/*
69 * Virtual File System System Calls 69 * Virtual File System System Calls
70 */ 70 */
71 71
72#include <sys/cdefs.h> 72#include <sys/cdefs.h>
73__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.499 2015/06/12 19:06:32 dholland Exp $"); 73__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.500 2015/07/24 13:02:52 maxv Exp $");
74 74
75#ifdef _KERNEL_OPT 75#ifdef _KERNEL_OPT
76#include "opt_fileassoc.h" 76#include "opt_fileassoc.h"
77#include "veriexec.h" 77#include "veriexec.h"
78#endif 78#endif
79 79
80#include <sys/param.h> 80#include <sys/param.h>
81#include <sys/systm.h> 81#include <sys/systm.h>
82#include <sys/namei.h> 82#include <sys/namei.h>
83#include <sys/filedesc.h> 83#include <sys/filedesc.h>
84#include <sys/kernel.h> 84#include <sys/kernel.h>
85#include <sys/file.h> 85#include <sys/file.h>
86#include <sys/fcntl.h> 86#include <sys/fcntl.h>
@@ -1940,27 +1940,27 @@ out: @@ -1940,27 +1940,27 @@ out:
1940 * 1940 *
1941 * Check permissions, allocate an open file structure, 1941 * Check permissions, allocate an open file structure,
1942 * and call the device open routine if any. 1942 * and call the device open routine if any.
1943 */ 1943 */
1944 1944
1945int 1945int
1946dofhopen(struct lwp *l, const void *ufhp, size_t fhsize, int oflags, 1946dofhopen(struct lwp *l, const void *ufhp, size_t fhsize, int oflags,
1947 register_t *retval) 1947 register_t *retval)
1948{ 1948{
1949 file_t *fp; 1949 file_t *fp;
1950 struct vnode *vp = NULL; 1950 struct vnode *vp = NULL;
1951 kauth_cred_t cred = l->l_cred; 1951 kauth_cred_t cred = l->l_cred;
1952 file_t *nfp; 1952 file_t *nfp;
1953 int indx, error = 0; 1953 int indx, error;
1954 struct vattr va; 1954 struct vattr va;
1955 fhandle_t *fh; 1955 fhandle_t *fh;
1956 int flags; 1956 int flags;
1957 proc_t *p; 1957 proc_t *p;
1958 1958
1959 p = curproc; 1959 p = curproc;
1960 1960
1961 /* 1961 /*
1962 * Must be super user 1962 * Must be super user
1963 */ 1963 */
1964 if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE, 1964 if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE,
1965 0, NULL, NULL, NULL))) 1965 0, NULL, NULL, NULL)))
1966 return (error); 1966 return (error);

cvs diff -r1.70 -r1.71 src/sys/miscfs/procfs/procfs_linux.c (expand / switch to unified diff)

--- src/sys/miscfs/procfs/procfs_linux.c 2014/08/10 06:22:06 1.70
+++ src/sys/miscfs/procfs/procfs_linux.c 2015/07/24 13:02:52 1.71
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: procfs_linux.c,v 1.70 2014/08/10 06:22:06 matt Exp $ */ 1/* $NetBSD: procfs_linux.c,v 1.71 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Wasabi Systems, Inc. 4 * Copyright (c) 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Frank van der Linden for Wasabi Systems, Inc. 7 * Written by Frank van der Linden for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE. 35 * POSSIBILITY OF SUCH DAMAGE.
36 */ 36 */
37 37
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.70 2014/08/10 06:22:06 matt Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.71 2015/07/24 13:02:52 maxv Exp $");
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <sys/time.h> 43#include <sys/time.h>
44#include <sys/cpu.h> 44#include <sys/cpu.h>
45#include <sys/kernel.h> 45#include <sys/kernel.h>
46#include <sys/proc.h> 46#include <sys/proc.h>
47#include <sys/vnode.h> 47#include <sys/vnode.h>
48#include <sys/exec.h> 48#include <sys/exec.h>
49#include <sys/resource.h> 49#include <sys/resource.h>
50#include <sys/resourcevar.h> 50#include <sys/resourcevar.h>
51#include <sys/signal.h> 51#include <sys/signal.h>
52#include <sys/signalvar.h> 52#include <sys/signalvar.h>
@@ -361,27 +361,26 @@ out: @@ -361,27 +361,26 @@ out:
361 * mountflag is used. 361 * mountflag is used.
362 */ 362 */
363int 363int
364procfs_do_pid_statm(struct lwp *curl, struct lwp *l, 364procfs_do_pid_statm(struct lwp *curl, struct lwp *l,
365 struct pfsnode *pfs, struct uio *uio) 365 struct pfsnode *pfs, struct uio *uio)
366{ 366{
367 struct vmspace *vm; 367 struct vmspace *vm;
368 struct proc *p = l->l_proc; 368 struct proc *p = l->l_proc;
369 struct rusage *ru = &p->p_stats->p_ru; 369 struct rusage *ru = &p->p_stats->p_ru;
370 char *bf; 370 char *bf;
371 int error; 371 int error;
372 int len; 372 int len;
373 373
374 error = ENAMETOOLONG; 
375 bf = malloc(LBFSZ, M_TEMP, M_WAITOK); 374 bf = malloc(LBFSZ, M_TEMP, M_WAITOK);
376 375
377 /* XXX - we use values from vmspace, since dsl says that ru figures 376 /* XXX - we use values from vmspace, since dsl says that ru figures
378 are always 0 except for zombies. See kvm_proc.c::kvm_getproc2() */ 377 are always 0 except for zombies. See kvm_proc.c::kvm_getproc2() */
379 if ((error = proc_vmspace_getref(p, &vm)) != 0) { 378 if ((error = proc_vmspace_getref(p, &vm)) != 0) {
380 goto out; 379 goto out;
381 } 380 }
382 381
383 len = snprintf(bf, LBFSZ, 382 len = snprintf(bf, LBFSZ,
384 "%lu %lu %lu %lu %lu %lu %lu\n", 383 "%lu %lu %lu %lu %lu %lu %lu\n",
385 (unsigned long)(vm->vm_tsize + vm->vm_dsize + vm->vm_ssize), /* size */ 384 (unsigned long)(vm->vm_tsize + vm->vm_dsize + vm->vm_ssize), /* size */
386 (unsigned long)(vm->vm_rssize), /* resident */ 385 (unsigned long)(vm->vm_rssize), /* resident */
387 (unsigned long)(ru->ru_ixrss), /* shared */ 386 (unsigned long)(ru->ru_ixrss), /* shared */
@@ -409,27 +408,27 @@ out: @@ -409,27 +408,27 @@ out:
409 */ 408 */
410int 409int
411procfs_do_pid_stat(struct lwp *curl, struct lwp *l, 410procfs_do_pid_stat(struct lwp *curl, struct lwp *l,
412 struct pfsnode *pfs, struct uio *uio) 411 struct pfsnode *pfs, struct uio *uio)
413{ 412{
414 char *bf; 413 char *bf;
415 struct proc *p = l->l_proc; 414 struct proc *p = l->l_proc;
416 int len; 415 int len;
417 struct rusage *cru = &p->p_stats->p_cru; 416 struct rusage *cru = &p->p_stats->p_cru;
418 unsigned long stext = 0, etext = 0, sstack = 0; 417 unsigned long stext = 0, etext = 0, sstack = 0;
419 struct timeval rt; 418 struct timeval rt;
420 struct vmspace *vm; 419 struct vmspace *vm;
421 struct kinfo_proc2 ki; 420 struct kinfo_proc2 ki;
422 int error = 0; 421 int error;
423 422
424 bf = malloc(LBFSZ, M_TEMP, M_WAITOK); 423 bf = malloc(LBFSZ, M_TEMP, M_WAITOK);
425 424
426 if ((error = proc_vmspace_getref(p, &vm)) != 0) { 425 if ((error = proc_vmspace_getref(p, &vm)) != 0) {
427 goto out; 426 goto out;
428 } 427 }
429 428
430 get_proc_size_info(l, &stext, &etext, &sstack); 429 get_proc_size_info(l, &stext, &etext, &sstack);
431 430
432 mutex_enter(proc_lock); 431 mutex_enter(proc_lock);
433 mutex_enter(p->p_lock); 432 mutex_enter(p->p_lock);
434 433
435 fill_kproc2(p, &ki, false); 434 fill_kproc2(p, &ki, false);

cvs diff -r1.334 -r1.335 src/sys/ufs/ffs/ffs_vfsops.c (expand / switch to unified diff)

--- src/sys/ufs/ffs/ffs_vfsops.c 2015/05/23 16:59:13 1.334
+++ src/sys/ufs/ffs/ffs_vfsops.c 2015/07/24 13:02:52 1.335
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ffs_vfsops.c,v 1.334 2015/05/23 16:59:13 maxv Exp $ */ 1/* $NetBSD: ffs_vfsops.c,v 1.335 2015/07/24 13:02:52 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Wasabi Systems, Inc, and by Andrew Doran. 8 * by Wasabi Systems, Inc, and by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE. 58 * SUCH DAMAGE.
59 * 59 *
60 * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95 60 * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.334 2015/05/23 16:59:13 maxv Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.335 2015/07/24 13:02:52 maxv Exp $");
65 65
66#if defined(_KERNEL_OPT) 66#if defined(_KERNEL_OPT)
67#include "opt_ffs.h" 67#include "opt_ffs.h"
68#include "opt_quota.h" 68#include "opt_quota.h"
69#include "opt_wapbl.h" 69#include "opt_wapbl.h"
70#endif 70#endif
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/systm.h> 73#include <sys/systm.h>
74#include <sys/namei.h> 74#include <sys/namei.h>
75#include <sys/proc.h> 75#include <sys/proc.h>
76#include <sys/kernel.h> 76#include <sys/kernel.h>
77#include <sys/vnode.h> 77#include <sys/vnode.h>
@@ -2259,27 +2259,27 @@ ffs_done(void) @@ -2259,27 +2259,27 @@ ffs_done(void)
2259 pool_cache_destroy(ffs_dinode2_cache); 2259 pool_cache_destroy(ffs_dinode2_cache);
2260 pool_cache_destroy(ffs_dinode1_cache); 2260 pool_cache_destroy(ffs_dinode1_cache);
2261 pool_cache_destroy(ffs_inode_cache); 2261 pool_cache_destroy(ffs_inode_cache);
2262} 2262}
2263 2263
2264/* 2264/*
2265 * Write a superblock and associated information back to disk. 2265 * Write a superblock and associated information back to disk.
2266 */ 2266 */
2267int 2267int
2268ffs_sbupdate(struct ufsmount *mp, int waitfor) 2268ffs_sbupdate(struct ufsmount *mp, int waitfor)
2269{ 2269{
2270 struct fs *fs = mp->um_fs; 2270 struct fs *fs = mp->um_fs;
2271 struct buf *bp; 2271 struct buf *bp;
2272 int error = 0; 2272 int error;
2273 u_int32_t saveflag; 2273 u_int32_t saveflag;
2274 2274
2275 error = ffs_getblk(mp->um_devvp, 2275 error = ffs_getblk(mp->um_devvp,
2276 fs->fs_sblockloc / DEV_BSIZE, FFS_NOBLK, 2276 fs->fs_sblockloc / DEV_BSIZE, FFS_NOBLK,
2277 fs->fs_sbsize, false, &bp); 2277 fs->fs_sbsize, false, &bp);
2278 if (error) 2278 if (error)
2279 return error; 2279 return error;
2280 saveflag = fs->fs_flags & FS_INTERNAL; 2280 saveflag = fs->fs_flags & FS_INTERNAL;
2281 fs->fs_flags &= ~FS_INTERNAL; 2281 fs->fs_flags &= ~FS_INTERNAL;
2282 2282
2283 memcpy(bp->b_data, fs, fs->fs_sbsize); 2283 memcpy(bp->b_data, fs, fs->fs_sbsize);
2284 2284
2285 ffs_oldfscompat_write((struct fs *)bp->b_data, mp); 2285 ffs_oldfscompat_write((struct fs *)bp->b_data, mp);