CVS commit: src

2013-12-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Dec  1 09:13:55 UTC 2013

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base

Log Message:
Add a /var/shm directory (to be used for shm_open and friends)


To generate a diff of this commit:
cvs rdiff -u -r1.1050 -r1.1051 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.129 -r1.130 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1050 src/distrib/sets/lists/base/mi:1.1051
--- src/distrib/sets/lists/base/mi:1.1050	Thu Nov 28 13:47:29 2013
+++ src/distrib/sets/lists/base/mi	Sun Dec  1 09:13:55 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1050 2013/11/28 13:47:29 joerg Exp $
+# $NetBSD: mi,v 1.1051 2013/12/01 09:13:55 martin Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -5536,6 +5536,7 @@
 ./var/run/lwresdbase-bind-root
 ./var/run/named	base-bind-root
 ./var/rwho	base-netutil-root
+./var/shm	base-sys-root
 ./var/spool	base-sys-root
 ./var/spool/ftp	base-netutil-root
 ./var/spool/ftp/binbase-netutil-root

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.129 src/etc/mtree/NetBSD.dist.base:1.130
--- src/etc/mtree/NetBSD.dist.base:1.129	Thu Nov 28 14:19:18 2013
+++ src/etc/mtree/NetBSD.dist.base	Sun Dec  1 09:13:54 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.129 2013/11/28 14:19:18 joerg Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.130 2013/12/01 09:13:54 martin Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1317,6 +1317,7 @@
 ./var/run/lwresd		mode=0775 gname=named
 ./var/run/named			mode=0775 gname=named
 ./var/rwho			uname=_rwhod gname=_rwhod
+./var/shm			mode=01777
 ./var/spool
 ./var/spool/ftp
 ./var/spool/ftp/bin



CVS commit: src/external/lgpl3/gmp/dist/mpn/generic

2013-12-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Dec  1 09:29:06 UTC 2013

Modified Files:
src/external/lgpl3/gmp/dist/mpn/generic: div_qr_2.c divrem_2.c
mod_1_1.c mod_1_2.c mod_1_3.c mod_1_4.c

Log Message:
Apply upstream fix for warnings seen on sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/lgpl3/gmp/dist/mpn/generic/div_qr_2.c
cvs rdiff -u -r1.2 -r1.3 src/external/lgpl3/gmp/dist/mpn/generic/divrem_2.c
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/lgpl3/gmp/dist/mpn/generic/mod_1_1.c \
src/external/lgpl3/gmp/dist/mpn/generic/mod_1_2.c \
src/external/lgpl3/gmp/dist/mpn/generic/mod_1_3.c \
src/external/lgpl3/gmp/dist/mpn/generic/mod_1_4.c

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

Modified files:

Index: src/external/lgpl3/gmp/dist/mpn/generic/div_qr_2.c
diff -u src/external/lgpl3/gmp/dist/mpn/generic/div_qr_2.c:1.1.1.1 src/external/lgpl3/gmp/dist/mpn/generic/div_qr_2.c:1.2
--- src/external/lgpl3/gmp/dist/mpn/generic/div_qr_2.c:1.1.1.1	Fri Nov 29 07:49:49 2013
+++ src/external/lgpl3/gmp/dist/mpn/generic/div_qr_2.c	Sun Dec  1 09:29:06 2013
@@ -130,10 +130,11 @@ along with the GNU MP Library.  If not, 
 umul_ppmm (_q1d,_q0, n2, di0);	\
 add_sss (_q3,_q2,_q1, _q2,_q1, _q2a,_q1d);			\
 	\
-add_ss (r1, r0, n3, n2, 0, 1); /* FIXME: combine as in x86_64 asm */ \
+add_ss (r1, r0, n3, n2, CNST_LIMB(0), CNST_LIMB(1));		\
+  /* FIXME: combine as in x86_64 asm */	\
 	\
 /* [q3,q2,q1,q0] += [n3,n3,n1,n0] */\
-add_csaac (_c, _q0, _q0, n0, 0);	\
+add_csaac (_c, _q0, _q0, n0, CNST_LIMB(0));\
 add_csaac (_c, _q1, _q1, n1, _c);	\
 add_csaac (_c, _q2, _q2, r0, _c);	\
 _q3 = _q3 + r1 + _c;		\
@@ -145,14 +146,14 @@ along with the GNU MP Library.  If not, 
 	\
 _mask = -(mp_limb_t) (r1 = _q1  (r1  _q1 | r0 = _q0));  /* (r1,r0) = (q1,q0) */  \
 add_ss (r1, r0, r1, r0, d1  _mask, d0  _mask);		\
-sub_ddmmss (_q3, _q2, _q3, _q2, 0, -_mask);\
+sub_ddmmss (_q3, _q2, _q3, _q2, CNST_LIMB(0), -_mask);		\
 	\
 if (UNLIKELY (r1 = d1))		\
   {	\
 	if (r1  d1 || r0 = d0)	\
 	  {\
 	sub_ddmmss (r1, r0, r1, r0, d1, d0);			\
-	add_ss (_q3, _q2, _q3, _q2, 0, 1);			\
+	add_ss (_q3, _q2, _q3, _q2, CNST_LIMB(0), CNST_LIMB(1));\
 	  }\
   }	\
 (q1) = _q3;\

Index: src/external/lgpl3/gmp/dist/mpn/generic/divrem_2.c
diff -u src/external/lgpl3/gmp/dist/mpn/generic/divrem_2.c:1.2 src/external/lgpl3/gmp/dist/mpn/generic/divrem_2.c:1.3
--- src/external/lgpl3/gmp/dist/mpn/generic/divrem_2.c:1.2	Sat Nov 30 20:30:22 2013
+++ src/external/lgpl3/gmp/dist/mpn/generic/divrem_2.c	Sun Dec  1 09:29:06 2013
@@ -98,7 +98,7 @@ mpn_divrem_2 (mp_ptr qp, mp_size_t qxn,
   for (i = qxn - 1; i = 0; i--)
 	{
 	  mp_limb_t q;
-	  udiv_qr_3by2 (q, r1, r0, r1, r0, 0UL, d1, d0, di.inv32);
+	  udiv_qr_3by2 (q, r1, r0, r1, r0, CNST_LIMB(0), d1, d0, di.inv32);
 	  qp[i] = q;
 	}
 }

Index: src/external/lgpl3/gmp/dist/mpn/generic/mod_1_1.c
diff -u src/external/lgpl3/gmp/dist/mpn/generic/mod_1_1.c:1.1.1.2 src/external/lgpl3/gmp/dist/mpn/generic/mod_1_1.c:1.2
--- src/external/lgpl3/gmp/dist/mpn/generic/mod_1_1.c:1.1.1.2	Fri Nov 29 07:49:49 2013
+++ src/external/lgpl3/gmp/dist/mpn/generic/mod_1_1.c	Sun Dec  1 09:29:06 2013
@@ -160,7 +160,7 @@ mpn_mod_1_1p_cps (mp_limb_t cps[4], mp_l
*   B2modb = - b * bi;
*   ASSERT (B2modb = b);// NB: equality iff b = B/2
*/
-  udiv_rnnd_preinv (B2modb, B1modb, 0, b, bi);
+  udiv_rnnd_preinv (B2modb, B1modb, CNST_LIMB(0), b, bi);
   cps[3] = B2modb  cnt;
 }
 
Index: src/external/lgpl3/gmp/dist/mpn/generic/mod_1_2.c
diff -u src/external/lgpl3/gmp/dist/mpn/generic/mod_1_2.c:1.1.1.2 src/external/lgpl3/gmp/dist/mpn/generic/mod_1_2.c:1.2
--- src/external/lgpl3/gmp/dist/mpn/generic/mod_1_2.c:1.1.1.2	Fri Nov 29 07:49:49 2013
+++ src/external/lgpl3/gmp/dist/mpn/generic/mod_1_2.c	Sun Dec  1 09:29:06 2013
@@ -51,10 +51,10 @@ mpn_mod_1s_2p_cps (mp_limb_t cps[5], mp_
   ASSERT (B1modb = b);		/* NB: not fully reduced mod b */
   cps[2] = B1modb  cnt;
 
-  udiv_rnnd_preinv (B2modb, B1modb, 0, b, bi);
+  udiv_rnnd_preinv (B2modb, B1modb, CNST_LIMB(0), b, bi);
   cps[3] = B2modb  cnt;
 
-  udiv_rnnd_preinv (B3modb, B2modb, 0, b, bi);
+  udiv_rnnd_preinv (B3modb, B2modb, CNST_LIMB(0), b, bi);
   cps[4] = B3modb  cnt;
 
 #if WANT_ASSERT
Index: src/external/lgpl3/gmp/dist/mpn/generic/mod_1_3.c
diff -u src/external/lgpl3/gmp/dist/mpn/generic/mod_1_3.c:1.1.1.2 src/external/lgpl3/gmp/dist/mpn/generic/mod_1_3.c:1.2
--- src/external/lgpl3/gmp/dist/mpn/generic/mod_1_3.c:1.1.1.2	Fri Nov 29 07:49:49 2013
+++ src/external/lgpl3/gmp/dist/mpn/generic/mod_1_3.c	Sun Dec  1 09:29:06 2013
@@ -51,13 +51,13 @@ mpn_mod_1s_3p_cps (mp_limb_t cps[6], mp_
   ASSERT (B1modb = b);		

CVS commit: src/external/lgpl3/gmp/lib/libgmp

2013-12-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Dec  1 09:29:37 UTC 2013

Modified Files:
src/external/lgpl3/gmp/lib/libgmp: Makefile

Log Message:
Enable warnings on sparc64 again


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/lgpl3/gmp/lib/libgmp/Makefile

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

Modified files:

Index: src/external/lgpl3/gmp/lib/libgmp/Makefile
diff -u src/external/lgpl3/gmp/lib/libgmp/Makefile:1.20 src/external/lgpl3/gmp/lib/libgmp/Makefile:1.21
--- src/external/lgpl3/gmp/lib/libgmp/Makefile:1.20	Sat Nov 30 23:45:05 2013
+++ src/external/lgpl3/gmp/lib/libgmp/Makefile	Sun Dec  1 09:29:37 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2013/11/30 23:45:05 wiz Exp $
+#	$NetBSD: Makefile,v 1.21 2013/12/01 09:29:37 martin Exp $
 
 .include bsd.init.mk
 
@@ -240,8 +240,5 @@ COPTS += -Wno-stack-protector
 .if !empty(GMP_MACHINE_ARCH:M*arm*)
 COPTS += -marm
 .endif
-.if ${GMP_MACHINE_ARCH} == sparc64
-NOGCCERROR=yes
-.endif
 
 CWARNFLAGS.clang+=	-Wno-unused-value -Wno-tautological-compare -Wno-parentheses



CVS commit: src/sys

2013-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  1 17:29:40 UTC 2013

Modified Files:
src/sys/kern: vfs_vnode.c
src/sys/sys: vnode.h

Log Message:
Put back the vnode changes I backed out yesterday; they were not the problem.
I've tested them with 2 -j 20 builds on an 8 cpu box. It crashed reliably
with the pcu changes present before.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.242 -r1.243 src/sys/sys/vnode.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/kern/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.28 src/sys/kern/vfs_vnode.c:1.29
--- src/sys/kern/vfs_vnode.c:1.28	Sat Nov 30 19:59:34 2013
+++ src/sys/kern/vfs_vnode.c	Sun Dec  1 12:29:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnode.c,v 1.28 2013/12/01 00:59:34 christos Exp $	*/
+/*	$NetBSD: vfs_vnode.c,v 1.29 2013/12/01 17:29:40 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -116,7 +116,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_vnode.c,v 1.28 2013/12/01 00:59:34 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_vnode.c,v 1.29 2013/12/01 17:29:40 christos Exp $);
 
 #define _VFS_VNODE_PRIVATE
 
@@ -145,6 +145,7 @@ __KERNEL_RCSID(0, $NetBSD: vfs_vnode.c,
 
 /* Flags to vrelel. */
 #define	VRELEL_ASYNC_RELE	0x0001	/* Always defer to vrele thread. */
+#define	VRELEL_CHANGING_SET	0x0002	/* VI_CHANGING set by caller. */
 
 u_int			numvnodes		__cacheline_aligned;
 
@@ -323,8 +324,10 @@ try_nextlist:
 	 * before doing this.
 	 */
 	vp-v_usecount = 1;
+	KASSERT((vp-v_iflag  VI_CHANGING) == 0);
+	vp-v_iflag |= VI_CHANGING;
 	vclean(vp);
-	vrelel(vp, 0);
+	vrelel(vp, VRELEL_CHANGING_SET);
 	fstrans_done(mp);
 
 	return 0;
@@ -476,10 +479,10 @@ vremfree(vnode_t *vp)
  *
  * = Should be called with v_interlock held.
  *
- * If VI_XLOCK is set, the vnode is being eliminated in vgone()/vclean().
+ * If VI_CHANGING is set, the vnode may be eliminated in vgone()/vclean().
  * In that case, we cannot grab the vnode, so the process is awakened when
  * the transition is completed, and an error returned to indicate that the
- * vnode is no longer usable (e.g. changed to a new file system type).
+ * vnode is no longer usable.
  */
 int
 vget(vnode_t *vp, int flags)
@@ -502,31 +505,16 @@ vget(vnode_t *vp, int flags)
 	}
 
 	/*
-	 * If the vnode is in the process of being cleaned out for
-	 * another use, we wait for the cleaning to finish and then
-	 * return failure.  Cleaning is determined by checking if
-	 * the VI_XLOCK flag is set.
+	 * If the vnode is in the process of changing state we wait
+	 * for the change to complete and take care not to return
+	 * a clean vnode.
 	 */
-	if ((vp-v_iflag  VI_XLOCK) != 0) {
+	if ((vp-v_iflag  VI_CHANGING) != 0) {
 		if ((flags  LK_NOWAIT) != 0) {
 			vrelel(vp, 0);
 			return EBUSY;
 		}
-		vwait(vp, VI_XLOCK);
-		vrelel(vp, 0);
-		return ENOENT;
-	}
-
-	if ((vp-v_iflag  VI_INACTNOW) != 0) {
-		/*
-		 * if it's being desactived, wait for it to complete.
-		 * Make sure to not return a clean vnode.
-		 */
-		 if ((flags  LK_NOWAIT) != 0) {
-			vrelel(vp, 0);
-			return EBUSY;
-		}
-		vwait(vp, VI_INACTNOW);
+		vwait(vp, VI_CHANGING);
 		if ((vp-v_iflag  VI_CLEAN) != 0) {
 			vrelel(vp, 0);
 			return ENOENT;
@@ -605,7 +593,11 @@ vrelel(vnode_t *vp, int flags)
 	 * and unlock.
 	 */
 	if (vtryrele(vp)) {
-		vp-v_iflag |= VI_INACTREDO;
+		if ((flags  VRELEL_CHANGING_SET) != 0) {
+			KASSERT((vp-v_iflag  VI_CHANGING) != 0);
+			vp-v_iflag = ~VI_CHANGING;
+			cv_broadcast(vp-v_cv);
+		}
 		mutex_exit(vp-v_interlock);
 		return;
 	}
@@ -626,10 +618,8 @@ vrelel(vnode_t *vp, int flags)
 	 * If not clean, deactivate the vnode, but preserve
 	 * our reference across the call to VOP_INACTIVE().
 	 */
-retry:
 	if ((vp-v_iflag  VI_CLEAN) == 0) {
 		recycle = false;
-		vp-v_iflag |= VI_INACTNOW;
 
 		/*
 		 * XXX This ugly block can be largely eliminated if
@@ -644,11 +634,8 @@ retry:
 			defer = true;
 		} else if (curlwp == vrele_lwp) {
 			/*
-			 * We have to try harder. But we can't sleep
-			 * with VI_INACTNOW as vget() may be waiting on it.
+			 * We have to try harder.
 			 */
-			vp-v_iflag = ~(VI_INACTREDO|VI_INACTNOW);
-			cv_broadcast(vp-v_cv);
 			mutex_exit(vp-v_interlock);
 			error = vn_lock(vp, LK_EXCLUSIVE);
 			if (error != 0) {
@@ -663,11 +650,14 @@ retry:
 			 */
 			if (__predict_false(vtryrele(vp))) {
 VOP_UNLOCK(vp);
+if ((flags  VRELEL_CHANGING_SET) != 0) {
+	KASSERT((vp-v_iflag  VI_CHANGING) != 0);
+	vp-v_iflag = ~VI_CHANGING;
+	cv_broadcast(vp-v_cv);
+}
 mutex_exit(vp-v_interlock);
 return;
 			}
-			vp-v_iflag |= VI_INACTNOW;
-			mutex_exit(vp-v_interlock);
 			defer = false;
 		} else if ((vp-v_iflag  VI_LAYER) != 0) {
 			/* 
@@ -678,15 +668,14 @@ retry:
 			defer = true;
 		} else {
 			/* If we can't acquire the lock, then 

CVS import: src/external/bsd/file/dist

2013-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  1 19:28:21 UTC 2013

Update of /cvsroot/src/external/bsd/file/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv9258

Log Message:
from ftp.astron.com, this is a bug fix release:
   * always leave magic file loaded, don't unload for magic_check, etc.
   * fix default encoding to binary instead of unknown which broke recently
   * handle empty and one byte files, less specially so that
 --mime-encoding does not break completely.
   * fix erroneous non-zero exit code from non-existant file and message
   * add CDF MSI file detection (Guy Helmer)

Status:

Vendor Tag: CHRISTOS
Release Tags:   FILE5_16

U src/external/bsd/file/dist/acinclude.m4
U src/external/bsd/file/dist/README
C src/external/bsd/file/dist/configure.ac
C src/external/bsd/file/dist/aclocal.m4
U src/external/bsd/file/dist/Makefile.am
C src/external/bsd/file/dist/Makefile.in
C src/external/bsd/file/dist/config.h.in
C src/external/bsd/file/dist/configure
U src/external/bsd/file/dist/AUTHORS
U src/external/bsd/file/dist/COPYING
U src/external/bsd/file/dist/ChangeLog
U src/external/bsd/file/dist/INSTALL
U src/external/bsd/file/dist/NEWS
U src/external/bsd/file/dist/TODO
C src/external/bsd/file/dist/compile
U src/external/bsd/file/dist/config.guess
U src/external/bsd/file/dist/config.sub
C src/external/bsd/file/dist/depcomp
C src/external/bsd/file/dist/install-sh
U src/external/bsd/file/dist/ltmain.sh
C src/external/bsd/file/dist/missing
U src/external/bsd/file/dist/MAINT
U src/external/bsd/file/dist/m4/lt~obsolete.m4
U src/external/bsd/file/dist/m4/libtool.m4
U src/external/bsd/file/dist/m4/ltoptions.m4
U src/external/bsd/file/dist/m4/ltsugar.m4
U src/external/bsd/file/dist/m4/ltversion.m4
U src/external/bsd/file/dist/src/Makefile.am
C src/external/bsd/file/dist/src/magic.h
U src/external/bsd/file/dist/src/getopt_long.c
C src/external/bsd/file/dist/src/Makefile.in
U src/external/bsd/file/dist/src/asctime_r.c
U src/external/bsd/file/dist/src/asprintf.c
U src/external/bsd/file/dist/src/ctime_r.c
U src/external/bsd/file/dist/src/getline.c
U src/external/bsd/file/dist/src/strlcat.c
U src/external/bsd/file/dist/src/pread.c
U src/external/bsd/file/dist/src/readelf.h
C src/external/bsd/file/dist/src/file.h
U src/external/bsd/file/dist/src/strlcpy.c
U src/external/bsd/file/dist/src/vasprintf.c
C src/external/bsd/file/dist/src/magic.c
C src/external/bsd/file/dist/src/apprentice.c
C src/external/bsd/file/dist/src/softmagic.c
U src/external/bsd/file/dist/src/ascmagic.c
U src/external/bsd/file/dist/src/encoding.c
C src/external/bsd/file/dist/src/compress.c
U src/external/bsd/file/dist/src/is_tar.c
C src/external/bsd/file/dist/src/readelf.c
U src/external/bsd/file/dist/src/print.c
C src/external/bsd/file/dist/src/fsmagic.c
C src/external/bsd/file/dist/src/funcs.c
U src/external/bsd/file/dist/src/apptype.c
U src/external/bsd/file/dist/src/tar.h
U src/external/bsd/file/dist/src/mygetopt.h
U src/external/bsd/file/dist/src/file_opts.h
U src/external/bsd/file/dist/src/elfclass.h
U src/external/bsd/file/dist/src/cdf.c
U src/external/bsd/file/dist/src/cdf_time.c
C src/external/bsd/file/dist/src/readcdf.c
U src/external/bsd/file/dist/src/cdf.h
U src/external/bsd/file/dist/src/file.c
U src/external/bsd/file/dist/src/magic.h.in
C src/external/bsd/file/dist/magic/Makefile.am
C src/external/bsd/file/dist/magic/Makefile.in
U src/external/bsd/file/dist/magic/Header
U src/external/bsd/file/dist/magic/Localstuff
U src/external/bsd/file/dist/magic/magdir/adventure
U src/external/bsd/file/dist/magic/magdir/acorn
U src/external/bsd/file/dist/magic/magdir/adi
U src/external/bsd/file/dist/magic/magdir/animation
U src/external/bsd/file/dist/magic/magdir/allegro
U src/external/bsd/file/dist/magic/magdir/alliant
U src/external/bsd/file/dist/magic/magdir/amanda
U src/external/bsd/file/dist/magic/magdir/amigaos
N src/external/bsd/file/dist/magic/magdir/android
U src/external/bsd/file/dist/magic/magdir/apple
U src/external/bsd/file/dist/magic/magdir/c64
U src/external/bsd/file/dist/magic/magdir/aout
U src/external/bsd/file/dist/magic/magdir/apl
C src/external/bsd/file/dist/magic/magdir/assembler
U src/external/bsd/file/dist/magic/magdir/applix
U src/external/bsd/file/dist/magic/magdir/archive
U src/external/bsd/file/dist/magic/magdir/communications
U src/external/bsd/file/dist/magic/magdir/asterix
U src/external/bsd/file/dist/magic/magdir/att3b
U src/external/bsd/file/dist/magic/magdir/audio
U src/external/bsd/file/dist/magic/magdir/basis
U src/external/bsd/file/dist/magic/magdir/bflt
U src/external/bsd/file/dist/magic/magdir/blcr
U src/external/bsd/file/dist/magic/magdir/blender
U src/external/bsd/file/dist/magic/magdir/blit
U src/external/bsd/file/dist/magic/magdir/bout
U src/external/bsd/file/dist/magic/magdir/bsdi
U src/external/bsd/file/dist/magic/magdir/bsi
U src/external/bsd/file/dist/magic/magdir/btsnoop
U src/external/bsd/file/dist/magic/magdir/c-lang
U 

CVS commit: src/external/bsd/file/lib

2013-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  1 20:01:14 UTC 2013

Modified Files:
src/external/bsd/file/lib: Makefile

Log Message:
Get version from the configure script


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/file/lib/Makefile

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

Modified files:

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.4 src/external/bsd/file/lib/Makefile:1.5
--- src/external/bsd/file/lib/Makefile:1.4	Tue Aug 13 15:29:45 2013
+++ src/external/bsd/file/lib/Makefile	Sun Dec  1 15:01:14 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2013/08/13 19:29:45 drochner Exp $
+#	$NetBSD: Makefile,v 1.5 2013/12/01 20:01:14 christos Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -33,11 +33,13 @@ MLINKS+=	libmagic.3 magic_open.3 \
 INCS=		magic.h
 INCSDIR=	/usr/include
 
+VERSION != ${TOOL_SED} -ne s/^PACKAGE_VERSION='\([0-9]*\)\.\([0-9]*\)'/\1\2/p  ${DIST}/configure
+
 COPTS.softmagic.c = -Wno-format-nonliteral
 
 magic.c:	magic.h
 magic.h:magic.h.in
-	${TOOL_SED} -e s/X.YY/514/  ${.ALLSRC}  ${.TARGET}
+	${TOOL_SED} -e s/X.YY/${VERSION}/  ${.ALLSRC}  ${.TARGET}
 CLEANFILES+=	magic.h
 
 .include bsd.lib.mk



CVS commit: src/doc

2013-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  1 20:02:43 UTC 2013

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new file(1)


To generate a diff of this commit:
cvs rdiff -u -r1.1073 -r1.1074 src/doc/3RDPARTY
cvs rdiff -u -r1.1864 -r1.1865 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1073 src/doc/3RDPARTY:1.1074
--- src/doc/3RDPARTY:1.1073	Fri Nov 29 13:20:40 2013
+++ src/doc/3RDPARTY	Sun Dec  1 15:02:43 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1073 2013/11/29 18:20:40 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1074 2013/12/01 20:02:43 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -339,8 +339,8 @@ Notes:
 Please use expat as the vendor tag for CVS imports.
 
 Package:	file
-Version:	5.14
-Current Vers:	5.15
+Version:	5.16
+Current Vers:	5.16
 Maintainer:	Christos Zoulas chris...@zoulas.com
 Archive Site:	ftp://ftp.astron.com/pub/file/
 Home Page:	http://www.darwinsys.com/file/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1864 src/doc/CHANGES:1.1865
--- src/doc/CHANGES:1.1864	Fri Nov 29 08:36:42 2013
+++ src/doc/CHANGES	Sun Dec  1 15:02:43 2013
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1864 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1865 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -312,3 +312,4 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 	MPC: Updated to MPC 1.0.1.  [mrg 20131128]
 	MPFR: Updated to MPFR 3.1.2.  [mrg 20131128]
 	GMP: Updated to GMP 5.1.3.  [mrg 20131129]
+	file(1): Updated to 5.16. [christos 20131201]



CVS commit: src/external/bsd/file

2013-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  1 20:15:42 UTC 2013

Modified Files:
src/external/bsd/file: Makefile.inc
src/external/bsd/file/include: config.h
src/external/bsd/file/lib: Makefile

Log Message:
Finish version auto-setting.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/file/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/include/config.h
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/lib/Makefile

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

Modified files:

Index: src/external/bsd/file/Makefile.inc
diff -u src/external/bsd/file/Makefile.inc:1.3 src/external/bsd/file/Makefile.inc:1.4
--- src/external/bsd/file/Makefile.inc:1.3	Fri May  8 19:36:42 2009
+++ src/external/bsd/file/Makefile.inc	Sun Dec  1 15:15:42 2013
@@ -1,7 +1,9 @@
-#	$NetBSD: Makefile.inc,v 1.3 2009/05/08 23:36:42 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.4 2013/12/01 20:15:42 christos Exp $
 
-DIST=${.CURDIR}/../dist
 WARNS=4
+DIST=${NETBSDSRCDIR}/external/bsd/file/dist
+
+.include bsd.own.mk
 
 BINDIR?= /usr/bin
 USE_FORT?= yes	# data-driven bugs?
@@ -12,8 +14,10 @@ MFILESDIR?=	/usr/share/misc
 MFILES?=	magic.mgc
 MAGIC?=		${MFILESDIR}/magic
 
+VERSION != ${TOOL_SED} -ne s/^PACKAGE_VERSION='\([^']*\)'/\1/p ${DIST}/configure
+
 CPPFLAGS+=	-DMAGIC='${MAGIC}' -DHAVE_CONFIG_H -DQUICK -DBUILTIN_ELF \
-		-DELFCORE
+		-DELFCORE -DVERSION='${VERSION}'
 CPPFLAGS+=	-I${.CURDIR}/../include -I${DIST}/src
 
 .PATH:		${DIST}/src ${DIST}/doc

Index: src/external/bsd/file/include/config.h
diff -u src/external/bsd/file/include/config.h:1.5 src/external/bsd/file/include/config.h:1.6
--- src/external/bsd/file/include/config.h:1.5	Sat Mar 23 12:15:59 2013
+++ src/external/bsd/file/include/config.h	Sun Dec  1 15:15:42 2013
@@ -245,7 +245,9 @@
 #define PACKAGE_URL 
 
 /* Define to the version of this package. */
+#if 0
 #define PACKAGE_VERSION 5.14
+#endif
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
@@ -275,8 +277,10 @@
 #endif
 
 
+#if 0
 /* Version number of package */
 #define VERSION 5.14
+#endif
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */

Index: src/external/bsd/file/lib/Makefile
diff -u src/external/bsd/file/lib/Makefile:1.5 src/external/bsd/file/lib/Makefile:1.6
--- src/external/bsd/file/lib/Makefile:1.5	Sun Dec  1 15:01:14 2013
+++ src/external/bsd/file/lib/Makefile	Sun Dec  1 15:15:42 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2013/12/01 20:01:14 christos Exp $
+#	$NetBSD: Makefile,v 1.6 2013/12/01 20:15:42 christos Exp $
 #
 
 USE_FORT?= yes	# data driven bugs?
@@ -33,13 +33,11 @@ MLINKS+=	libmagic.3 magic_open.3 \
 INCS=		magic.h
 INCSDIR=	/usr/include
 
-VERSION != ${TOOL_SED} -ne s/^PACKAGE_VERSION='\([0-9]*\)\.\([0-9]*\)'/\1\2/p  ${DIST}/configure
-
 COPTS.softmagic.c = -Wno-format-nonliteral
 
 magic.c:	magic.h
 magic.h:magic.h.in
-	${TOOL_SED} -e s/X.YY/${VERSION}/  ${.ALLSRC}  ${.TARGET}
+	${TOOL_SED} -e s/X.YY/${VERSION:S/.//g}/  ${.ALLSRC}  ${.TARGET}
 CLEANFILES+=	magic.h
 
 .include bsd.lib.mk



CVS commit: src/external/bsd/nvi/dist

2013-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  1 21:48:33 UTC 2013

Modified Files:
src/external/bsd/nvi/dist/common: screen.c
src/external/bsd/nvi/dist/ex: ex_args.c ex_edit.c ex_tag.c
src/external/bsd/nvi/dist/vi: v_ex.c

Log Message:
Handle more cases where a screen has not been fully initialized (inserted
into the scrq) by calling screen_fini() instead of screen_end() where
appropriate. Pointed out by chuq.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/nvi/dist/common/screen.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/nvi/dist/ex/ex_args.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/nvi/dist/ex/ex_edit.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/nvi/dist/ex/ex_tag.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/nvi/dist/vi/v_ex.c

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

Modified files:

Index: src/external/bsd/nvi/dist/common/screen.c
diff -u src/external/bsd/nvi/dist/common/screen.c:1.5 src/external/bsd/nvi/dist/common/screen.c:1.6
--- src/external/bsd/nvi/dist/common/screen.c:1.5	Sat Nov 30 21:34:54 2013
+++ src/external/bsd/nvi/dist/common/screen.c	Sun Dec  1 16:48:33 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: screen.c,v 1.5 2013/12/01 02:34:54 christos Exp $	*/
+/*	$NetBSD: screen.c,v 1.6 2013/12/01 21:48:33 christos Exp $	*/
 /*-
  * Copyright (c) 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -121,7 +121,7 @@ mem:msgq(orig, M_SYSERR, NULL);
 	*spp = sp;
 	return (0);
 
-err:	screen_end1(sp, 0);
+err:	screen_fini(sp);
 	return (1);
 }
 
@@ -197,9 +197,20 @@ screen_end1(SCR *sp, int init)
 }
 
 /*
+ * screen_fini --
+ *	Release a screen, that has not been chained to the screen queues.
+ *
+ * PUBLIC: int screen_fini __P((SCR *));
+ */
+int
+screen_fini(SCR *sp)
+{
+	return screen_end1(sp, 0);
+}
+
+/*
  * screen_end --
- *	Release a screen, no matter what had (and had not) been
- *	initialized.
+ *	Release a screen, that has been chained to the screen queues.
  *
  * PUBLIC: int screen_end __P((SCR *));
  */
@@ -208,7 +219,6 @@ screen_end(SCR *sp)
 {
 	return screen_end1(sp, 1);
 }
-
 /*
  * screen_next --
  *	Return the next screen in the queue.

Index: src/external/bsd/nvi/dist/ex/ex_args.c
diff -u src/external/bsd/nvi/dist/ex/ex_args.c:1.2 src/external/bsd/nvi/dist/ex/ex_args.c:1.3
--- src/external/bsd/nvi/dist/ex/ex_args.c:1.2	Fri Nov 22 10:52:05 2013
+++ src/external/bsd/nvi/dist/ex/ex_args.c	Sun Dec  1 16:48:33 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ex_args.c,v 1.2 2013/11/22 15:52:05 christos Exp $ */
+/*	$NetBSD: ex_args.c,v 1.3 2013/12/01 21:48:33 christos Exp $ */
 /*-
  * Copyright (c) 1991, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -141,7 +141,7 @@ ex_N_next(SCR *sp, EXCMD *cmdp)
 	if (screen_init(sp-gp, sp, new))
 		return (1);
 	if (vs_split(sp, new, 0)) {
-		(void)screen_end(new);
+		(void)screen_fini(new);
 		return (1);
 	}
 

Index: src/external/bsd/nvi/dist/ex/ex_edit.c
diff -u src/external/bsd/nvi/dist/ex/ex_edit.c:1.5 src/external/bsd/nvi/dist/ex/ex_edit.c:1.6
--- src/external/bsd/nvi/dist/ex/ex_edit.c:1.5	Sat Nov 30 21:34:54 2013
+++ src/external/bsd/nvi/dist/ex/ex_edit.c	Sun Dec  1 16:48:33 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ex_edit.c,v 1.5 2013/12/01 02:34:54 christos Exp $ */
+/*	$NetBSD: ex_edit.c,v 1.6 2013/12/01 21:48:33 christos Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -120,7 +120,7 @@ ex_N_edit(SCR *sp, EXCMD *cmdp, FREF *fr
 		return (1);
 	if ((cmdp-cmd == cmds[C_VSPLIT]  vs_vsplit(sp, new)) ||
 	(cmdp-cmd != cmds[C_VSPLIT]  vs_split(sp, new, 0))) {
-		(void)screen_end(new);
+		(void)screen_fini(new);
 		return (1);
 	}
 

Index: src/external/bsd/nvi/dist/ex/ex_tag.c
diff -u src/external/bsd/nvi/dist/ex/ex_tag.c:1.9 src/external/bsd/nvi/dist/ex/ex_tag.c:1.10
--- src/external/bsd/nvi/dist/ex/ex_tag.c:1.9	Sat Nov 30 21:34:54 2013
+++ src/external/bsd/nvi/dist/ex/ex_tag.c	Sun Dec  1 16:48:33 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ex_tag.c,v 1.9 2013/12/01 02:34:54 christos Exp $ */
+/*	$NetBSD: ex_tag.c,v 1.10 2013/12/01 21:48:33 christos Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -302,7 +302,7 @@ ex_tag_Nswitch(SCR *sp, TAG *tp, int for
 		return (1);
 	if (vs_split(sp, new, 0)) {
 		(void)file_end(new, new-ep, 1);
-		(void)screen_end(new);
+		(void)screen_fini(new);
 		return (1);
 	}
 

Index: src/external/bsd/nvi/dist/vi/v_ex.c
diff -u src/external/bsd/nvi/dist/vi/v_ex.c:1.5 src/external/bsd/nvi/dist/vi/v_ex.c:1.6
--- src/external/bsd/nvi/dist/vi/v_ex.c:1.5	Sat Nov 30 21:34:54 2013
+++ src/external/bsd/nvi/dist/vi/v_ex.c	Sun Dec  1 16:48:33 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: v_ex.c,v 1.5 2013/12/01 02:34:54 christos Exp $ */
+/*	$NetBSD: v_ex.c,v 1.6 2013/12/01 21:48:33 christos Exp $ */
 /*-
  

CVS commit: src

2013-12-01 Thread Lourival Pereira Vieira Neto
Module Name:src
Committed By:   lneto
Date:   Mon Dec  2 04:39:10 UTC 2013

Modified Files:
src/lib/libc/stdlib: Makefile.inc
src/sys/lib/libkern: Makefile.libkern libkern.h
src/sys/modules/lua: Makefile luaconf.h
Added Files:
src/common/lib/libc/stdlib: strtoimax.c
Removed Files:
src/lib/libc/stdlib: strtoimax.c

Log Message:
changed lua_Number to int64_t


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/common/lib/libc/stdlib/strtoimax.c
cvs rdiff -u -r1.79 -r1.80 src/lib/libc/stdlib/Makefile.inc
cvs rdiff -u -r1.8 -r0 src/lib/libc/stdlib/strtoimax.c
cvs rdiff -u -r1.26 -r1.27 src/sys/lib/libkern/Makefile.libkern
cvs rdiff -u -r1.108 -r1.109 src/sys/lib/libkern/libkern.h
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/lua/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/lua/luaconf.h

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/stdlib/Makefile.inc
diff -u src/lib/libc/stdlib/Makefile.inc:1.79 src/lib/libc/stdlib/Makefile.inc:1.80
--- src/lib/libc/stdlib/Makefile.inc:1.79	Fri Apr 26 18:29:55 2013
+++ src/lib/libc/stdlib/Makefile.inc	Mon Dec  2 04:39:10 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.79 2013/04/26 18:29:55 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.80 2013/12/02 04:39:10 lneto Exp $
 #	from: @(#)Makefile.inc	8.3 (Berkeley) 2/4/95
 
 # stdlib sources
@@ -30,7 +30,6 @@ SRCS+=	jemalloc.c
 SRCS+=	malloc.c
 .endif
 
-CPPFLAGS.strtoimax.c+=	-I${LIBCDIR}/../../common/lib/libc/stdlib
 CPPFLAGS.strtol.c+=	-I${LIBCDIR}/../../common/lib/libc/stdlib
 CPPFLAGS.strtoq.c+=	-I${LIBCDIR}/../../common/lib/libc/stdlib
 CPPFLAGS.strtouq.c+=	-I${LIBCDIR}/../../common/lib/libc/stdlib

Index: src/sys/lib/libkern/Makefile.libkern
diff -u src/sys/lib/libkern/Makefile.libkern:1.26 src/sys/lib/libkern/Makefile.libkern:1.27
--- src/sys/lib/libkern/Makefile.libkern:1.26	Tue Jul 23 14:52:07 2013
+++ src/sys/lib/libkern/Makefile.libkern	Mon Dec  2 04:39:10 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.libkern,v 1.26 2013/07/23 14:52:07 skrll Exp $
+#	$NetBSD: Makefile.libkern,v 1.27 2013/12/02 04:39:10 lneto Exp $
 
 # 
 # Variable definitions for libkern.  
@@ -80,7 +80,7 @@ SRCS+=	memset.c 
 .endif
 
 SRCS+=	popcount32.c popcount64.c
-SRCS+=	strtoul.c strtoll.c strtoull.c strtoumax.c
+SRCS+=	strtoul.c strtoll.c strtoull.c strtoimax.c strtoumax.c
 
 SRCS+=	scanc.c skpc.c
 SRCS+=	random.c

Index: src/sys/lib/libkern/libkern.h
diff -u src/sys/lib/libkern/libkern.h:1.108 src/sys/lib/libkern/libkern.h:1.109
--- src/sys/lib/libkern/libkern.h:1.108	Wed Aug 28 16:20:38 2013
+++ src/sys/lib/libkern/libkern.h	Mon Dec  2 04:39:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: libkern.h,v 1.108 2013/08/28 16:20:38 riastradh Exp $	*/
+/*	$NetBSD: libkern.h,v 1.109 2013/12/02 04:39:10 lneto Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -334,6 +334,7 @@ int	 strncasecmp(const char *, const cha
 u_long	 strtoul(const char *, char **, int);
 long long strtoll(const char *, char **, int);
 unsigned long long strtoull(const char *, char **, int);
+intmax_t  strtoimax(const char *, char **, int);
 uintmax_t strtoumax(const char *, char **, int);
 int	 snprintb(char *, size_t, const char *, uint64_t);
 int	 snprintb_m(char *, size_t, const char *, uint64_t, size_t);

Index: src/sys/modules/lua/Makefile
diff -u src/sys/modules/lua/Makefile:1.2 src/sys/modules/lua/Makefile:1.3
--- src/sys/modules/lua/Makefile:1.2	Thu Oct 31 16:50:14 2013
+++ src/sys/modules/lua/Makefile	Mon Dec  2 04:39:10 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2013/10/31 16:50:14 mbalmer Exp $
+#	$NetBSD: Makefile,v 1.3 2013/12/02 04:39:10 lneto Exp $
 
 .include ../Makefile.inc
 
@@ -44,6 +44,7 @@ SRCS+=		strcspn.c \
 
 CFLAGS+=	-include ${.CURDIR}/luaconf.h
 
-CPPFLAGS+=	-I${S}/../external/mit/lua/dist/src
+CPPFLAGS+=	-I${S}/../external/mit/lua/dist/src \
+		-I${S}/sys
 
 .include bsd.kmodule.mk

Index: src/sys/modules/lua/luaconf.h
diff -u src/sys/modules/lua/luaconf.h:1.1 src/sys/modules/lua/luaconf.h:1.2
--- src/sys/modules/lua/luaconf.h:1.1	Wed Oct 16 19:44:57 2013
+++ src/sys/modules/lua/luaconf.h	Mon Dec  2 04:39:10 2013
@@ -1,5 +1,5 @@
 /*
-** $Id: luaconf.h,v 1.1 2013/10/16 19:44:57 mbalmer Exp $
+** $Id: luaconf.h,v 1.2 2013/12/02 04:39:10 lneto Exp $
 ** Configuration file for Lua
 ** See Copyright Notice in lua.h
 */
@@ -505,8 +505,7 @@
 */
 
 #ifdef _KERNEL
-#define LUA_NUMBER	long long
-
+#define LUA_NUMBER	int64_t
 #else
 #define LUA_NUMBER_DOUBLE
 #define LUA_NUMBER	double
@@ -528,9 +527,9 @@
 */
 
 #ifdef _KERNEL
-#define LUA_NUMBER_SCAN		%lld
-#define LUA_NUMBER_FMT		%lld
-#define lua_str2number(s,p)	strtoll((s), (p), 10)
+#define LUA_NUMBER_SCAN		% SCNd64
+#define LUA_NUMBER_FMT		% PRId64
+#define lua_str2number(s,p)	((int64_t) strtoimax((s), (p), 10))
 #else
 #define LUA_NUMBER_SCAN		%lf
 #define LUA_NUMBER_FMT		%.14g

Added files:

Index: src/common/lib/libc/stdlib/strtoimax.c
diff -u 

CVS commit: src

2013-12-01 Thread Lourival Pereira Vieira Neto
Module Name:src
Committed By:   lneto
Date:   Mon Dec  2 04:57:41 UTC 2013

Modified Files:
src/external/mit/lua/dist/src: lauxlib.c lbaselib.c linit.c
src/sys/modules/lua: Makefile

Log Message:
put Lua auxlib and some stdlibs in lua(4)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/mit/lua/dist/src/lauxlib.c \
src/external/mit/lua/dist/src/lbaselib.c \
src/external/mit/lua/dist/src/linit.c
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/lua/Makefile

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

Modified files:

Index: src/external/mit/lua/dist/src/lauxlib.c
diff -u src/external/mit/lua/dist/src/lauxlib.c:1.1.1.2 src/external/mit/lua/dist/src/lauxlib.c:1.2
--- src/external/mit/lua/dist/src/lauxlib.c:1.1.1.2	Thu Mar 15 00:08:09 2012
+++ src/external/mit/lua/dist/src/lauxlib.c	Mon Dec  2 04:57:41 2013
@@ -1,7 +1,7 @@
-/*	$NetBSD: lauxlib.c,v 1.1.1.2 2012/03/15 00:08:09 alnsn Exp $	*/
+/*	$NetBSD: lauxlib.c,v 1.2 2013/12/02 04:57:41 lneto Exp $	*/
 
 /*
-** $Id: lauxlib.c,v 1.1.1.2 2012/03/15 00:08:09 alnsn Exp $
+** $Id: lauxlib.c,v 1.2 2013/12/02 04:57:41 lneto Exp $
 ** Auxiliary functions for building Lua libraries
 ** See Copyright Notice in lua.h
 */
@@ -521,6 +521,7 @@ LUALIB_API void luaL_unref (lua_State *L
 ** ===
 */
 
+#ifndef _KERNEL
 typedef struct LoadF {
   int extraline;
   FILE *f;
@@ -590,6 +591,7 @@ LUALIB_API int luaL_loadfile (lua_State 
   lua_remove(L, fnameindex);
   return status;
 }
+#endif
 
 
 typedef struct LoadS {
@@ -626,6 +628,7 @@ LUALIB_API int (luaL_loadstring) (lua_St
 /* }== */
 
 
+#ifndef _KERNEL
 static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
   (void)ud;
   (void)osize;
@@ -651,4 +654,5 @@ LUALIB_API lua_State *luaL_newstate (voi
   if (L) lua_atpanic(L, panic);
   return L;
 }
+#endif
 
Index: src/external/mit/lua/dist/src/lbaselib.c
diff -u src/external/mit/lua/dist/src/lbaselib.c:1.1.1.2 src/external/mit/lua/dist/src/lbaselib.c:1.2
--- src/external/mit/lua/dist/src/lbaselib.c:1.1.1.2	Thu Mar 15 00:08:06 2012
+++ src/external/mit/lua/dist/src/lbaselib.c	Mon Dec  2 04:57:41 2013
@@ -1,7 +1,7 @@
-/*	$NetBSD: lbaselib.c,v 1.1.1.2 2012/03/15 00:08:06 alnsn Exp $	*/
+/*	$NetBSD: lbaselib.c,v 1.2 2013/12/02 04:57:41 lneto Exp $	*/
 
 /*
-** $Id: lbaselib.c,v 1.1.1.2 2012/03/15 00:08:06 alnsn Exp $
+** $Id: lbaselib.c,v 1.2 2013/12/02 04:57:41 lneto Exp $
 ** Basic library
 ** See Copyright Notice in lua.h
 */
@@ -284,10 +284,12 @@ static int luaB_loadstring (lua_State *L
 }
 
 
+#ifndef _KERNEL
 static int luaB_loadfile (lua_State *L) {
   const char *fname = luaL_optstring(L, 1, NULL);
   return load_aux(L, luaL_loadfile(L, fname));
 }
+#endif
 
 
 /*
@@ -324,6 +326,7 @@ static int luaB_load (lua_State *L) {
 }
 
 
+#ifndef _KERNEL
 static int luaB_dofile (lua_State *L) {
   const char *fname = luaL_optstring(L, 1, NULL);
   int n = lua_gettop(L);
@@ -331,6 +334,7 @@ static int luaB_dofile (lua_State *L) {
   lua_call(L, 0, LUA_MULTRET);
   return lua_gettop(L) - n;
 }
+#endif
 
 
 static int luaB_assert (lua_State *L) {
@@ -449,12 +453,16 @@ static int luaB_newproxy (lua_State *L) 
 static const luaL_Reg base_funcs[] = {
   {assert, luaB_assert},
   {collectgarbage, luaB_collectgarbage},
+#ifndef _KERNEL
   {dofile, luaB_dofile},
+#endif
   {error, luaB_error},
   {gcinfo, luaB_gcinfo},
   {getfenv, luaB_getfenv},
   {getmetatable, luaB_getmetatable},
+#ifndef _KERNEL
   {loadfile, luaB_loadfile},
+#endif
   {load, luaB_load},
   {loadstring, luaB_loadstring},
   {next, luaB_next},
Index: src/external/mit/lua/dist/src/linit.c
diff -u src/external/mit/lua/dist/src/linit.c:1.1.1.2 src/external/mit/lua/dist/src/linit.c:1.2
--- src/external/mit/lua/dist/src/linit.c:1.1.1.2	Thu Mar 15 00:08:04 2012
+++ src/external/mit/lua/dist/src/linit.c	Mon Dec  2 04:57:41 2013
@@ -1,7 +1,7 @@
-/*	$NetBSD: linit.c,v 1.1.1.2 2012/03/15 00:08:04 alnsn Exp $	*/
+/*	$NetBSD: linit.c,v 1.2 2013/12/02 04:57:41 lneto Exp $	*/
 
 /*
-** $Id: linit.c,v 1.1.1.2 2012/03/15 00:08:04 alnsn Exp $
+** $Id: linit.c,v 1.2 2013/12/02 04:57:41 lneto Exp $
 ** Initialization of libraries for lua.c
 ** See Copyright Notice in lua.h
 */
@@ -18,13 +18,19 @@
 
 static const luaL_Reg lualibs[] = {
   {, luaopen_base},
+#ifndef _KERNEL
   {LUA_LOADLIBNAME, luaopen_package},
+#endif
   {LUA_TABLIBNAME, luaopen_table},
+#ifndef _KERNEL
   {LUA_IOLIBNAME, luaopen_io},
   {LUA_OSLIBNAME, luaopen_os},
+#endif
   {LUA_STRLIBNAME, luaopen_string},
+#ifndef _KERNEL
   {LUA_MATHLIBNAME, luaopen_math},
   {LUA_DBLIBNAME, luaopen_debug},
+#endif
   {NULL, NULL}
 };
 

Index: src/sys/modules/lua/Makefile
diff -u src/sys/modules/lua/Makefile:1.3 src/sys/modules/lua/Makefile:1.4
--- src/sys/modules/lua/Makefile:1.3	Mon Dec  2 04:39:10 2013
+++ src/sys/modules/lua/Makefile	

CVS commit: src/sys/modules/luacore

2013-12-01 Thread Lourival Pereira Vieira Neto
Module Name:src
Committed By:   lneto
Date:   Mon Dec  2 05:06:32 UTC 2013

Modified Files:
src/sys/modules/luacore: luacore.c

Log Message:
using Lua auxlib in luacore module


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/modules/luacore/luacore.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/modules/luacore/luacore.c
diff -u src/sys/modules/luacore/luacore.c:1.4 src/sys/modules/luacore/luacore.c:1.5
--- src/sys/modules/luacore/luacore.c:1.4	Wed Oct 23 18:57:40 2013
+++ src/sys/modules/luacore/luacore.c	Mon Dec  2 05:06:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: luacore.c,v 1.4 2013/10/23 18:57:40 mbalmer Exp $ */
+/*	$NetBSD: luacore.c,v 1.5 2013/12/02 05:06:32 lneto Exp $ */
 
 /*
  * Copyright (c) 2011, 2013 Marc Balmer mbal...@netbsd.org.
@@ -39,6 +39,7 @@
 #include sys/systm.h
 
 #include lua.h
+#include lauxlib.h
 
 #ifdef _MODULE
 MODULE(MODULE_CLASS_MISC, luacore, lua);
@@ -156,43 +157,34 @@ core_panic(lua_State *L)
 
 /* mutexes */
 
-struct core_reg {
-	const char *n;
-	int (*f)(lua_State *);
+static const luaL_Reg core_lib[ ] = {
+	{ print,			print },
+	{ print_nolog,		print_nolog },
+	{ uprint,			uprint },
+	{ aprint_normal,		core_aprint_normal },
+	{ aprint_naive,		core_aprint_naive },
+	{ aprint_verbose,		core_aprint_verbose },
+	{ aprint_debug,		core_aprint_debug },
+	{ aprint_error,		core_aprint_error },
+	{ aprint_get_error_count,	core_aprint_get_error_count },
+
+	/* panicing */
+	{ panic,			core_panic },
+
+	/* callouts */
+
+	/* mutexes */
+
+	{NULL, NULL}
 };
 
+
 static int
 luaopen_core(void *ls)
 {
 	lua_State *L = (lua_State *)ls;
-	int n, nfunc;
-	struct core_reg core[] = {
-		/* printing functions */
-		{ print,			print },
-		{ print_nolog,		print_nolog },
-		{ uprint,			uprint },
-		{ aprint_normal,		core_aprint_normal },
-		{ aprint_naive,		core_aprint_naive },
-		{ aprint_verbose,		core_aprint_verbose },
-		{ aprint_debug,		core_aprint_debug },
-		{ aprint_error,		core_aprint_error },
-		{ aprint_get_error_count,	core_aprint_get_error_count },
-
-		/* panicing */
-		{ panic,			core_panic },
-
-		/* callouts */
-
-		/* mutexes */
-	};
-
-	nfunc = sizeof(core)/sizeof(core[1]);
-
-	lua_createtable(L, nfunc, 0);
-	for (n = 0; n  nfunc; n++) {
-		lua_pushcfunction(L, core[n].f);
-		lua_setfield(L, -2, core[n].n);
-	}
+
+	luaL_register(L, core, core_lib);
 
 	/* some string values */
 	lua_pushstring(L, copyright);
@@ -216,7 +208,6 @@ luaopen_core(void *ls)
 	lua_pushinteger(L, ncpu);
 	lua_setfield(L, -2, ncpu);
 
-	lua_setglobal(L, core);
 	return 1;
 }
 



CVS commit: src

2013-12-01 Thread Lourival Pereira Vieira Neto
Module Name:src
Committed By:   lneto
Date:   Mon Dec  2 06:07:22 UTC 2013

Modified Files:
src/external/mit/lua/dist/src: luaconf.h
src/sys/modules/lua: Makefile
Removed Files:
src/sys/modules/lua: luaconf.h

Log Message:
merged luaconf.h of kernel and userspace Lua


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mit/lua/dist/src/luaconf.h
cvs rdiff -u -r1.4 -r1.5 src/sys/modules/lua/Makefile
cvs rdiff -u -r1.2 -r0 src/sys/modules/lua/luaconf.h

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

Modified files:

Index: src/external/mit/lua/dist/src/luaconf.h
diff -u src/external/mit/lua/dist/src/luaconf.h:1.4 src/external/mit/lua/dist/src/luaconf.h:1.5
--- src/external/mit/lua/dist/src/luaconf.h:1.4	Thu Mar 15 01:02:19 2012
+++ src/external/mit/lua/dist/src/luaconf.h	Mon Dec  2 06:07:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: luaconf.h,v 1.4 2012/03/15 01:02:19 alnsn Exp $	*/
+/*	$NetBSD: luaconf.h,v 1.5 2013/12/02 06:07:22 lneto Exp $	*/
 
 /*
 ** Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $
@@ -510,15 +510,18 @@
 ** ===
 */
 
+#ifdef _KERNEL
+#define LUA_NUMBER	int64_t
+#else
 #define LUA_NUMBER_DOUBLE
 #define LUA_NUMBER	double
+#endif
 
 /*
 @@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
 @* over a number.
 */
-#define LUAI_UACNUMBER	double
-
+#define LUAI_UACNUMBER	LUA_NUMBER	
 
 /*
 @@ LUA_NUMBER_SCAN is the format for reading numbers.
@@ -527,24 +530,36 @@
 @@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.
 @@ lua_str2number converts a string to a number.
 */
+#ifdef _KERNEL
+#define LUA_NUMBER_SCAN		% SCNd64
+#define LUA_NUMBER_FMT		% PRId64
+#define lua_str2number(s,p)	((int64_t) strtoimax((s), (p), 10))
+#else
 #define LUA_NUMBER_SCAN		%lf
 #define LUA_NUMBER_FMT		%.14g
-#define lua_number2str(s,n)	sprintf((s), LUA_NUMBER_FMT, (n))
-#define LUAI_MAXNUMBER2STR	32 /* 16 digits, sign, point, and \0 */
 #define lua_str2number(s,p)	strtod((s), (p))
+#endif
 
+#define lua_number2str(s,n)	sprintf((s), LUA_NUMBER_FMT, (n))
+#define LUAI_MAXNUMBER2STR	32 /* 16 digits, sign, point, and \0 */
 
 /*
 @@ The luai_num* macros define the primitive operations over numbers.
 */
 #if defined(LUA_CORE)
+#ifdef _KERNEL
+#define luai_nummod(a,b)	((a)%(b))
+#define luai_numpow(a,b)	luai_nummul(a,b)
+#else
 #include math.h
+#define luai_nummod(a,b)	((a) - floor((a)/(b))*(b))
+#define luai_numpow(a,b)	(pow(a,b))
+#endif
+
 #define luai_numadd(a,b)	((a)+(b))
 #define luai_numsub(a,b)	((a)-(b))
 #define luai_nummul(a,b)	((a)*(b))
 #define luai_numdiv(a,b)	((a)/(b))
-#define luai_nummod(a,b)	((a) - floor((a)/(b))*(b))
-#define luai_numpow(a,b)	(pow(a,b))
 #define luai_numunm(a)		(-(a))
 #define luai_numeq(a,b)		((a)==(b))
 #define luai_numlt(a,b)		((a)(b))
@@ -612,7 +627,13 @@ union luai_Cast { double l_d; long l_l; 
 ** compiling as C++ code, with _longjmp/_setjmp when asked to use them,
 ** and with longjmp/setjmp otherwise.
 */
-#if defined(__cplusplus)
+#ifdef _KERNEL
+/* in NetBSD kernel */
+#define LUAI_THROW(L,c)	longjmp( ((c)-b))
+#define LUAI_TRY(L,c,a)	if (setjmp( ((c)-b)) == 0) { a }
+#define luai_jmpbuf	label_t
+
+#elif defined(__cplusplus)
 /* C++ exceptions */
 #define LUAI_THROW(L,c)	throw(c)
 #define LUAI_TRY(L,c,a)	try { a } catch(...) \

Index: src/sys/modules/lua/Makefile
diff -u src/sys/modules/lua/Makefile:1.4 src/sys/modules/lua/Makefile:1.5
--- src/sys/modules/lua/Makefile:1.4	Mon Dec  2 04:57:41 2013
+++ src/sys/modules/lua/Makefile	Mon Dec  2 06:07:22 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2013/12/02 04:57:41 lneto Exp $
+#	$NetBSD: Makefile,v 1.5 2013/12/02 06:07:22 lneto Exp $
 
 .include ../Makefile.inc
 
@@ -46,8 +46,6 @@ SRCS+=		strcspn.c \
 		strpbrk.c \
 		strspn.c
 
-CFLAGS+=	-include ${.CURDIR}/luaconf.h
-
 CPPFLAGS+=	-I${S}/../external/mit/lua/dist/src \
 		-I${S}/sys