CVS commit: src/lib/libc/sys

2009-06-28 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Mon Jun 29 06:22:13 UTC 2009

Modified Files:
src/lib/libc/sys: getsockopt.2

Log Message:
add mention of SO_ACCEPTFILTERS, language largely from FreeBSD manpage


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/lib/libc/sys/getsockopt.2

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

Modified files:

Index: src/lib/libc/sys/getsockopt.2
diff -u src/lib/libc/sys/getsockopt.2:1.32 src/lib/libc/sys/getsockopt.2:1.33
--- src/lib/libc/sys/getsockopt.2:1.32	Mon May 18 14:51:55 2009
+++ src/lib/libc/sys/getsockopt.2	Mon Jun 29 06:22:13 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getsockopt.2,v 1.32 2009/05/18 14:51:55 wiz Exp $
+.\"	$NetBSD: getsockopt.2,v 1.33 2009/06/29 06:22:13 plunky Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)getsockopt.2	8.4 (Berkeley) 5/2/95
 .\"
-.Dd December 16, 2007
+.Dd June 28, 2009
 .Dt GETSOCKOPT 2
 .Os
 .Sh NAME
@@ -149,7 +149,7 @@
 .Fn getsockopt
 and set with
 .Fn setsockopt .
-.Bl -column SO_OOBINLINE data -offset indent
+.Bl -column SO_ACCEPTFILTER data -offset indent
 .It Dv SO_DEBUG Ta "enables recording of debugging information"
 .It Dv SO_REUSEADDR Ta "enables local address reuse"
 .It Dv SO_REUSEPORT Ta "enables duplicate address and port bindings"
@@ -165,6 +165,7 @@
 .It Dv SO_SNDTIMEO Ta "set timeout value for output"
 .It Dv SO_RCVTIMEO Ta "set timeout value for input"
 .It Dv SO_TIMESTAMP Ta "enables reception of a timestamp with datagrams"
+.It Dv SO_ACCEPTFILTER Ta "set accept filter on listening socket"
 .It Dv SO_TYPE Ta "get the type of the socket (get only)"
 .It Dv SO_ERROR Ta "get and clear error on the socket (get only)"
 .El
@@ -327,6 +328,45 @@
 cmsg_type = SCM_TIMESTAMP
 .Ed
 .Pp
+.Dv SO_ACCEPTFILTER
+places an
+.Xr accept_filter 9
+on the socket, which will filter incoming connections on a listening
+socket before being presented for
+.Xr accept 2 .
+The
+.Fn setsockopt
+system call will fail if the socket already has a filter set, and
+.Xr listen 2
+must be called on the socket before trying to install a filter.
+The
+.Fa optval
+argument
+should point to a
+.Fa struct accept_filter_arg
+that will select and configure the
+.Xr accept_filter 9 ,
+defined as follows:
+.Bd -literal
+struct  accept_filter_arg {
+charaf_name[16];
+charaf_arg[256-16];
+};
+.Ed
+.Lp
+The
+.Fa af_name
+argument should be filled with the name of the accept filter
+that the application wishes to place on the listening socket.
+The optional argument
+.Fa af_arg
+can be passed to the accept filter specified by
+.Fa af_name
+to provide additional configuration options at attach time.
+Passing in an
+.Fa optval
+of NULL will remove the filter.
+.Pp
 Finally,
 .Dv SO_TYPE
 and
@@ -360,6 +400,11 @@
 this error may also be returned if
 .Fa optlen
 is not in a valid part of the process address space.
+.It Bq Er EINVAL
+The socket
+.Fa s 
+was not suitable for installing an
+.Xr accept_filter 9 .
 .It Bq Er ENOPROTOOPT
 The option is unknown at the level indicated.
 .It Bq Er ENOTSOCK
@@ -385,7 +430,8 @@
 .Xr tcp 4 ,
 .Xr tp 4 ,
 .Xr unix 4 ,
-.Xr protocols 5
+.Xr protocols 5 ,
+.Xr accept_filter 9
 .Sh HISTORY
 The
 .Fn getsockopt



CVS commit: src/share/man/man9

2009-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Jun 29 06:02:09 UTC 2009

Modified Files:
src/share/man/man9: namei.9

Log Message:
Use more markup. Punctuation nit.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/namei.9

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

Modified files:

Index: src/share/man/man9/namei.9
diff -u src/share/man/man9/namei.9:1.20 src/share/man/man9/namei.9:1.21
--- src/share/man/man9/namei.9:1.20	Mon Jun 29 05:49:28 2009
+++ src/share/man/man9/namei.9	Mon Jun 29 06:02:09 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: namei.9,v 1.20 2009/06/29 05:49:28 dholland Exp $
+.\" $NetBSD: namei.9,v 1.21 2009/06/29 06:02:09 wiz Exp $
 .\"
 .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,7 +35,7 @@
 .Nm lookup ,
 .Nm relookup ,
 .Nm NDINIT ,
-.Nm namei_simple_kernel,
+.Nm namei_simple_kernel ,
 .Nm namei_simple_user
 .Nd pathname lookup
 .Sh SYNOPSIS
@@ -155,34 +155,34 @@
 The additional flags are:
 .Pp
 .Bl -tag -offset indent -width NOCROSSMOUNT -compact
-.It NOCROSSMOUNT
+.It Dv NOCROSSMOUNT
 do not cross mount points
-.It RDONLY
+.It Dv RDONLY
 lookup with read-only semantics
-.It HASBUF
+.It Dv HASBUF
 caller has allocated pathname buffer
 .Em ni_cnd.cn_pnbuf
-.It SAVENAME
+.It Dv SAVENAME
 save pathname buffer
-.It SAVESTART
+.It Dv SAVESTART
 save starting directory
-.It ISDOTDOT
+.It Dv ISDOTDOT
 current pathname component is ..
-.It MAKEENTRY
+.It Dv MAKEENTRY
 add entry to the name cache
-.It ISLASTCN
+.It Dv ISLASTCN
 this is last component of pathname
-.It ISSYMLINK
+.It Dv ISSYMLINK
 symlink needs interpretation
-.It ISWHITEOUT
+.It Dv ISWHITEOUT
 found whiteout
-.It DOWHITEOUT
+.It Dv DOWHITEOUT
 do whiteouts
-.It REQUIREDIR
+.It Dv REQUIREDIR
 must be a directory
-.It CREATEDIR
+.It Dv CREATEDIR
 trailing slashes are ok
-.It PARAMASK
+.It Dv PARAMASK
 mask of parameter descriptors
 .El
 .Pp
@@ -195,9 +195,13 @@
 routine or the
 .Fn VOP_ABORT
 routine.
-The SAVESTART flag is set only by the callers of
+The
+.Dv SAVESTART
+flag is set only by the callers of
 .Fn namei .
-It implies SAVENAME plus the addition of saving the parent directory
+It implies
+.Dv SAVENAME
+plus the addition of saving the parent directory
 that contains the name in
 .Em ni_startdir .
 It allows repeated calls to
@@ -224,18 +228,24 @@
 .Em ndp-\*[Gt]segflg
 flags defines whether the name in
 .Em ndp-\*[Gt]ni_dirp
-is an address in kernel space (UIO_SYSSPACE) or an address in user
-space (UIO_USERSPACE).
+is an address in kernel space
+.Pq Dv UIO_SYSSPACE
+or an address in user space
+.Pq Dv UIO_USERSPACE .
 .Pp
 The vnode for the pathname is returned in
 .Em ndp-\*[Gt]ni_vp .
 The parent directory is returned locked in
 .Em ndp-\*[Gt]ni_dvp
-iff LOCKPARENT is specified.
+iff
+.Dv LOCKPARENT
+is specified.
 .Pp
 If
 .Em ndp-\*[Gt]ni_cnd.cn_flags
-has the FOLLOW flag set then symbolic links are followed when they
+has the
+.Dv FOLLOW
+flag set then symbolic links are followed when they
 occur at the end of the name translation process.
 Symbolic links are always followed for all other pathname components
 other than the last.
@@ -256,7 +266,12 @@
 .Fn lookup
 are altered by the operation specified by
 .Em ndp-\*[Gt]ni_cnd.cn_nameiop .
-When CREATE, RENAME, or DELETE is specified, information usable in
+When
+.Dv CREATE ,
+.Dv RENAME ,
+or
+.Dv DELETE
+is specified, information usable in
 creating, renaming, or deleting a directory entry may be calculated.
 .Pp
 If the target of the pathname exists and LOCKLEAF is set, the target
@@ -315,18 +330,24 @@
 .Fa ret .
 The
 .Fa path
-argument must be a kernel (UIO_SYSSPACE) pointer.
+argument must be a kernel
+.Pq Dv UIO_SYSSPACE
+pointer.
 The
 .Fa sflags
 argument chooses the precise behavior.
 It may be set to one of the following symbols:
 .Bl -tag -offset indent -width NSM_NOFOLLOW_TRYEMULROOT -compact
-.It NSM_NOFOLLOW_NOEMULROOT
-.It NSM_NOFOLLOW_TRYEMULROOT
-.It NSM_FOLLOW_NOEMULROOT
-.It NSM_FOLLOW_TRYEMULROOT
+.It Dv NSM_NOFOLLOW_NOEMULROOT
+.It Dv NSM_NOFOLLOW_TRYEMULROOT
+.It Dv NSM_FOLLOW_NOEMULROOT
+.It Dv NSM_FOLLOW_TRYEMULROOT
 .El
-These select (or not) the FOLLOW/NOFOLLOW and TRYEMULROOT flags.
+These select (or not) the
+.Dv FOLLOW/NOFOLLOW
+and
+.Dv TRYEMULROOT
+flags.
 Other flags are not available through this interface, which is
 nonetheless sufficient for more than half the
 .Fn namei
@@ -343,8 +364,9 @@
 .Fn namei_simple_kernel
 except that the
 .Fa path
-argument shall be a user pointer (UIO_USERSPACE) rather than a kernel
-pointer.
+argument shall be a user pointer
+.Pq Dv UIO_USERSPACE
+rather than a kernel pointer.
 .El
 .Sh CODE REFERENCES
 This section describes places within the



CVS commit: src/share/man/man9

2009-06-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jun 29 05:49:28 UTC 2009

Modified Files:
src/share/man/man9: namei.9

Log Message:
Bump date for previous (thanks uebayasi@)


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/share/man/man9/namei.9

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

Modified files:

Index: src/share/man/man9/namei.9
diff -u src/share/man/man9/namei.9:1.19 src/share/man/man9/namei.9:1.20
--- src/share/man/man9/namei.9:1.19	Mon Jun 29 05:17:14 2009
+++ src/share/man/man9/namei.9	Mon Jun 29 05:49:28 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: namei.9,v 1.19 2009/06/29 05:17:14 dholland Exp $
+.\" $NetBSD: namei.9,v 1.20 2009/06/29 05:49:28 dholland Exp $
 .\"
 .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 28, 2007
+.Dd June 29, 2009
 .Dt NAMEI 9
 .Os
 .Sh NAME



CVS commit: src/sys/sys

2009-06-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jun 29 05:47:35 UTC 2009

Modified Files:
src/sys/sys: param.h

Log Message:
Time for 5.99.15: newly compiled fs modules won't work with an older kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.349 -r1.350 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.349 src/sys/sys/param.h:1.350
--- src/sys/sys/param.h:1.349	Fri Jun 19 15:25:16 2009
+++ src/sys/sys/param.h	Mon Jun 29 05:47:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.349 2009/06/19 15:25:16 christos Exp $	*/
+/*	$NetBSD: param.h,v 1.350 2009/06/29 05:47:35 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -63,7 +63,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	599001400	/* NetBSD 5.99.14 */
+#define	__NetBSD_Version__	599001500	/* NetBSD 5.99.15 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/share/man/man9

2009-06-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jun 29 05:17:14 UTC 2009

Modified Files:
src/share/man/man9: namei.9

Log Message:
Document namei_simple_kernel and namei_simple_user.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/namei.9

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

Modified files:

Index: src/share/man/man9/namei.9
diff -u src/share/man/man9/namei.9:1.18 src/share/man/man9/namei.9:1.19
--- src/share/man/man9/namei.9:1.18	Wed Apr 30 13:10:58 2008
+++ src/share/man/man9/namei.9	Mon Jun 29 05:17:14 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: namei.9,v 1.18 2008/04/30 13:10:58 martin Exp $
+.\" $NetBSD: namei.9,v 1.19 2009/06/29 05:17:14 dholland Exp $
 .\"
 .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -34,7 +34,9 @@
 .Nm namei ,
 .Nm lookup ,
 .Nm relookup ,
-.Nm NDINIT
+.Nm NDINIT ,
+.Nm namei_simple_kernel,
+.Nm namei_simple_user
 .Nd pathname lookup
 .Sh SYNOPSIS
 .In sys/namei.h
@@ -50,6 +52,12 @@
 .Ft void
 .Fn NDINIT "struct nameidata *ndp" "u_long op" "u_long flags" \
 "enum uio_seg segflg" "const char *namep"
+.Ft int
+.Fn namei_simple_kernel "const char *path" "namei_simple_flags_t sflags" \
+"struct vnode **ret"
+.Ft int
+.Fn namei_simple_user "const char *path" "namei_simple_flags_t sflags" \
+"struct vnode **ret"
 .Sh DESCRIPTION
 The
 .Nm
@@ -63,7 +71,8 @@
 .Xr vfs 9
 interface was implemented.
 .Pp
-The arguments passed to the functions are encapsulated in the
+Except for the simple forms, the arguments passed to the functions are
+encapsulated in the
 .Em nameidata
 structure.
 It has the following structure:
@@ -299,6 +308,43 @@
 namei operation,
 .Em ndp-\*[Gt]ni_cnd.cn_cred
 must be set manually.
+.It Fn namei_simple_kernel "path" "sflags" "ret"
+Look up the path
+.Fa path
+and translate it to a vnode, returned in
+.Fa ret .
+The
+.Fa path
+argument must be a kernel (UIO_SYSSPACE) pointer.
+The
+.Fa sflags
+argument chooses the precise behavior.
+It may be set to one of the following symbols:
+.Bl -tag -offset indent -width NSM_NOFOLLOW_TRYEMULROOT -compact
+.It NSM_NOFOLLOW_NOEMULROOT
+.It NSM_NOFOLLOW_TRYEMULROOT
+.It NSM_FOLLOW_NOEMULROOT
+.It NSM_FOLLOW_TRYEMULROOT
+.El
+These select (or not) the FOLLOW/NOFOLLOW and TRYEMULROOT flags.
+Other flags are not available through this interface, which is
+nonetheless sufficient for more than half the
+.Fn namei
+usage in the kernel.
+Note that the encoding of
+.Fa sflags
+has deliberately been arranged to be type-incompatible with anything
+else.
+This prevents various possible accidents while the
+.Fn namei
+interface is being rototilled.
+.It Fn namei_simple_user "path" "sflags" "ret"
+This function is the same as
+.Fn namei_simple_kernel
+except that the
+.Fa path
+argument shall be a user pointer (UIO_USERSPACE) rather than a kernel
+pointer.
 .El
 .Sh CODE REFERENCES
 This section describes places within the



CVS commit: src/sys

2009-06-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jun 29 05:03:12 UTC 2009

Modified Files:
src/sys/rump/include/rump: rump_namei.h
src/sys/sys: namei.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/include/rump/rump_namei.h
cvs rdiff -u -r1.64 -r1.65 src/sys/sys/namei.h

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

Modified files:

Index: src/sys/rump/include/rump/rump_namei.h
diff -u src/sys/rump/include/rump/rump_namei.h:1.3 src/sys/rump/include/rump/rump_namei.h:1.4
--- src/sys/rump/include/rump/rump_namei.h:1.3	Wed Feb 11 00:20:18 2009
+++ src/sys/rump/include/rump/rump_namei.h	Mon Jun 29 05:03:12 2009
@@ -1,11 +1,11 @@
-/*	$NetBSD: rump_namei.h,v 1.3 2009/02/11 00:20:18 enami Exp $	*/
+/*	$NetBSD: rump_namei.h,v 1.4 2009/06/29 05:03:12 dholland Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.4 2008/12/03 10:54:27 ad Exp 
- *   from: NetBSD: namei.src,v 1.10 2009/02/11 00:19:11 enami Exp 
+ *   from: NetBSD: namei.src,v 1.11 2009/06/29 05:00:14 dholland Exp 
  */
 
 #ifndef _RUMP_RUMP_NAMEI_H_

Index: src/sys/sys/namei.h
diff -u src/sys/sys/namei.h:1.64 src/sys/sys/namei.h:1.65
--- src/sys/sys/namei.h:1.64	Wed Feb 11 00:20:18 2009
+++ src/sys/sys/namei.h	Mon Jun 29 05:03:12 2009
@@ -1,11 +1,11 @@
-/*	$NetBSD: namei.h,v 1.64 2009/02/11 00:20:18 enami Exp $	*/
+/*	$NetBSD: namei.h,v 1.65 2009/06/29 05:03:12 dholland Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.4 2008/12/03 10:54:27 ad Exp 
- *   from: NetBSD: namei.src,v 1.10 2009/02/11 00:19:11 enami Exp 
+ *   from: NetBSD: namei.src,v 1.11 2009/06/29 05:00:14 dholland Exp 
  */
 
 /*
@@ -204,6 +204,36 @@
 #define	PNBUF_GET()	pool_cache_get(pnbuf_cache, PR_WAITOK)
 #define	PNBUF_PUT(pnb)	pool_cache_put(pnbuf_cache, (pnb))
 
+/*
+ * Typesafe flags for namei_simple.
+ *
+ * This encoding is not optimal but serves the important purpose of
+ * not being type-compatible with the regular namei flags.
+ */
+struct namei_simple_flags_type; /* Opaque. */
+typedef const struct namei_simple_flags_type *namei_simple_flags_t; /* Gross. */
+extern const namei_simple_flags_t
+	NSM_NOFOLLOW_NOEMULROOT,
+	NSM_NOFOLLOW_TRYEMULROOT,
+	NSM_FOLLOW_NOEMULROOT,
+	NSM_FOLLOW_TRYEMULROOT;
+
+/*
+ * namei_simple_* - the simple cases of namei, with no struct
+ *  nameidata involved.
+ *
+ * namei_simple_kernel takes a kernel-space path as the first argument.
+ * namei_simple_user takes a user-space path as the first argument.
+ *
+ * A namei call can be converted to namei_simple_* if:
+ *- the second arg to NDINIT is LOOKUP;
+ *- it does not need the parent vnode, nd.ni_dvp;
+ *- the only flags it uses are (NO)FOLLOW and TRYEMULROOT;
+ *- it does not do anything else gross with the contents of nd.
+ */
+int namei_simple_kernel(const char *, namei_simple_flags_t, struct vnode **);
+int namei_simple_user(const char *, namei_simple_flags_t, struct vnode **);
+
 int	namei(struct nameidata *);
 uint32_t namei_hash(const char *, const char **);
 int	lookup(struct nameidata *);



CVS commit: src/sys

2009-06-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jun 29 05:00:15 UTC 2009

Modified Files:
src/sys/kern: vfs_lookup.c
src/sys/sys: namei.src

Log Message:
Add namei_simple_kernel and namei_simple_user. These provide the common
case functionality of namei in a simple package with only a couple flags.

A substantial majority of the namei call sites in the kernel can use
this interface; this will isolate those areas from the changes arising
as the internals of namei are fumigated.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/namei.src

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

Modified files:

Index: src/sys/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.115 src/sys/kern/vfs_lookup.c:1.116
--- src/sys/kern/vfs_lookup.c:1.115	Fri Jun 26 15:49:03 2009
+++ src/sys/kern/vfs_lookup.c	Mon Jun 29 05:00:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.115 2009/06/26 15:49:03 christos Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.116 2009/06/29 05:00:14 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.115 2009/06/26 15:49:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.116 2009/06/29 05:00:14 dholland Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -1010,3 +1010,76 @@
 	*vpp = NULL;
 	return (error);
 }
+
+/*
+ * namei_simple - simple forms of namei.
+ *
+ * These are wrappers to allow the simple case callers of namei to be
+ * left alone while everything else changes under them.
+ */
+
+/* Flags */
+struct namei_simple_flags_type {
+	int dummy;
+};
+static const struct namei_simple_flags_type ns_nn, ns_nt, ns_fn, ns_ft;
+const namei_simple_flags_t NSM_NOFOLLOW_NOEMULROOT = &ns_nn;
+const namei_simple_flags_t NSM_NOFOLLOW_TRYEMULROOT = &ns_nt;
+const namei_simple_flags_t NSM_FOLLOW_NOEMULROOT = &ns_fn;
+const namei_simple_flags_t NSM_FOLLOW_TRYEMULROOT = &ns_ft;
+
+static
+int
+namei_simple_convert_flags(namei_simple_flags_t sflags)
+{
+	if (sflags == NSM_NOFOLLOW_NOEMULROOT)
+		return NOFOLLOW | 0;
+	if (sflags == NSM_NOFOLLOW_TRYEMULROOT)
+		return NOFOLLOW | TRYEMULROOT;
+	if (sflags == NSM_FOLLOW_NOEMULROOT)
+		return FOLLOW | 0;
+	if (sflags == NSM_FOLLOW_TRYEMULROOT)
+		return FOLLOW | TRYEMULROOT;
+	panic("namei_simple_convert_flags: bogus sflags\n");
+	return 0;
+}
+
+int
+namei_simple_kernel(const char *path, namei_simple_flags_t sflags,
+			struct vnode **vp_ret)
+{
+	struct nameidata nd;
+	int err;
+
+	NDINIT(&nd,
+		LOOKUP,
+		namei_simple_convert_flags(sflags),
+		UIO_SYSSPACE,
+		path);
+	err = namei(&nd);
+	if (err != 0) {
+		return err;
+	}
+	*vp_ret = nd.ni_vp;
+	return 0;
+}
+
+int
+namei_simple_user(const char *path, namei_simple_flags_t sflags,
+			struct vnode **vp_ret)
+{
+	struct nameidata nd;
+	int err;
+
+	NDINIT(&nd,
+		LOOKUP,
+		namei_simple_convert_flags(sflags),
+		UIO_USERSPACE,
+		path);
+	err = namei(&nd);
+	if (err != 0) {
+		return err;
+	}
+	*vp_ret = nd.ni_vp;
+	return 0;
+}

Index: src/sys/sys/namei.src
diff -u src/sys/sys/namei.src:1.10 src/sys/sys/namei.src:1.11
--- src/sys/sys/namei.src:1.10	Wed Feb 11 00:19:11 2009
+++ src/sys/sys/namei.src	Mon Jun 29 05:00:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: namei.src,v 1.10 2009/02/11 00:19:11 enami Exp $	*/
+/*	$NetBSD: namei.src,v 1.11 2009/06/29 05:00:14 dholland Exp $	*/
 
 /*
  * Copyright (c) 1985, 1989, 1991, 1993
@@ -196,6 +196,36 @@
 #define	PNBUF_GET()	pool_cache_get(pnbuf_cache, PR_WAITOK)
 #define	PNBUF_PUT(pnb)	pool_cache_put(pnbuf_cache, (pnb))
 
+/*
+ * Typesafe flags for namei_simple.
+ *
+ * This encoding is not optimal but serves the important purpose of
+ * not being type-compatible with the regular namei flags.
+ */
+struct namei_simple_flags_type; /* Opaque. */
+typedef const struct namei_simple_flags_type *namei_simple_flags_t; /* Gross. */
+extern const namei_simple_flags_t
+	NSM_NOFOLLOW_NOEMULROOT,
+	NSM_NOFOLLOW_TRYEMULROOT,
+	NSM_FOLLOW_NOEMULROOT,
+	NSM_FOLLOW_TRYEMULROOT;
+
+/*
+ * namei_simple_* - the simple cases of namei, with no struct
+ *  nameidata involved.
+ *
+ * namei_simple_kernel takes a kernel-space path as the first argument.
+ * namei_simple_user takes a user-space path as the first argument.
+ *
+ * A namei call can be converted to namei_simple_* if:
+ *- the second arg to NDINIT is LOOKUP;
+ *- it does not need the parent vnode, nd.ni_dvp;
+ *- the only flags it uses are (NO)FOLLOW and TRYEMULROOT;
+ *- it does not do anything else gross with the contents of nd.
+ */
+int namei_simple_kernel(const char *, namei_simple_flags_t, struct vnode **);
+int namei_simple_user(const char *, namei_simple_flags_t, struct vnode **);
+
 int	namei(struct nameidata *);
 uint32_t namei_hash(const char *, const char **);
 int	lookup(struct nameidata *);



CVS commit: src/usr.bin/chflags

2009-06-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jun 29 03:49:42 UTC 2009

Modified Files:
src/usr.bin/chflags: chflags.1

Log Message:
Add some markup to improve clarity.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/chflags/chflags.1

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

Modified files:

Index: src/usr.bin/chflags/chflags.1
diff -u src/usr.bin/chflags/chflags.1:1.17 src/usr.bin/chflags/chflags.1:1.18
--- src/usr.bin/chflags/chflags.1:1.17	Thu Aug  7 11:13:16 2003
+++ src/usr.bin/chflags/chflags.1	Mon Jun 29 03:49:41 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: chflags.1,v 1.17 2003/08/07 11:13:16 agc Exp $
+.\"	$NetBSD: chflags.1,v 1.18 2009/06/29 03:49:41 dholland Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -72,7 +72,11 @@
 option is specified, no symbolic links are followed.
 .It Fl R
 Change the file flags for the file hierarchies rooted
-in the files instead of just the files themselves.
+in the
+.Ar files
+instead of just the
+.Ar files
+themselves.
 .It Fl h
 If the
 .Ar file



CVS commit: src/sys/dev/dm

2009-06-28 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Sun Jun 28 22:05:07 UTC 2009

Modified Files:
src/sys/dev/dm: files.dm

Log Message:
Remove unneeded targets from build. Should fix brekage of ALL kernel build
found by ceg...@.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/dm/files.dm

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

Modified files:

Index: src/sys/dev/dm/files.dm
diff -u src/sys/dev/dm/files.dm:1.4 src/sys/dev/dm/files.dm:1.5
--- src/sys/dev/dm/files.dm:1.4	Fri Jan  2 11:03:24 2009
+++ src/sys/dev/dm/files.dm	Sun Jun 28 22:05:07 2009
@@ -5,9 +5,5 @@
 filedev/dm/dm_pdev.cdm
 filedev/dm/dm_table.c   dm
 filedev/dm/dm_target.c  dm
-filedev/dm/dm_target_error.cdm
 filedev/dm/dm_target_linear.c   dm
-filedev/dm/dm_target_mirror.c   dm
-filedev/dm/dm_target_zero.c dm
-file 	dev/dm/dm_target_snapshot.c dm
 file 	dev/dm/dm_target_stripe.c 	dm



CVS commit: src/games/hunt/huntd

2009-06-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jun 28 21:12:35 UTC 2009

Modified Files:
src/games/hunt/huntd: answer.c draw.c driver.c execute.c faketalk.c
shots.c

Log Message:
sprintf -> snprintf


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/games/hunt/huntd/answer.c
cvs rdiff -u -r1.4 -r1.5 src/games/hunt/huntd/draw.c
cvs rdiff -u -r1.13 -r1.14 src/games/hunt/huntd/driver.c
cvs rdiff -u -r1.5 -r1.6 src/games/hunt/huntd/execute.c
cvs rdiff -u -r1.11 -r1.12 src/games/hunt/huntd/faketalk.c
cvs rdiff -u -r1.6 -r1.7 src/games/hunt/huntd/shots.c

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

Modified files:

Index: src/games/hunt/huntd/answer.c
diff -u src/games/hunt/huntd/answer.c:1.10 src/games/hunt/huntd/answer.c:1.11
--- src/games/hunt/huntd/answer.c:1.10	Sun Jun 28 18:59:37 2009
+++ src/games/hunt/huntd/answer.c	Sun Jun 28 21:12:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: answer.c,v 1.10 2009/06/28 18:59:37 dholland Exp $	*/
+/*	$NetBSD: answer.c,v 1.11 2009/06/28 21:12:35 dholland Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: answer.c,v 1.10 2009/06/28 18:59:37 dholland Exp $");
+__RCSID("$NetBSD: answer.c,v 1.11 2009/06/28 21:12:35 dholland Exp $");
 #endif /* not lint */
 
 # include	
@@ -131,9 +131,10 @@
 		int	n;
 
 		if (team == ' ')
-			(void) sprintf(buf, "%s: ", name);
+			(void) snprintf(buf, sizeof(buf), "%s: ", name);
 		else
-			(void) sprintf(buf, "%s[%c]: ", name, team);
+			(void) snprintf(buf, sizeof(buf), "%s[%c]: ", name,
+	team);
 		n = strlen(buf);
 		for (pp = Player; pp < End_player; pp++) {
 			cgoto(pp, HEIGHT, 0);
@@ -213,7 +214,8 @@
 
 	drawmaze(pp);
 
-	(void) sprintf(Buf, "%5.5s%c%-10.10s %c", " ", stat_char(pp),
+	(void) snprintf(Buf, sizeof(Buf), "%5.5s%c%-10.10s %c", " ",
+		stat_char(pp),
 		pp->p_ident->i_name, pp->p_ident->i_team);
 	line = STAT_MON_ROW + 1 + (pp - Monitor);
 	for (npp = Player; npp < End_player; npp++) {
@@ -317,7 +319,8 @@
 		check(pp, y, x);
 # endif
 
-	(void) sprintf(Buf, "%5.2f%c%-10.10s %c", newpp->p_ident->i_score,
+	(void) snprintf(Buf, sizeof(Buf), "%5.2f%c%-10.10s %c",
+		newpp->p_ident->i_score,
 		stat_char(newpp), newpp->p_ident->i_name,
 		newpp->p_ident->i_team);
 	y = STAT_PLAY_ROW + 1 + (newpp - Player);
@@ -329,7 +332,8 @@
 			newpp->p_ammo += NSHOTS;
 			cgoto(pp, y, STAT_NAME_COL);
 			outstr(pp, Buf, STAT_NAME_LEN);
-			(void) sprintf(smallbuf, "%3d", pp->p_ammo);
+			(void) snprintf(smallbuf, sizeof(smallbuf),
+	"%3d", pp->p_ammo);
 			cgoto(pp, STAT_AMMO_ROW, STAT_VALUE_COL);
 			outstr(pp, smallbuf, 3);
 		}

Index: src/games/hunt/huntd/draw.c
diff -u src/games/hunt/huntd/draw.c:1.4 src/games/hunt/huntd/draw.c:1.5
--- src/games/hunt/huntd/draw.c:1.4	Mon Jan 28 03:23:29 2008
+++ src/games/hunt/huntd/draw.c	Sun Jun 28 21:12:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: draw.c,v 1.4 2008/01/28 03:23:29 dholland Exp $	*/
+/*	$NetBSD: draw.c,v 1.5 2009/06/28 21:12:35 dholland Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: draw.c,v 1.4 2008/01/28 03:23:29 dholland Exp $");
+__RCSID("$NetBSD: draw.c,v 1.5 2009/06/28 21:12:35 dholland Exp $");
 #endif /* not lint */
 
 # include	"hunt.h"
@@ -79,7 +79,7 @@
 
 	cgoto(pp, STAT_AMMO_ROW, STAT_LABEL_COL);
 	outstr(pp, "Ammo:", 5);
-	(void) sprintf(Buf, "%3d", pp->p_ammo);
+	(void) snprintf(Buf, sizeof(Buf), "%3d", pp->p_ammo);
 	cgoto(pp, STAT_AMMO_ROW, STAT_VALUE_COL);
 	outstr(pp, Buf, 3);
 
@@ -90,20 +90,22 @@
 
 	cgoto(pp, STAT_DAM_ROW, STAT_LABEL_COL);
 	outstr(pp, "Damage:", 7);
-	(void) sprintf(Buf, "%2d/%2d", pp->p_damage, pp->p_damcap);
+	(void) snprintf(Buf, sizeof(Buf), "%2d/%2d", pp->p_damage,
+		pp->p_damcap);
 	cgoto(pp, STAT_DAM_ROW, STAT_VALUE_COL);
 	outstr(pp, Buf, 5);
 
 	cgoto(pp, STAT_KILL_ROW, STAT_LABEL_COL);
 	outstr(pp, "Kills:", 6);
-	(void) sprintf(Buf, "%3d", (pp->p_damcap - MAXDAM) / 2);
+	(void) snprintf(Buf, sizeof(Buf), "%3d", (pp->p_damcap - MAXDAM) / 2);
 	cgoto(pp, STAT_KILL_ROW, STAT_VALUE_COL);
 	outstr(pp, Buf, 3);
 
 	cgoto(pp, STAT_PLAY_ROW, STAT_LABEL_COL);
 	outstr(pp, "Player:", 7);
 	for (i = STAT_PLAY_ROW + 1, np = Player; np < End_player; np++) {
-		(void) sprintf(Buf, "%5.2f%c%-10.10s %c", np->p_ident->i_score,
+		(void) snprintf(Buf, sizeof(Buf), "%5.2f%c%-10.10s %c",
+			np->p_ident->i_score,
 			stat_char(np), np->p_ident->i_name,
 			np->p_ident->i_team);
 		cgoto(pp, i++, STAT_NAME_COL);
@@ -114,7 +116,7 @@
 	cgoto(pp, STAT_MON_ROW, STAT_LABEL_COL);
 	outstr(pp, "Monitor:", 8);
 	for (i = STAT_MON_ROW + 1, np = Monitor; np < End_monitor; np++) {
-		(void) sprintf(Buf, "%5.5s %-10.10s %c", " ",
+		(void) snprintf(Buf, sizeof(Buf), "%5.5s %-10.10s %c", " ",
 			np->p_ident->i_nam

CVS commit: src/games/hunt/hunt

2009-06-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jun 28 21:12:10 UTC 2009

Modified Files:
src/games/hunt/hunt: hunt.c

Log Message:
sprintf -> snprintf


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/games/hunt/hunt/hunt.c

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

Modified files:

Index: src/games/hunt/hunt/hunt.c
diff -u src/games/hunt/hunt/hunt.c:1.27 src/games/hunt/hunt/hunt.c:1.28
--- src/games/hunt/hunt/hunt.c:1.27	Fri Aug  8 16:10:47 2008
+++ src/games/hunt/hunt/hunt.c	Sun Jun 28 21:12:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hunt.c,v 1.27 2008/08/08 16:10:47 drochner Exp $	*/
+/*	$NetBSD: hunt.c,v 1.28 2009/06/28 21:12:10 dholland Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: hunt.c,v 1.27 2008/08/08 16:10:47 drochner Exp $");
+__RCSID("$NetBSD: hunt.c,v 1.28 2009/06/28 21:12:10 dholland Exp $");
 #endif /* not lint */
 
 # include	
@@ -610,7 +610,8 @@
 # endif
 			hp = gethostbyaddr((char *) &hosts[i].sin_addr,
 	sizeof hosts[i].sin_addr, AF_INET);
-			(void) sprintf(buf, "%8c%.64s", 'a' + i,
+			(void) snprintf(buf, sizeof(buf),
+"%8c%.64s", 'a' + i,
 hp != NULL ? hp->h_name
 : inet_ntoa(hosts->sin_addr));
 			put_str(buf);



CVS commit: [netbsd-5] src/doc

2009-06-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jun 28 19:55:13 UTC 2009

Modified Files:
src/doc [netbsd-5]: CHANGES-5.1

Log Message:
Ticket 834.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.39 -r1.1.2.40 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.39 src/doc/CHANGES-5.1:1.1.2.40
--- src/doc/CHANGES-5.1:1.1.2.39	Sun Jun 28 02:02:53 2009
+++ src/doc/CHANGES-5.1	Sun Jun 28 19:55:12 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.39 2009/06/28 02:02:53 snj Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.40 2009/06/28 19:55:12 snj Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -1382,3 +1382,9 @@
 	Update Postfix to version 2.5.7.
 	[tron, ticket #831]
 
+games/hunt/huntd/answer.c			1.10
+
+	Fix possible remote DoS of a running hunt game, and prevent
+	a possible theoretical attack involving >= 1 billion ammo.
+	[dholland, ticket #834]
+



CVS commit: [netbsd-5] src/games/hunt/huntd

2009-06-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jun 28 19:54:48 UTC 2009

Modified Files:
src/games/hunt/huntd [netbsd-5]: answer.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #834):
games/hunt/huntd/answer.c: revision 1.10
Fix possible remote DoS of a running hunt game, and prevent a possible
theoretical attack involving >= 1 billion ammo.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.10.1 src/games/hunt/huntd/answer.c

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

Modified files:

Index: src/games/hunt/huntd/answer.c
diff -u src/games/hunt/huntd/answer.c:1.9 src/games/hunt/huntd/answer.c:1.9.10.1
--- src/games/hunt/huntd/answer.c:1.9	Mon Jan 28 03:23:29 2008
+++ src/games/hunt/huntd/answer.c	Sun Jun 28 19:54:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: answer.c,v 1.9 2008/01/28 03:23:29 dholland Exp $	*/
+/*	$NetBSD: answer.c,v 1.9.10.1 2009/06/28 19:54:48 snj Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: answer.c,v 1.9 2008/01/28 03:23:29 dholland Exp $");
+__RCSID("$NetBSD: answer.c,v 1.9.10.1 2009/06/28 19:54:48 snj Exp $");
 #endif /* not lint */
 
 # include	
@@ -102,6 +102,12 @@
 	mode = ntohl(mode);
 
 	/*
+	 * Ensure null termination.
+	 */
+	name[sizeof(name)-1] = '\0';
+	Ttyname[sizeof(Ttyname)-1] = '\0';
+
+	/*
 	 * Turn off blocking I/O, so a slow or dead terminal won't stop
 	 * the game.  All subsequent reads check how many bytes they read.
 	 */
@@ -317,7 +323,7 @@
 	y = STAT_PLAY_ROW + 1 + (newpp - Player);
 	for (pp = Player; pp < End_player; pp++) {
 		if (pp != newpp) {
-			char	smallbuf[10];
+			char	smallbuf[16];
 
 			pp->p_ammo += NSHOTS;
 			newpp->p_ammo += NSHOTS;



CVS commit: [netbsd-5-0] src/doc

2009-06-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jun 28 19:54:18 UTC 2009

Modified Files:
src/doc [netbsd-5-0]: CHANGES-5.0.1

Log Message:
Ticket 834.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.26 -r1.1.2.27 src/doc/CHANGES-5.0.1

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

Modified files:

Index: src/doc/CHANGES-5.0.1
diff -u src/doc/CHANGES-5.0.1:1.1.2.26 src/doc/CHANGES-5.0.1:1.1.2.27
--- src/doc/CHANGES-5.0.1:1.1.2.26	Sun Jun 21 11:44:30 2009
+++ src/doc/CHANGES-5.0.1	Sun Jun 28 19:54:18 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.1,v 1.1.2.26 2009/06/21 11:44:30 bouyer Exp $
+# $NetBSD: CHANGES-5.0.1,v 1.1.2.27 2009/06/28 19:54:18 snj Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.0.1
 release:
@@ -460,3 +460,9 @@
 	Merge pkg_install-20090610 from HEAD
 	[joerg, ticket #815]
 
+games/hunt/huntd/answer.c			1.10
+
+	Fix possible remote DoS of a running hunt game, and prevent
+	a possible theoretical attack involving >= 1 billion ammo.
+	[dholland, ticket #834]
+



CVS commit: [netbsd-5-0] src/games/hunt/huntd

2009-06-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jun 28 19:53:31 UTC 2009

Modified Files:
src/games/hunt/huntd [netbsd-5-0]: answer.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #834):
games/hunt/huntd/answer.c: revision 1.10
Fix possible remote DoS of a running hunt game, and prevent a possible
theoretical attack involving >= 1 billion ammo.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.14.1 src/games/hunt/huntd/answer.c

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

Modified files:

Index: src/games/hunt/huntd/answer.c
diff -u src/games/hunt/huntd/answer.c:1.9 src/games/hunt/huntd/answer.c:1.9.14.1
--- src/games/hunt/huntd/answer.c:1.9	Mon Jan 28 03:23:29 2008
+++ src/games/hunt/huntd/answer.c	Sun Jun 28 19:53:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: answer.c,v 1.9 2008/01/28 03:23:29 dholland Exp $	*/
+/*	$NetBSD: answer.c,v 1.9.14.1 2009/06/28 19:53:30 snj Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: answer.c,v 1.9 2008/01/28 03:23:29 dholland Exp $");
+__RCSID("$NetBSD: answer.c,v 1.9.14.1 2009/06/28 19:53:30 snj Exp $");
 #endif /* not lint */
 
 # include	
@@ -102,6 +102,12 @@
 	mode = ntohl(mode);
 
 	/*
+	 * Ensure null termination.
+	 */
+	name[sizeof(name)-1] = '\0';
+	Ttyname[sizeof(Ttyname)-1] = '\0';
+
+	/*
 	 * Turn off blocking I/O, so a slow or dead terminal won't stop
 	 * the game.  All subsequent reads check how many bytes they read.
 	 */
@@ -317,7 +323,7 @@
 	y = STAT_PLAY_ROW + 1 + (newpp - Player);
 	for (pp = Player; pp < End_player; pp++) {
 		if (pp != newpp) {
-			char	smallbuf[10];
+			char	smallbuf[16];
 
 			pp->p_ammo += NSHOTS;
 			newpp->p_ammo += NSHOTS;



CVS commit: [netbsd-4] src/doc

2009-06-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jun 28 19:52:38 UTC 2009

Modified Files:
src/doc [netbsd-4]: CHANGES-4.1

Log Message:
Ticket 1330.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.159 -r1.1.2.160 src/doc/CHANGES-4.1

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

Modified files:

Index: src/doc/CHANGES-4.1
diff -u src/doc/CHANGES-4.1:1.1.2.159 src/doc/CHANGES-4.1:1.1.2.160
--- src/doc/CHANGES-4.1:1.1.2.159	Sun Jun 21 21:31:32 2009
+++ src/doc/CHANGES-4.1	Sun Jun 28 19:52:37 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.1,v 1.1.2.159 2009/06/21 21:31:32 snj Exp $
+#	$NetBSD: CHANGES-4.1,v 1.1.2.160 2009/06/28 19:52:37 snj Exp $
 
 A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1
 release:
@@ -3495,3 +3495,9 @@
 	Fix CAN-2005-1278, CAN-2005-1279 and CAN-2005-1280.
 	[tonnerre, ticket #1329]
  
+games/hunt/huntd/answer.c			1.10
+
+	Fix possible remote DoS of a running hunt game, and prevent
+	a possible theoretical attack involving >= 1 billion ammo.
+	[dholland, ticket #1330]
+



CVS commit: [netbsd-4] src/games/hunt/huntd

2009-06-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jun 28 19:52:10 UTC 2009

Modified Files:
src/games/hunt/huntd [netbsd-4]: answer.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1330):
games/hunt/huntd/answer.c: revision 1.10
Fix possible remote DoS of a running hunt game, and prevent a possible
theoretical attack involving >= 1 billion ammo.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.4.1 src/games/hunt/huntd/answer.c

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

Modified files:

Index: src/games/hunt/huntd/answer.c
diff -u src/games/hunt/huntd/answer.c:1.8 src/games/hunt/huntd/answer.c:1.8.4.1
--- src/games/hunt/huntd/answer.c:1.8	Tue May  9 20:18:06 2006
+++ src/games/hunt/huntd/answer.c	Sun Jun 28 19:52:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: answer.c,v 1.8 2006/05/09 20:18:06 mrg Exp $	*/
+/*	$NetBSD: answer.c,v 1.8.4.1 2009/06/28 19:52:10 snj Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: answer.c,v 1.8 2006/05/09 20:18:06 mrg Exp $");
+__RCSID("$NetBSD: answer.c,v 1.8.4.1 2009/06/28 19:52:10 snj Exp $");
 #endif /* not lint */
 
 # include	
@@ -102,6 +102,12 @@
 	mode = ntohl(mode);
 
 	/*
+	 * Ensure null termination.
+	 */
+	name[sizeof(name)-1] = '\0';
+	Ttyname[sizeof(Ttyname)-1] = '\0';
+
+	/*
 	 * Turn off blocking I/O, so a slow or dead terminal won't stop
 	 * the game.  All subsequent reads check how many bytes they read.
 	 */
@@ -317,7 +323,7 @@
 	y = STAT_PLAY_ROW + 1 + (newpp - Player);
 	for (pp = Player; pp < End_player; pp++) {
 		if (pp != newpp) {
-			char	smallbuf[10];
+			char	smallbuf[16];
 
 			pp->p_ammo += NSHOTS;
 			newpp->p_ammo += NSHOTS;



CVS commit: [netbsd-4-0] src/doc

2009-06-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jun 28 19:51:34 UTC 2009

Modified Files:
src/doc [netbsd-4-0]: CHANGES-4.0.2

Log Message:
Ticket 1330.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.38 -r1.1.2.39 src/doc/CHANGES-4.0.2

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

Modified files:

Index: src/doc/CHANGES-4.0.2
diff -u src/doc/CHANGES-4.0.2:1.1.2.38 src/doc/CHANGES-4.0.2:1.1.2.39
--- src/doc/CHANGES-4.0.2:1.1.2.38	Sun Jun 21 21:29:04 2009
+++ src/doc/CHANGES-4.0.2	Sun Jun 28 19:51:33 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.0.2,v 1.1.2.38 2009/06/21 21:29:04 snj Exp $
+#	$NetBSD: CHANGES-4.0.2,v 1.1.2.39 2009/06/28 19:51:33 snj Exp $
 
 A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2
 release:
@@ -645,3 +645,9 @@
 	Fix CAN-2005-1278, CAN-2005-1279 and CAN-2005-1280.
 	[tonnerre, ticket #1329]
 
+games/hunt/huntd/answer.c			1.10
+
+	Fix possible remote DoS of a running hunt game, and prevent
+	a possible theoretical attack involving >= 1 billion ammo.
+	[dholland, ticket #1330]
+



CVS commit: [netbsd-4-0] src/games/hunt/huntd

2009-06-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jun 28 19:50:32 UTC 2009

Modified Files:
src/games/hunt/huntd [netbsd-4-0]: answer.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1330):
games/hunt/huntd/answer.c: revision 1.10
Fix possible remote DoS of a running hunt game, and prevent a possible
theoretical attack involving >= 1 billion ammo.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.14.1 src/games/hunt/huntd/answer.c

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

Modified files:

Index: src/games/hunt/huntd/answer.c
diff -u src/games/hunt/huntd/answer.c:1.8 src/games/hunt/huntd/answer.c:1.8.14.1
--- src/games/hunt/huntd/answer.c:1.8	Tue May  9 20:18:06 2006
+++ src/games/hunt/huntd/answer.c	Sun Jun 28 19:50:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: answer.c,v 1.8 2006/05/09 20:18:06 mrg Exp $	*/
+/*	$NetBSD: answer.c,v 1.8.14.1 2009/06/28 19:50:31 snj Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: answer.c,v 1.8 2006/05/09 20:18:06 mrg Exp $");
+__RCSID("$NetBSD: answer.c,v 1.8.14.1 2009/06/28 19:50:31 snj Exp $");
 #endif /* not lint */
 
 # include	
@@ -102,6 +102,12 @@
 	mode = ntohl(mode);
 
 	/*
+	 * Ensure null termination.
+	 */
+	name[sizeof(name)-1] = '\0';
+	Ttyname[sizeof(Ttyname)-1] = '\0';
+
+	/*
 	 * Turn off blocking I/O, so a slow or dead terminal won't stop
 	 * the game.  All subsequent reads check how many bytes they read.
 	 */
@@ -317,7 +323,7 @@
 	y = STAT_PLAY_ROW + 1 + (newpp - Player);
 	for (pp = Player; pp < End_player; pp++) {
 		if (pp != newpp) {
-			char	smallbuf[10];
+			char	smallbuf[16];
 
 			pp->p_ammo += NSHOTS;
 			newpp->p_ammo += NSHOTS;



CVS commit: src/usr.bin/netstat

2009-06-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jun 28 19:02:46 UTC 2009

Modified Files:
src/usr.bin/netstat: netstat.1

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/netstat/netstat.1

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

Modified files:

Index: src/usr.bin/netstat/netstat.1
diff -u src/usr.bin/netstat/netstat.1:1.51 src/usr.bin/netstat/netstat.1:1.52
--- src/usr.bin/netstat/netstat.1:1.51	Thu May 28 14:57:42 2009
+++ src/usr.bin/netstat/netstat.1	Sun Jun 28 19:02:46 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: netstat.1,v 1.51 2009/05/28 14:57:42 christos Exp $
+.\"	$NetBSD: netstat.1,v 1.52 2009/06/28 19:02:46 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1990, 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -290,7 +290,7 @@
 or ``wildcard'', addresses and ports appear as ``*''.
 You can use the
 .Xr fstat 1
-to find out which process or processes hold references to a socket.
+command to find out which process or processes hold references to a socket.
 .Pp
 The interface display provides a table of cumulative
 statistics regarding packets transferred, errors, and collisions.



CVS commit: src/games/hunt/huntd

2009-06-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jun 28 18:59:37 UTC 2009

Modified Files:
src/games/hunt/huntd: answer.c

Log Message:
Fix possible remote DoS of a running hunt game, and prevent a possible
theoretical attack involving >= 1 billion ammo.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/games/hunt/huntd/answer.c

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

Modified files:

Index: src/games/hunt/huntd/answer.c
diff -u src/games/hunt/huntd/answer.c:1.9 src/games/hunt/huntd/answer.c:1.10
--- src/games/hunt/huntd/answer.c:1.9	Mon Jan 28 03:23:29 2008
+++ src/games/hunt/huntd/answer.c	Sun Jun 28 18:59:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: answer.c,v 1.9 2008/01/28 03:23:29 dholland Exp $	*/
+/*	$NetBSD: answer.c,v 1.10 2009/06/28 18:59:37 dholland Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: answer.c,v 1.9 2008/01/28 03:23:29 dholland Exp $");
+__RCSID("$NetBSD: answer.c,v 1.10 2009/06/28 18:59:37 dholland Exp $");
 #endif /* not lint */
 
 # include	
@@ -102,6 +102,12 @@
 	mode = ntohl(mode);
 
 	/*
+	 * Ensure null termination.
+	 */
+	name[sizeof(name)-1] = '\0';
+	Ttyname[sizeof(Ttyname)-1] = '\0';
+
+	/*
 	 * Turn off blocking I/O, so a slow or dead terminal won't stop
 	 * the game.  All subsequent reads check how many bytes they read.
 	 */
@@ -317,7 +323,7 @@
 	y = STAT_PLAY_ROW + 1 + (newpp - Player);
 	for (pp = Player; pp < End_player; pp++) {
 		if (pp != newpp) {
-			char	smallbuf[10];
+			char	smallbuf[16];
 
 			pp->p_ammo += NSHOTS;
 			newpp->p_ammo += NSHOTS;



CVS commit: src/sys/kern

2009-06-28 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Jun 28 15:30:30 UTC 2009

Modified Files:
src/sys/kern: subr_prf.c

Log Message:
panic: use MI cpu_index(), instead of cpu_number(), which could be sparse.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/kern/subr_prf.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/kern/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.135 src/sys/kern/subr_prf.c:1.136
--- src/sys/kern/subr_prf.c:1.135	Sat Jun 20 11:10:40 2009
+++ src/sys/kern/subr_prf.c	Sun Jun 28 15:30:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.135 2009/06/20 11:10:40 cegger Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.136 2009/06/28 15:30:30 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.135 2009/06/20 11:10:40 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.136 2009/06/28 15:30:30 rmind Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipkdb.h"
@@ -279,13 +279,13 @@
 
 		if (intrace == 0) {
 			intrace = 1;
-			printf("cpu%lu: Begin traceback...\n",
-			(u_long)cpu_number());
+			printf("cpu%u: Begin traceback...\n",
+			cpu_index(curcpu()));
 			db_stack_trace_print(
 			(db_expr_t)(intptr_t)__builtin_frame_address(0),
 			true, 65535, "", printf);
-			printf("cpu%lu: End traceback...\n",
-			(u_long)cpu_number());
+			printf("cpu%u: End traceback...\n",
+			cpu_index(curcpu()));
 			intrace = 0;
 		} else
 			printf("Faulted in mid-traceback; aborting...");



CVS commit: src/sys

2009-06-28 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Jun 28 15:18:51 UTC 2009

Modified Files:
src/sys/arch/amd64/amd64: vector.S
src/sys/arch/i386/i386: vector.S
src/sys/arch/x86/include: pmap.h
src/sys/arch/x86/x86: pmap.c
src/sys/kern: kern_synch.c sys_pipe.c
src/sys/sys: lwp.h pipe.h
src/sys/uvm: files.uvm uvm.h uvm_extern.h uvm_glue.c uvm_init.c
Added Files:
src/sys/uvm: uvm_emap.c

Log Message:
Ephemeral mapping (emap) implementation.  Concept is based on the idea that
activity of other threads will perform the TLB flush for the processes using
emap as a side effect.  To track that, global and per-CPU generation numbers
are used.  This idea was suggested by Andrew Doran; various improvements to
it by me.  Notes:

- For now, zero-copy on pipe is not yet enabled.
- TCP socket code would likely need more work.
- Additional UVM loaning improvements are needed.

Proposed on , silence there.
Quickly reviewed by .


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/i386/i386/vector.S
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.264 -r1.265 src/sys/kern/kern_synch.c
cvs rdiff -u -r1.114 -r1.115 src/sys/kern/sys_pipe.c
cvs rdiff -u -r1.119 -r1.120 src/sys/sys/lwp.h
cvs rdiff -u -r1.27 -r1.28 src/sys/sys/pipe.h
cvs rdiff -u -r1.13 -r1.14 src/sys/uvm/files.uvm
cvs rdiff -u -r1.55 -r1.56 src/sys/uvm/uvm.h
cvs rdiff -u -r0 -r1.1 src/sys/uvm/uvm_emap.c
cvs rdiff -u -r1.154 -r1.155 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.137 -r1.138 src/sys/uvm/uvm_glue.c
cvs rdiff -u -r1.34 -r1.35 src/sys/uvm/uvm_init.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/arch/amd64/amd64/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.29 src/sys/arch/amd64/amd64/vector.S:1.30
--- src/sys/arch/amd64/amd64/vector.S:1.29	Tue Nov 25 16:25:29 2008
+++ src/sys/arch/amd64/amd64/vector.S	Sun Jun 28 15:18:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.29 2008/11/25 16:25:29 ad Exp $	*/
+/*	$NetBSD: vector.S,v 1.30 2009/06/28 15:18:50 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -452,8 +452,12 @@
 0:
 	pushq	%rax
 	pushq	%rbx
-	pushq	%rcx
+	pushq	%rdi
+	pushq	%rsi
 	pushq	%rdx
+	pushq	%rcx
+	pushq	%r8
+	pushq	%r9
 	incq	CPUVAR(TLB_EVCNT)+EV_COUNT
 	/* Find out what needs to be invalidated and unlock the mailbox. */
 	movq	CPUVAR(PMAP_CPU),%rcx
@@ -489,8 +493,12 @@
 	movl	$TLBSTATE_STALE, CPUVAR(TLBSTATE)
 3:
 	/* Restore state and return. */
-	popq	%rdx
+	popq	%r9
+	popq	%r8
 	popq	%rcx
+	popq	%rdx
+	popq	%rsi
+	popq	%rdi
 	popq	%rbx
 	popq	%rax
 	testq	$SEL_UPL, 8(%rsp)
@@ -499,9 +507,17 @@
 4:
 	iretq
 5:
-	/* Invalidate all user pages. */
+	/*
+	 * Get the emap generation number.  Invalidate user TLB entries.
+	 * Perform emap update, pass the generation number.  Note that
+	 * caller-save registers might be modified (all saved in the
+	 * beginning).  Only %rbx value is used by 2b context.
+	 */
+	callq	_C_LABEL(uvm_emap_gen_return)
+	movq	%rax, %rdi
 	movq	%cr3, %rax
 	movq	%rax, %cr3
+	callq	_C_LABEL(uvm_emap_update)
 	jmp	2b
 
 /*
@@ -510,12 +526,16 @@
 IDTVEC(intr_lapic_tlb_bcast)
 	/* Save state. */
 	pushq	%rax
-	pushq	%rbx
+	pushq	%rdi
+	pushq	%rsi
 	pushq	%rdx
+	pushq	%rcx
+	pushq	%r8
+	pushq	%r9
 	/* Find out what needs to be invalidated. */
 	movq	_C_LABEL(pmap_mbox)+MB_ADDR1, %rax
 	movq	_C_LABEL(pmap_mbox)+MB_ADDR2, %rdx
-	movq	_C_LABEL(pmap_mbox)+MB_GLOBAL, %rbx
+	movq	_C_LABEL(pmap_mbox)+MB_GLOBAL, %rdi
 	movl	$0, _C_LABEL(local_apic)+LAPIC_EOI
 	cmpq	$-1, %rax
 	je,pn	3f
@@ -529,27 +549,44 @@
 	/* Notify waiter of completion, restore state & return */
 	lock
 	incq	_C_LABEL(pmap_mbox)+MB_TAIL
+	popq	%r9
+	popq	%r8
+	popq	%rcx
 	popq	%rdx
-	popq	%rbx
+	popq	%rsi
+	popq	%rdi
 	popq	%rax
 	iretq
 3:
-	testq	%rbx, %rbx
+	testq	%rdi, %rdi
 	jz	4f
 	/*
-	 * If we have been asked to invalidate the entire TLB
-	 * we arrive here.
+	 * If we have been asked to invalidate the entire TLB we arrive here.
+	 * Get the emap generation before flush, and use it after for update.
+	 * Note that caller-save registers might be modified, though no
+	 * registers need to be preserved for 2b context.
 	 */
+	callq	_C_LABEL(uvm_emap_gen_return)
+	movq	%rax, %rdi
 	movq	%cr4, %rax
 	movq	%rax, %rdx
 	andq	$~CR4_PGE, %rdx
 	movq	%rdx, %cr4
 	movq	%rax, %cr4
+	callq	_C_LABEL(uvm_emap_update)
 	jmp	2b
 4:
-	/* Invalidate user TLB entries. */
+	/*
+	 * Get the emap generation number.  Invalidate user TLB entries.
+	 * Perform emap update, pass the generation number.  Note that
+	 * caller-save registers might be modified, though no registers
+	 * need to be preserved for 2b context.
+	 */
+	callq	_C_LABEL(uvm_emap_gen_return)
+	movq	%rax, %rdi
 	movq	%cr3, %rax
 	mo

CVS commit: src/sys/kern

2009-06-28 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Jun 28 14:34:48 UTC 2009

Modified Files:
src/sys/kern: sys_pipe.c

Log Message:
Amend previous.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/kern/sys_pipe.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/kern/sys_pipe.c
diff -u src/sys/kern/sys_pipe.c:1.113 src/sys/kern/sys_pipe.c:1.114
--- src/sys/kern/sys_pipe.c:1.113	Sun Jun 28 14:22:11 2009
+++ src/sys/kern/sys_pipe.c	Sun Jun 28 14:34:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_pipe.c,v 1.113 2009/06/28 14:22:11 rmind Exp $	*/
+/*	$NetBSD: sys_pipe.c,v 1.114 2009/06/28 14:34:48 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.113 2009/06/28 14:22:11 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.114 2009/06/28 14:34:48 rmind Exp $");
 
 #include 
 #include 
@@ -102,7 +102,7 @@
 static int	pipe_write(file_t *, off_t *, struct uio *, kauth_cred_t, int);
 static int	pipe_close(file_t *);
 static int	pipe_poll(file_t *, int);
-static int	pipe_kqfilter(file_t **, struct knote *);
+static int	pipe_kqfilter(file_t *, struct knote *);
 static int	pipe_stat(file_t *, struct stat *);
 static int	pipe_ioctl(file_t *, u_long, void *);
 



CVS commit: src/sys/kern

2009-06-28 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Jun 28 14:22:11 UTC 2009

Modified Files:
src/sys/kern: sys_pipe.c

Log Message:
- Convert some #ifdefs to KASSERT()s.
- KNF, style, no parameters in function declarations.
- No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/kern/sys_pipe.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/kern/sys_pipe.c
diff -u src/sys/kern/sys_pipe.c:1.112 src/sys/kern/sys_pipe.c:1.113
--- src/sys/kern/sys_pipe.c:1.112	Sat Apr 11 23:05:26 2009
+++ src/sys/kern/sys_pipe.c	Sun Jun 28 14:22:11 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_pipe.c,v 1.112 2009/04/11 23:05:26 christos Exp $	*/
+/*	$NetBSD: sys_pipe.c,v 1.113 2009/06/28 14:22:11 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.112 2009/04/11 23:05:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.113 2009/06/28 14:22:11 rmind Exp $");
 
 #include 
 #include 
@@ -98,18 +98,13 @@
 /* XXX Disabled for now; rare hangs switching between direct/buffered */
 #define PIPE_NODIRECT
 
-/*
- * interfaces to the outside world
- */
-static int pipe_read(struct file *fp, off_t *offset, struct uio *uio,
-		kauth_cred_t cred, int flags);
-static int pipe_write(struct file *fp, off_t *offset, struct uio *uio,
-		kauth_cred_t cred, int flags);
-static int pipe_close(struct file *fp);
-static int pipe_poll(struct file *fp, int events);
-static int pipe_kqfilter(struct file *fp, struct knote *kn);
-static int pipe_stat(struct file *fp, struct stat *sb);
-static int pipe_ioctl(struct file *fp, u_long cmd, void *data);
+static int	pipe_read(file_t *, off_t *, struct uio *, kauth_cred_t, int);
+static int	pipe_write(file_t *, off_t *, struct uio *, kauth_cred_t, int);
+static int	pipe_close(file_t *);
+static int	pipe_poll(file_t *, int);
+static int	pipe_kqfilter(file_t **, struct knote *);
+static int	pipe_stat(file_t *, struct stat *);
+static int	pipe_ioctl(file_t *, u_long, void *);
 
 static const struct fileops pipeops = {
 	.fo_read = pipe_read,
@@ -129,56 +124,55 @@
  * reference for performance reasons, so small amounts of outstanding I/O
  * will not wipe the cache.
  */
-#define MINPIPESIZE (PIPE_SIZE/3)
-#define MAXPIPESIZE (2*PIPE_SIZE/3)
+#define	MINPIPESIZE	(PIPE_SIZE / 3)
+#define	MAXPIPESIZE	(2 * PIPE_SIZE / 3)
 
 /*
  * Maximum amount of kva for pipes -- this is kind-of a soft limit, but
  * is there so that on large systems, we don't exhaust it.
  */
-#define MAXPIPEKVA (8*1024*1024)
-static u_int maxpipekva = MAXPIPEKVA;
+#define	MAXPIPEKVA	(8 * 1024 * 1024)
+static u_int	maxpipekva = MAXPIPEKVA;
 
 /*
  * Limit for direct transfers, we cannot, of course limit
  * the amount of kva for pipes in general though.
  */
-#define LIMITPIPEKVA (16*1024*1024)
-static u_int limitpipekva = LIMITPIPEKVA;
+#define	LIMITPIPEKVA	(16 * 1024 * 1024)
+static u_int	limitpipekva = LIMITPIPEKVA;
 
 /*
  * Limit the number of "big" pipes
  */
-#define LIMITBIGPIPES  32
-static u_int maxbigpipes = LIMITBIGPIPES;
-static u_int nbigpipe = 0;
+#define	LIMITBIGPIPES	32
+static u_int	maxbigpipes = LIMITBIGPIPES;
+static u_int	nbigpipe = 0;
 
 /*
  * Amount of KVA consumed by pipe buffers.
  */
-static u_int amountpipekva = 0;
+static u_int	amountpipekva = 0;
 
-static void pipeclose(struct file *fp, struct pipe *pipe);
-static void pipe_free_kmem(struct pipe *pipe);
-static int pipe_create(struct pipe **pipep, pool_cache_t, kmutex_t *);
-static int pipelock(struct pipe *pipe, int catch);
-static inline void pipeunlock(struct pipe *pipe);
-static void pipeselwakeup(struct pipe *pipe, struct pipe *sigp, int code);
+static void	pipeclose(file_t *, struct pipe *);
+static void	pipe_free_kmem(struct pipe *);
+static int	pipe_create(struct pipe **, pool_cache_t, kmutex_t *);
+static int	pipelock(struct pipe *, int);
+static inline void pipeunlock(struct pipe *);
+static void	pipeselwakeup(struct pipe *, struct pipe *, int);
 #ifndef PIPE_NODIRECT
-static int pipe_direct_write(struct file *fp, struct pipe *wpipe,
-struct uio *uio);
+static int	pipe_direct_write(file_t *, struct pipe *, struct uio *);
 #endif
-static int pipespace(struct pipe *pipe, int size);
-static int pipe_ctor(void *, void *, int);
-static void pipe_dtor(void *, void *);
+static int	pipespace(struct pipe *, int);
+static int	pipe_ctor(void *, void *, int);
+static void	pipe_dtor(void *, void *);
 
 #ifndef PIPE_NODIRECT
-static int pipe_loan_alloc(struct pipe *, int);
-static void pipe_loan_free(struct pipe *);
+static int	pipe_loan_alloc(struct pipe *, int);
+static void	pipe_loan_free(struct pipe *);
 #endif /* PIPE_NODIRECT */
 
-static pool_cache_t pipe_wr_cache;
-static pool_cache_t pipe_rd_cache;
+static pool_cache_t	pipe_wr_cache;
+static pool_cache_t	pipe_rd_cache;
 
 void
 pipe

CVS commit: src/sys/kern

2009-06-28 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sun Jun 28 11:42:43 UTC 2009

Modified Files:
src/sys/kern: kern_exit.c

Log Message:
wrap a long line.


To generate a diff of this commit:
cvs rdiff -u -r1.221 -r1.222 src/sys/kern/kern_exit.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/kern/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.221 src/sys/kern/kern_exit.c:1.222
--- src/sys/kern/kern_exit.c:1.221	Fri May  8 13:32:59 2009
+++ src/sys/kern/kern_exit.c	Sun Jun 28 11:42:43 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exit.c,v 1.221 2009/05/08 13:32:59 yamt Exp $	*/
+/*	$NetBSD: kern_exit.c,v 1.222 2009/06/28 11:42:43 yamt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.221 2009/05/08 13:32:59 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.222 2009/06/28 11:42:43 yamt Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_perfctrs.h"
@@ -504,7 +504,8 @@
 	/* Reload parent pointer, since p may have been reparented above */
 	q = p->p_pptr;
 
-	if (__predict_false((p->p_slflag & PSL_FSTRACE) == 0 && p->p_exitsig != 0)) {
+	if (__predict_false((p->p_slflag & PSL_FSTRACE) == 0 && 
+	p->p_exitsig != 0)) {
 		exit_psignal(p, q, &ksi);
 		kpsignal(q, &ksi, NULL);
 	}



CVS commit: src/sys/kern

2009-06-28 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sun Jun 28 11:42:07 UTC 2009

Modified Files:
src/sys/kern: sys_process.c

Log Message:
wrap a long line.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/kern/sys_process.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/kern/sys_process.c
diff -u src/sys/kern/sys_process.c:1.146 src/sys/kern/sys_process.c:1.147
--- src/sys/kern/sys_process.c:1.146	Wed Feb  4 21:17:39 2009
+++ src/sys/kern/sys_process.c	Sun Jun 28 11:42:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_process.c,v 1.146 2009/02/04 21:17:39 ad Exp $	*/
+/*	$NetBSD: sys_process.c,v 1.147 2009/06/28 11:42:07 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.146 2009/02/04 21:17:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.147 2009/06/28 11:42:07 yamt Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_ktrace.h"
@@ -319,7 +319,8 @@
 		 *	(3) it's not being traced by _you_, or
 		 */
 		if (t->p_pptr != p) {
-			uprintf("parent %d != %d\n", t->p_pptr->p_pid, p->p_pid);
+			uprintf("parent %d != %d\n", t->p_pptr->p_pid,
+			p->p_pid);
 			error = EBUSY;
 			break;
 		}



CVS commit: src/sys/dev/sdmmc

2009-06-28 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Sun Jun 28 11:17:39 UTC 2009

Modified Files:
src/sys/dev/sdmmc: files.sdmmc

Log Message:
Remove trailing whitespace,
from KIYOHARA Takashi on current-users@


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/sdmmc/files.sdmmc

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

Modified files:

Index: src/sys/dev/sdmmc/files.sdmmc
diff -u src/sys/dev/sdmmc/files.sdmmc:1.1 src/sys/dev/sdmmc/files.sdmmc:1.2
--- src/sys/dev/sdmmc/files.sdmmc:1.1	Tue Apr 21 03:00:30 2009
+++ src/sys/dev/sdmmc/files.sdmmc	Sun Jun 28 11:17:39 2009
@@ -1,20 +1,20 @@
-#  $NetBSD: files.sdmmc,v 1.1 2009/04/21 03:00:30 nonaka Exp $
+#  $NetBSD: files.sdmmc,v 1.2 2009/06/28 11:17:39 hubertf Exp $
 #  $OpenBSD: files.sdmmc,v 1.2 2006/06/01 21:53:41 uwe Exp $
 #
 # Config file and device description for machine-independent SD/MMC code.
 # Included by ports that need it.
 
 device sdmmc {}
-attach sdmmc at sdmmcbus 
+attach sdmmc at sdmmcbus
 file	dev/sdmmc/sdmmc.c		sdmmc
 file	dev/sdmmc/sdmmc_cis.c		sdmmc
 file	dev/sdmmc/sdmmc_io.c		sdmmc
-file	dev/sdmmc/sdmmc_mem.c		sdmmc 
+file	dev/sdmmc/sdmmc_mem.c		sdmmc
 
 attach ld at sdmmc with ld_sdmmc
 file	dev/sdmmc/ld_sdmmc.c		ld_sdmmc
 
 # Bluetooth SDIO cards (Type-A/B)
-device sbt: btbus, bluetooth 
-attach sbt at sdmmc 
+device sbt: btbus, bluetooth
+attach sbt at sdmmc
 file	dev/sdmmc/sbt.c			sbt



CVS commit: src/sys/dev/usb

2009-06-28 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sun Jun 28 10:46:37 UTC 2009

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.523 -r1.524 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.524 -r1.525 src/sys/dev/usb/usbdevs_data.h

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

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.523 src/sys/dev/usb/usbdevs.h:1.524
--- src/sys/dev/usb/usbdevs.h:1.523	Fri Jun 19 01:15:02 2009
+++ src/sys/dev/usb/usbdevs.h	Sun Jun 28 10:46:37 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.523 2009/06/19 01:15:02 mrg Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.524 2009/06/28 10:46:37 mbalmer Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.528 2009/06/19 01:14:27 mrg Exp
+ *	NetBSD: usbdevs,v 1.529 2009/06/28 10:45:24 mbalmer Exp
  */
 
 /*
@@ -350,6 +350,7 @@
 #define	USB_VENDOR_KINGSTON	0x0951		/* Kingston Technology */
 #define	USB_VENDOR_BLUEWATER	0x0956		/* BlueWater Systems */
 #define	USB_VENDOR_AGILENT	0x0957		/* Agilent Technologies */
+#define	USB_VENDOR_GUDE	0x0959		/* Gude ADS */
 #define	USB_VENDOR_PORTSMITH	0x095a		/* Portsmith */
 #define	USB_VENDOR_ACERW	0x0967		/* Acer */
 #define	USB_VENDOR_ADIRONDACK	0x0976		/* Adirondack Wire & Cable */
@@ -487,8 +488,9 @@
 #define	USB_VENDOR_AMIT	0x18c5		/* AMIT */
 #define	USB_VENDOR_QCOM	0x18e8		/* Qcom */
 #define	USB_VENDOR_LINKSYS3	0x1915		/* Linksys */
-#define	USB_VENDOR_WINCHIPHEAD2	0x1a86		/* QinHeng Electronics */
+#define	USB_VENDOR_MEINBERG	0x1938		/* Meinberg Funkuhren */
 #define	USB_VENDOR_QUALCOMMINC	0x19d2		/* Qualcomm, Incorporated */
+#define	USB_VENDOR_WINCHIPHEAD2	0x1a86		/* QinHeng Electronics */
 #define	USB_VENDOR_DLINK	0x2001		/* D-Link */
 #define	USB_VENDOR_PLANEX2	0x2019		/* Planex Communications */
 #define	USB_VENDOR_ERICSSON	0x2282		/* Ericsson */
@@ -1148,6 +1150,9 @@
 #define	USB_PRODUCT_GRIFFIN_IMATE	0x0405		/* iMate, ADB adapter */
 #define	USB_PRODUCT_GRIFFIN_POWERMATE	0x0410		/* PowerMate Assignable Controller */
 
+/* Gude ADS */
+#define	USB_PRODUCT_GUDE_DCF	0xdcf7		/* Exper mouseCLOCK USB */
+
 /* Guillemot Corporation */
 #define	USB_PRODUCT_GUILLEMOT_DALEADER	0xa300		/* DA Leader */
 #define	USB_PRODUCT_GUILLEMOT_HWGUSB254	0xe000		/* HWGUSB2-54 WLAN */
@@ -1499,6 +1504,9 @@
 /* MediaGear products */
 #define	USB_PRODUCT_MEDIAGEAR_READER9IN1	0x5003		/* USB2.0 9 in 1 Reader */
 
+/* Meinberg Funkuhren products */
+#define	USB_PRODUCT_MEINBERG_USB5131	0x0301		/* USB 5131 DCF77 - Radio Clock */
+
 /* Melco, Inc products */
 #define	USB_PRODUCT_MELCO_LUATX1	0x0001		/* LUA-TX Ethernet */
 #define	USB_PRODUCT_MELCO_LUATX5	0x0005		/* LUA-TX Ethernet */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.524 src/sys/dev/usb/usbdevs_data.h:1.525
--- src/sys/dev/usb/usbdevs_data.h:1.524	Fri Jun 19 01:15:02 2009
+++ src/sys/dev/usb/usbdevs_data.h	Sun Jun 28 10:46:37 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.524 2009/06/19 01:15:02 mrg Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.525 2009/06/28 10:46:37 mbalmer Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.528 2009/06/19 01:14:27 mrg Exp
+ *	NetBSD: usbdevs,v 1.529 2009/06/28 10:45:24 mbalmer Exp
  */
 
 /*
@@ -1179,6 +1179,10 @@
 	"Agilent Technologies",
 	},
 	{
+	USB_VENDOR_GUDE,
+	"Gude ADS",
+	},
+	{
 	USB_VENDOR_PORTSMITH,
 	"Portsmith",
 	},
@@ -1727,14 +1731,18 @@
 	"Linksys",
 	},
 	{
-	USB_VENDOR_WINCHIPHEAD2,
-	"QinHeng Electronics",
+	USB_VENDOR_MEINBERG,
+	"Meinberg Funkuhren",
 	},
 	{
 	USB_VENDOR_QUALCOMMINC,
 	"Qualcomm, Incorporated",
 	},
 	{
+	USB_VENDOR_WINCHIPHEAD2,
+	"QinHeng Electronics",
+	},
+	{
 	USB_VENDOR_DLINK,
 	"D-Link",
 	},
@@ -1863,7 +1871,7 @@
 	"GNU Radio USRP",
 	},
 };
-const int usb_nvendors = 456;
+const int usb_nvendors = 458;
 
 const struct usb_product usb_products[] = {
 	{
@@ -3419,6 +3427,10 @@
 	"PowerMate Assignable Controller",
 	},
 	{
+	USB_VENDOR_GUDE, USB_PRODUCT_GUDE_DCF,
+	"Exper mouseCLOCK USB",
+	},
+	{
 	USB_VENDOR_GUILLEMOT, USB_PRODUCT_GUILLEMOT_DALEADER,
 	"DA Leader",
 	},
@@ -4415,6 +4427,10 @@
 	"USB2.0 9 in 1 Reader",
 	},
 	{
+	USB_VENDOR_MEINBERG, USB_PRODUCT_MEINBERG_USB5131,
+	"USB 5131 DCF77 - Radio Clock",
+	},
+	{
 	USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUATX1,
 	"LUA-TX Ethernet",
 	},
@@ -6887,4 +6903,4 @@
 	"Prestige",
 	},
 };
-const int usb_nproducts = 1255;
+const int usb_nproducts = 1257;



CVS commit: src/sys/dev/usb

2009-06-28 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sun Jun 28 10:45:24 UTC 2009

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add some vendor/product IDs for radio clocks.


To generate a diff of this commit:
cvs rdiff -u -r1.528 -r1.529 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.528 src/sys/dev/usb/usbdevs:1.529
--- src/sys/dev/usb/usbdevs:1.528	Fri Jun 19 01:14:27 2009
+++ src/sys/dev/usb/usbdevs	Sun Jun 28 10:45:24 2009
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.528 2009/06/19 01:14:27 mrg Exp $
+$NetBSD: usbdevs,v 1.529 2009/06/28 10:45:24 mbalmer Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -343,6 +343,7 @@
 vendor KINGSTON		0x0951	Kingston Technology
 vendor BLUEWATER	0x0956	BlueWater Systems
 vendor AGILENT		0x0957	Agilent Technologies
+vendor GUDE		0x0959	Gude ADS
 vendor PORTSMITH	0x095a	Portsmith
 vendor ACERW		0x0967	Acer
 vendor ADIRONDACK	0x0976	Adirondack Wire & Cable
@@ -480,8 +481,9 @@
 vendor AMIT		0x18c5	AMIT
 vendor QCOM		0x18e8	Qcom
 vendor LINKSYS3		0x1915	Linksys
-vendor WINCHIPHEAD2	0x1a86	QinHeng Electronics
+vendor MEINBERG		0x1938	Meinberg Funkuhren
 vendor QUALCOMMINC	0x19d2	Qualcomm, Incorporated
+vendor WINCHIPHEAD2	0x1a86	QinHeng Electronics
 vendor DLINK		0x2001	D-Link
 vendor PLANEX2		0x2019	Planex Communications
 vendor ERICSSON		0x2282	Ericsson
@@ -1141,6 +1143,9 @@
 product GRIFFIN IMATE		0x0405	iMate, ADB adapter
 product GRIFFIN POWERMATE	0x0410	PowerMate Assignable Controller
 
+/* Gude ADS */
+product	GUDE DCF		0xdcf7	Exper mouseCLOCK USB
+
 /* Guillemot Corporation */
 product GUILLEMOT DALEADER	0xa300	DA Leader
 product GUILLEMOT HWGUSB254	0xe000	HWGUSB2-54 WLAN
@@ -1492,6 +1497,9 @@
 /* MediaGear products */
 product MEDIAGEAR READER9IN1	0x5003	USB2.0 9 in 1 Reader
 
+/* Meinberg Funkuhren products */
+product	MEINBERG USB5131	0x0301	USB 5131 DCF77 - Radio Clock
+
 /* Melco, Inc products */
 product MELCO LUATX1		0x0001	LUA-TX Ethernet
 product MELCO LUATX5		0x0005	LUA-TX Ethernet



CVS commit: src/sys/compat/irix

2009-06-28 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jun 28 09:50:57 UTC 2009

Modified Files:
src/sys/compat/irix: irix_fcntl.c

Log Message:
pad -> PAD, to follow src/sys/kern/makesyscalls.sh rev 1.87.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/compat/irix/irix_fcntl.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/irix/irix_fcntl.c
diff -u src/sys/compat/irix/irix_fcntl.c:1.25 src/sys/compat/irix/irix_fcntl.c:1.26
--- src/sys/compat/irix/irix_fcntl.c:1.25	Mon Apr 28 20:23:41 2008
+++ src/sys/compat/irix/irix_fcntl.c	Sun Jun 28 09:50:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: irix_fcntl.c,v 1.25 2008/04/28 20:23:41 martin Exp $ */
+/*	$NetBSD: irix_fcntl.c,v 1.26 2009/06/28 09:50:57 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.25 2008/04/28 20:23:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.26 2009/06/28 09:50:57 tsutsui Exp $");
 
 #include 
 #include 
@@ -92,7 +92,7 @@
 	SCARG(uap, pad4));
 #endif
 	SCARG(&cup, fd) = SCARG(uap, fd);
-	SCARG(&cup, pad) = 0;
+	SCARG(&cup, PAD) = 0;
 	SCARG(&cup, offset) = SCARG(uap, offset);
 	SCARG(&cup, whence) = SCARG(uap, whence);
 



CVS commit: src/sys/ufs

2009-06-28 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Jun 28 09:26:19 UTC 2009

Modified Files:
src/sys/ufs/ffs: fs.h
src/sys/ufs/ufs: dinode.h

Log Message:
+/*
+ * NOTE: COORDINATE ON-DISK FORMAT CHANGES WITH THE FREEBSD PROJECT.
+ */


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/ufs/ffs/fs.h
cvs rdiff -u -r1.20 -r1.21 src/sys/ufs/ufs/dinode.h

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

Modified files:

Index: src/sys/ufs/ffs/fs.h
diff -u src/sys/ufs/ffs/fs.h:1.53 src/sys/ufs/ffs/fs.h:1.54
--- src/sys/ufs/ffs/fs.h:1.53	Tue May 12 21:01:02 2009
+++ src/sys/ufs/ffs/fs.h	Sun Jun 28 09:26:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fs.h,v 1.53 2009/05/12 21:01:02 ad Exp $	*/
+/*	$NetBSD: fs.h,v 1.54 2009/06/28 09:26:18 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -31,6 +31,10 @@
  *	@(#)fs.h	8.13 (Berkeley) 3/21/95
  */
 
+/*
+ * NOTE: COORDINATE ON-DISK FORMAT CHANGES WITH THE FREEBSD PROJECT.
+ */
+
 #ifndef	_UFS_FFS_FS_H_
 #define	_UFS_FFS_FS_H_
 

Index: src/sys/ufs/ufs/dinode.h
diff -u src/sys/ufs/ufs/dinode.h:1.20 src/sys/ufs/ufs/dinode.h:1.21
--- src/sys/ufs/ufs/dinode.h:1.20	Tue May 12 21:08:23 2009
+++ src/sys/ufs/ufs/dinode.h	Sun Jun 28 09:26:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dinode.h,v 1.20 2009/05/12 21:08:23 ad Exp $	*/
+/*	$NetBSD: dinode.h,v 1.21 2009/06/28 09:26:18 ad Exp $	*/
 
 /*
  * Copyright (c) 2002 Networks Associates Technology, Inc.
@@ -45,6 +45,10 @@
  *	@(#)dinode.h	8.9 (Berkeley) 3/29/95
  */
 
+/*
+ * NOTE: COORDINATE ON-DISK FORMAT CHANGES WITH THE FREEBSD PROJECT.
+ */
+
 #ifndef	_UFS_UFS_DINODE_H_
 #define	_UFS_UFS_DINODE_H_
 



CVS commit: src/sys/kern

2009-06-28 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Jun 28 09:25:05 UTC 2009

Modified Files:
src/sys/kern: kern_idle.c

Log Message:
idle_loop: explicitly go to spl0() to sidestep potential MD bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/kern/kern_idle.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/kern/kern_idle.c
diff -u src/sys/kern/kern_idle.c:1.21 src/sys/kern/kern_idle.c:1.22
--- src/sys/kern/kern_idle.c:1.21	Wed Jun 11 13:42:02 2008
+++ src/sys/kern/kern_idle.c	Sun Jun 28 09:25:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_idle.c,v 1.21 2008/06/11 13:42:02 ad Exp $	*/
+/*	$NetBSD: kern_idle.c,v 1.22 2009/06/28 09:25:05 ad Exp $	*/
 
 /*-
  * Copyright (c)2002, 2006, 2007 YAMAMOTO Takashi,
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.21 2008/06/11 13:42:02 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_idle.c,v 1.22 2009/06/28 09:25:05 ad Exp $");
 
 #include 
 #include 
@@ -48,7 +48,6 @@
 	struct cpu_info *ci = curcpu();
 	struct schedstate_percpu *spc;
 	struct lwp *l = curlwp;
-	int s;
 
 	ci->ci_data.cpu_onproc = l;
 
@@ -57,10 +56,15 @@
 	binuptime(&l->l_stime);
 	lwp_unlock(l);
 
+	/*
+	 * Use spl0() here to ensure that we have the correct interrupt
+	 * priority.  This may be the first thread running on the CPU,
+	 * in which case we took a dirtbag route to get here.
+	 */
 	spc = &ci->ci_schedstate;
-	s = splsched();
+	(void)splsched();
 	spc->spc_flags |= SPCF_RUNNING;
-	splx(s);
+	spl0();
 
 	KERNEL_UNLOCK_ALL(l, NULL);
 	l->l_stat = LSONPROC;



CVS commit: src/sys/arch/i386/include

2009-06-28 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Jun 28 09:24:09 UTC 2009

Modified Files:
src/sys/arch/i386/include: types.h

Log Message:
Define __HAVE_ATOMIC64_OPS only in kernel, since it doesn't work in
userspace on the i486.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/i386/include/types.h

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

Modified files:

Index: src/sys/arch/i386/include/types.h
diff -u src/sys/arch/i386/include/types.h:1.65 src/sys/arch/i386/include/types.h:1.66
--- src/sys/arch/i386/include/types.h:1.65	Sun Apr 19 14:11:37 2009
+++ src/sys/arch/i386/include/types.h	Sun Jun 28 09:24:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.65 2009/04/19 14:11:37 ad Exp $	*/
+/*	$NetBSD: types.h,v 1.66 2009/06/28 09:24:09 ad Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -81,12 +81,12 @@
 #define	__HAVE_SYSCALL_INTERN
 #define	__HAVE_MINIMAL_EMUL
 #define	__HAVE_OLD_DISKLABEL
-#define	__HAVE_ATOMIC64_OPS
 #define	__HAVE_ATOMIC_AS_MEMBAR
 #define	__HAVE_CPU_LWP_SETPRIVATE
 #define	__HAVE_INTR_CONTROL
 
 #if defined(_KERNEL)
+#define	__HAVE_ATOMIC64_OPS		/* not true for i486 in userspace */
 #define	__HAVE_RAS
 #endif