CVS commit: src/sys/rump/librump/rumpkern

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Sep  7 06:06:54 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: vm.c

Log Message:
Use rb_tree for page lookup instead of list.  Unshockingly, this
makes dealing with large uobjs (files) quite a bit faster.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/rump/librump/rumpkern/vm.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/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.88 src/sys/rump/librump/rumpkern/vm.c:1.89
--- src/sys/rump/librump/rumpkern/vm.c:1.88	Mon Sep  6 20:10:20 2010
+++ src/sys/rump/librump/rumpkern/vm.c	Tue Sep  7 06:06:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.88 2010/09/06 20:10:20 pooka Exp $	*/
+/*	$NetBSD: vm.c,v 1.89 2010/09/07 06:06:54 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.88 2010/09/06 20:10:20 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.89 2010/09/07 06:06:54 pooka Exp $");
 
 #include 
 #include 
@@ -73,7 +73,6 @@
 struct vm_map rump_vmmap;
 static struct vm_map_kernel kmem_map_store;
 struct vm_map *kmem_map = &kmem_map_store.vmk_map;
-const struct rb_tree_ops uvm_page_tree_ops;
 
 static struct vm_map_kernel kernel_map_store;
 struct vm_map *kernel_map = &kernel_map_store.vmk_map;
@@ -86,6 +85,32 @@
 static unsigned long physmemlimit = RUMPMEM_UNLIMITED;
 static unsigned long curphysmem;
 
+static int
+pg_compare_key(const struct rb_node *n, const void *key)
+{
+	voff_t a = ((const struct vm_page *)n)->offset;
+	voff_t b = *(const voff_t *)key;
+
+	if (a < b)
+		return 1;
+	else if (a > b)
+		return -1;
+	else
+		return 0;
+}
+
+static int
+pg_compare_nodes(const struct rb_node *n1, const struct rb_node *n2)
+{
+
+	return pg_compare_key(n1, &((const struct vm_page *)n2)->offset);
+}
+
+const struct rb_tree_ops uvm_page_tree_ops = {
+	.rbto_compare_nodes = pg_compare_nodes,
+	.rbto_compare_key = pg_compare_key,
+};
+
 /*
  * vm pages 
  */
@@ -107,6 +132,8 @@
 	pg->flags = PG_CLEAN|PG_BUSY|PG_FAKE;
 
 	TAILQ_INSERT_TAIL(&uobj->memq, pg, listq.queue);
+	rb_tree_insert_node(&uobj->rb_tree, &pg->rb_node);
+
 	uobj->uo_npages++;
 
 	return pg;
@@ -126,6 +153,7 @@
 		wakeup(pg);
 
 	uobj->uo_npages--;
+	rb_tree_remove_node(&uobj->rb_tree, &pg->rb_node);
 	TAILQ_REMOVE(&uobj->memq, pg, listq.queue);
 	kmem_free((void *)pg->uanon, PAGE_SIZE);
 	kmem_free(pg, sizeof(*pg));
@@ -366,17 +394,8 @@
 struct vm_page *
 uvm_pagelookup(struct uvm_object *uobj, voff_t off)
 {
-	struct vm_page *pg;
-
-	TAILQ_FOREACH(pg, &uobj->memq, listq.queue) {
-		if ((pg->flags & PG_MARKER) != 0)
-			continue;
-		if (pg->offset == off) {
-			return pg;
-		}
-	}
 
-	return NULL;
+	return (struct vm_page *)rb_tree_find_node(&uobj->rb_tree, &off);
 }
 
 void



CVS commit: src/sys/uvm

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Sep  7 04:45:22 UTC 2010

Modified Files:
src/sys/uvm: uvm_pdaemon.h

Log Message:
Make "no options VMSWAP" kernels compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/uvm/uvm_pdaemon.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/uvm/uvm_pdaemon.h
diff -u src/sys/uvm/uvm_pdaemon.h:1.15 src/sys/uvm/uvm_pdaemon.h:1.16
--- src/sys/uvm/uvm_pdaemon.h:1.15	Wed Jan  2 11:49:20 2008
+++ src/sys/uvm/uvm_pdaemon.h	Tue Sep  7 04:45:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdaemon.h,v 1.15 2008/01/02 11:49:20 ad Exp $	*/
+/*	$NetBSD: uvm_pdaemon.h,v 1.16 2010/09/07 04:45:22 pooka Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -83,7 +83,11 @@
 bool uvm_reclaimable(void);
 
 kmutex_t *uvmpd_trylockowner(struct vm_page *);
+#ifdef VMSWAP
 bool uvmpd_trydropswap(struct vm_page *);
+#else
+#define uvmpd_trydropswap(_a_) (/*CONSTCOND*/false)
+#endif
 
 #endif /* _KERNEL */
 



CVS commit: src

2010-09-06 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue Sep  7 02:11:04 UTC 2010

Modified Files:
src/lib/libperfuse: ops.c perfuse.c perfuse_if.h
src/usr.sbin/perfused: msg.c perfused.c

Log Message:
- Do not checkfor peer credentials when perfused is autostarted and
therefore runs with filesystem privileges

- shut up warnings and debug messages when perfused is autostarted

- make perfused patch modifiable with CFLAGS for easier pkgsrc integration

- Fix build warnings


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libperfuse/ops.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libperfuse/perfuse.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libperfuse/perfuse_if.h
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/perfused/msg.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/perfused/perfused.c

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.11 src/lib/libperfuse/ops.c:1.12
--- src/lib/libperfuse/ops.c:1.11	Mon Sep  6 01:40:24 2010
+++ src/lib/libperfuse/ops.c	Tue Sep  7 02:11:04 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.11 2010/09/06 01:40:24 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.12 2010/09/07 02:11:04 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -41,6 +41,8 @@
 #include "perfuse_priv.h"
 #include "fuse.h"
 
+extern int perfuse_diagflags;
+
 static int node_close_common(struct puffs_usermount *, puffs_cookie_t, int);
 static int no_access(puffs_cookie_t, const struct puffs_cred *, mode_t);
 static void fuse_attr_to_vap(struct perfuse_state *,

Index: src/lib/libperfuse/perfuse.c
diff -u src/lib/libperfuse/perfuse.c:1.4 src/lib/libperfuse/perfuse.c:1.5
--- src/lib/libperfuse/perfuse.c:1.4	Mon Sep  6 01:40:24 2010
+++ src/lib/libperfuse/perfuse.c	Tue Sep  7 02:11:04 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse.c,v 1.4 2010/09/06 01:40:24 manu Exp $ */
+/*  $NetBSD: perfuse.c,v 1.5 2010/09/07 02:11:04 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -115,8 +115,7 @@
 
 	if ((sv[0] = socket(PF_LOCAL, SOCK_STREAM, 0)) == -1) {
 #ifdef PERFUSE_DEBUG
-		printf("%s:%d socket failed: %s\n", 
-		   __func__, __LINE__, strerror(errno));
+		DWARN("%s:%d socket failed: %s", __func__, __LINE__);
 #endif
 		return -1;
 	}
@@ -138,8 +137,7 @@
 	 */
 	if (socketpair(PF_LOCAL, SOCK_STREAM, 0, sv) != 0) {
 #ifdef PERFUSE_DEBUG
-		printf("%s:%d: socketpair failed: %s\n",
-		   __func__, __LINE__, strerror(errno));
+		DWARN("%s:%d: socketpair failed", __func__, __LINE__);
 #endif
 		return -1;
 	}
@@ -149,8 +147,7 @@
 	switch(fork()) {
 	case -1:
 #ifdef PERFUSE_DEBUG
-		printf("%s:%d: fork failed: %s\n",
-		   __func__, __LINE__, strerror(errno));
+		DWARN("%s:%d: fork failed", __func__, __LINE__);
 #endif
 		return -1;
 		/* NOTREACHED */
@@ -158,8 +155,7 @@
 	case 0:
 		(void)execve(argv[0], argv, envp);
 #ifdef PERFUSE_DEBUG
-		printf("%s:%d: execve failed: %s\n",
-		   __func__, __LINE__, strerror(errno));
+		DWARN("%s:%d: execve failed", __func__, __LINE__);
 #endif
 		return -1;
 		/* NOTREACHED */
@@ -181,32 +177,19 @@
 	const void *data;
 {
 	int s;
-#if 0
-	struct sockaddr_un sun;
-#endif
 	size_t len;
 	struct perfuse_mount_out pmo;
 
 #ifdef PERFUSE_DEBUG
-	printf("%s(\"%s\", \"%s\", \"%s\", 0x%lx, \"%s\")\n", __func__,
-	   source, target, filesystemtype, mountflags, (const char *)data);
+	if (perfuse_diagflags & PDF_MISC)
+		DPRINTF("%s(\"%s\", \"%s\", \"%s\", 0x%lx, \"%s\")\n",
+			__func__, source, target, filesystemtype, 
+			mountflags, (const char *)data);
 #endif
 
-#if 0
-	if ((s = socket(PF_LOCAL, SOCK_STREAM, 0)) == -1)
-		err(EX_OSERR, "socket failed");
-
-	sun.sun_len = sizeof(sun);
-	sun.sun_family = AF_LOCAL;
-	(void)strcpy(sun.sun_path, _PATH_FUSE);
-
-	if (connect(s, (struct sockaddr *)&sun, sun.sun_len) == -1)
-		err(EX_UNAVAILABLE, "cannot connect to \"%s\"", _PATH_FUSE);
-#endif
 	if ((s = get_fd(data)) == -1)
 		return -1;
 	
-
 	pmo.pmo_len = sizeof(pmo);
 	pmo.pmo_len += source ? (uint32_t)strlen(source) : 0;
 	pmo.pmo_len += target ? (uint32_t)strlen(target) : 0;
@@ -226,7 +209,8 @@
 
 	if (write(s, &pmo, sizeof(pmo)) != sizeof(pmo)) {
 #ifdef PERFUSE_DEBUG
-		printf("%s:%d short write\n", __func__, __LINE__);
+		if (perfuse_diagflags & PDF_MISC)
+			DPRINTF("%s:%d short write\n", __func__, __LINE__);
 #endif
 		return -1;
 	}
@@ -235,7 +219,7 @@
 		len = pmo.pmo_source_len;
 		if (write(s, source, len) != (ssize_t)len) {
 #ifdef PERFUSE_DEBUG
-			printf("%s:%d short write\n", __func__, __LINE__);
+			DWARNX("%s:%d short write\n", __func__, __LINE__);
 #endif
 			return -1;
 		}
@@ -245,7 +229,7 @@
 		len = pmo.pmo_target_len;
 		if (write(s, target, len) != (ssize_t)len) {
 #ifdef PERFUSE_DEBUG
-			printf("%s:%d short write\n", __func__, __LINE__);
+			DWARNX("%s:%d short write\n", __func__, __LINE__);
 #endif
 			return -1;
 		}
@@ -255,7 +

CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib

2010-09-06 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Tue Sep  7 00:25:37 UTC 2010

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: openssl_crypto.c

Log Message:
clarification comment as to why two of the bignums are reversed


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 \
src/crypto/external/bsd/netpgp/dist/src/lib/openssl_crypto.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/openssl_crypto.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/openssl_crypto.c:1.27 src/crypto/external/bsd/netpgp/dist/src/lib/openssl_crypto.c:1.28
--- src/crypto/external/bsd/netpgp/dist/src/lib/openssl_crypto.c:1.27	Sun Aug 15 07:52:27 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/openssl_crypto.c	Tue Sep  7 00:25:37 2010
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: openssl_crypto.c,v 1.27 2010/08/15 07:52:27 agc Exp $");
+__RCSID("$NetBSD: openssl_crypto.c,v 1.28 2010/09/07 00:25:37 agc Exp $");
 #endif
 
 #ifdef HAVE_OPENSSL_DSA_H
@@ -524,7 +524,7 @@
 	orsa = RSA_new();
 	orsa->n = BN_dup(pubkey->n);
 	orsa->d = seckey->d;
-	orsa->p = seckey->q;
+	orsa->p = seckey->q;	/* p and q are round the other way in openssl */
 	orsa->q = seckey->p;
 
 	/* debug */



CVS commit: src/sys/rump/librump/rumpvfs

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 21:33:07 UTC 2010

Modified Files:
src/sys/rump/librump/rumpvfs: vm_vfs.c

Log Message:
Make the pager loops more resilient against the aobj pager which is
lazy and doesn't like to return anything except the bare minimum.
(forgot to commit this earlier)


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/rump/librump/rumpvfs/vm_vfs.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/rump/librump/rumpvfs/vm_vfs.c
diff -u src/sys/rump/librump/rumpvfs/vm_vfs.c:1.19 src/sys/rump/librump/rumpvfs/vm_vfs.c:1.20
--- src/sys/rump/librump/rumpvfs/vm_vfs.c:1.19	Mon Sep  6 17:56:56 2010
+++ src/sys/rump/librump/rumpvfs/vm_vfs.c	Mon Sep  6 21:33:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_vfs.c,v 1.19 2010/09/06 17:56:56 pooka Exp $	*/
+/*	$NetBSD: vm_vfs.c,v 1.20 2010/09/06 21:33:07 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.19 2010/09/06 17:56:56 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.20 2010/09/06 21:33:07 pooka Exp $");
 
 #include 
 
@@ -102,7 +102,7 @@
 	if (maxpages == 0)
 		return;
 
-	pgs = kmem_zalloc(maxpages * sizeof(pgs), KM_SLEEP);
+	pgs = kmem_alloc(maxpages * sizeof(pgs), KM_SLEEP);
 	while (len) {
 		npages = MIN(maxpages, round_page(len) >> PAGE_SHIFT);
 		memset(pgs, 0, npages * sizeof(struct vm_page *));
@@ -113,15 +113,20 @@
 		KASSERT(npages > 0);
 
 		for (i = 0; i < npages; i++) {
+			struct vm_page *pg;
 			uint8_t *start;
 			size_t chunkoff, chunklen;
 
+			pg = pgs[i];
+			if (pg == NULL)
+break;
+
 			chunkoff = off & PAGE_MASK;
 			chunklen = MIN(PAGE_SIZE - chunkoff, len);
-			start = (uint8_t *)pgs[i]->uanon + chunkoff;
+			start = (uint8_t *)pg->uanon + chunkoff;
 
 			memset(start, 0, chunklen);
-			pgs[i]->flags &= ~PG_CLEAN;
+			pg->flags &= ~PG_CLEAN;
 
 			off += chunklen;
 			len -= chunklen;
@@ -146,7 +151,7 @@
 	int i, rv, pagerflags;
 
 	pgalloc = npages * sizeof(pgs);
-	pgs = kmem_zalloc(pgalloc, KM_SLEEP);
+	pgs = kmem_alloc(pgalloc, KM_SLEEP);
 
 	pagerflags = PAGERFLAGS;
 	if (flags & UBC_WRITE)
@@ -155,24 +160,31 @@
 		pagerflags |= PGO_OVERWRITE;
 
 	do {
+		npages = len2npages(uio->uio_offset, todo);
+		memset(pgs, 0, pgalloc);
 		mutex_enter(&uobj->vmobjlock);
-		rv = uobj->pgops->pgo_get(uobj, uio->uio_offset & ~PAGE_MASK,
+		rv = uobj->pgops->pgo_get(uobj, trunc_page(uio->uio_offset),
 		pgs, &npages, 0, VM_PROT_READ | VM_PROT_WRITE, 0,
 		pagerflags);
 		if (rv)
 			goto out;
 
 		for (i = 0; i < npages; i++) {
+			struct vm_page *pg;
 			size_t xfersize;
 			off_t pageoff;
 
+			pg = pgs[i];
+			if (pg == NULL)
+break;
+
 			pageoff = uio->uio_offset & PAGE_MASK;
 			xfersize = MIN(MIN(todo, PAGE_SIZE), PAGE_SIZE-pageoff);
 			KASSERT(xfersize > 0);
-			uiomove((uint8_t *)pgs[i]->uanon + pageoff,
+			uiomove((uint8_t *)pg->uanon + pageoff,
 			xfersize, uio);
 			if (uio->uio_rw == UIO_WRITE)
-pgs[i]->flags &= ~(PG_CLEAN | PG_FAKE);
+pg->flags &= ~(PG_CLEAN | PG_FAKE);
 			todo -= xfersize;
 		}
 		uvm_page_unbusy(pgs, npages);



CVS commit: src/crypto/external/bsd/netpgp/dist/src/pgp2ssh

2010-09-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep  6 20:33:18 UTC 2010

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/pgp2ssh: pgp2ssh.1

Log Message:
More markup, end sentence with dot.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/pgp2ssh.1

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/pgp2ssh.1
diff -u src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/pgp2ssh.1:1.1 src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/pgp2ssh.1:1.2
--- src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/pgp2ssh.1:1.1	Mon Sep  6 18:16:52 2010
+++ src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/pgp2ssh.1	Mon Sep  6 20:33:18 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: pgp2ssh.1,v 1.1 2010/09/06 18:16:52 agc Exp $
+.\" $NetBSD: pgp2ssh.1,v 1.2 2010/09/06 20:33:18 wiz Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -38,14 +38,14 @@
 .Op Fl f address-family
 .Op Fl h hostname
 .Op Fl p port
-userid...
+.Ar userid ...
 .Sh DESCRIPTION
 The
 .Nm
 command retrieves PGP public key information from the key server daemon
 using the HKP protocol, and converts the PGP public
 key to a format suitable for use by
-.Xr ssh 1
+.Xr ssh 1 .
 The
 .Xr hkpd 1
 is normally used to serve public key information.
@@ -65,8 +65,7 @@
 It is quite possible to serve ssh public keys
 across a network using
 .Xr hkpd 1
-to
-serve the key, and
+to serve the key, and
 .Nm
 to retrieve the key using the HKP protocol,
 and to save the key in ssh format on the remote computer,



CVS commit: src/sys/rump/librump/rumpkern

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 20:10:20 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: Makefile.rumpkern rump.c vm.c

Log Message:
Use standard uvm aobj pager.  Most of the kernel aobj pager complexity
comes from swap handling, but that is included only with VMSWAP.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/rump/librump/rumpkern/Makefile.rumpkern
cvs rdiff -u -r1.184 -r1.185 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.87 -r1.88 src/sys/rump/librump/rumpkern/vm.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/rump/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.96 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.97
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.96	Wed Sep  1 19:37:58 2010
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Mon Sep  6 20:10:20 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpkern,v 1.96 2010/09/01 19:37:58 pooka Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.97 2010/09/06 20:10:20 pooka Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -95,7 +95,7 @@
 	syscalls.c
 
 # sys/uvm
-SRCS+=	uvm_readahead.c
+SRCS+=	uvm_aobj.c uvm_readahead.c
 
 # 4.4BSD secmodel.  selection is hardcoded for now
 SRCS+=	secmodel_suser.c

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.184 src/sys/rump/librump/rumpkern/rump.c:1.185
--- src/sys/rump/librump/rumpkern/rump.c:1.184	Wed Sep  1 19:37:58 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Mon Sep  6 20:10:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.184 2010/09/01 19:37:58 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.185 2010/09/06 20:10:20 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.184 2010/09/01 19:37:58 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.185 2010/09/06 20:10:20 pooka Exp $");
 
 #include 
 #define ELFSIZE ARCH_ELFSIZE
@@ -293,6 +293,7 @@
 	kmem_init();
 
 	uvm_ra_init();
+	uao_init();
 
 	mutex_obj_init();
 	callout_startup();

Index: src/sys/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.87 src/sys/rump/librump/rumpkern/vm.c:1.88
--- src/sys/rump/librump/rumpkern/vm.c:1.87	Thu Jul 29 15:13:00 2010
+++ src/sys/rump/librump/rumpkern/vm.c	Mon Sep  6 20:10:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.87 2010/07/29 15:13:00 hannken Exp $	*/
+/*	$NetBSD: vm.c,v 1.88 2010/09/06 20:10:20 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -30,9 +30,7 @@
  */
 
 /*
- * Virtual memory emulation routines.  Contents:
- *  + anon objects & pager
- *  + misc support routines
+ * Virtual memory emulation routines.
  */
 
 /*
@@ -43,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.87 2010/07/29 15:13:00 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.88 2010/09/06 20:10:20 pooka Exp $");
 
 #include 
 #include 
@@ -60,21 +58,14 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
 #include "rump_private.h"
 
-static int ao_get(struct uvm_object *, voff_t, struct vm_page **,
-	int *, int, vm_prot_t, int, int);
-static int ao_put(struct uvm_object *, voff_t, voff_t, int);
-
-const struct uvm_pagerops aobj_pager = {
-	.pgo_get = ao_get,
-	.pgo_put = ao_put,
-};
-
 kmutex_t uvm_pageqlock;
+kmutex_t uvm_swap_data_lock;
 
 struct uvmexp uvmexp;
 struct uvm uvm;
@@ -149,88 +140,6 @@
 }
 
 /*
- * Anon object stuff
- */
-
-static int
-ao_get(struct uvm_object *uobj, voff_t off, struct vm_page **pgs,
-	int *npages, int centeridx, vm_prot_t access_type,
-	int advice, int flags)
-{
-	struct vm_page *pg;
-	int i;
-
-	if (centeridx)
-		panic("%s: centeridx != 0 not supported", __func__);
-
-	/* loop over pages */
-	off = trunc_page(off);
-	for (i = 0; i < *npages; i++) {
- retrylookup:
-		pg = uvm_pagelookup(uobj, off + (i << PAGE_SHIFT));
-		if (pg) {
-			if (pg->flags & PG_BUSY) {
-pg->flags |= PG_WANTED;
-UVM_UNLOCK_AND_WAIT(pg, &uobj->vmobjlock, 0,
-"aogetpg", 0);
-goto retrylookup;
-			}
-			pg->flags |= PG_BUSY;
-			pgs[i] = pg;
-		} else {
-			pg = uvm_pagealloc(uobj,
-			off + (i << PAGE_SHIFT), NULL, UVM_PGA_ZERO);
-			pgs[i] = pg;
-		}
-	}
-	mutex_exit(&uobj->vmobjlock);
-
-	return 0;
-
-}
-
-static int
-ao_put(struct uvm_object *uobj, voff_t start, voff_t stop, int flags)
-{
-	struct vm_page *pg;
-
-	/* we only free all pages for now */
-	if ((flags & PGO_FREE) == 0 || (flags & PGO_ALLPAGES) == 0) {
-		mutex_exit(&uobj->vmobjlock);
-		return 0;
-	}
-
-	while ((pg = TAILQ_FIRST(&uobj->memq)) != NULL)
-		uvm_pagefree(pg);
-	mutex_exit(&uobj->vmobjlock);
-
-	return 0;
-}
-
-struct uvm_object *
-uao_create(vsize_t size, int flags)
-{
-	struct uvm_object *uobj;
-
-	uobj = kmem_zalloc(sizeof(struct uvm_object), KM_SLEEP);
-	uobj->pgops = &aobj_pag

CVS commit: src/sys/arch/x86/pci

2010-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  6 20:03:56 UTC 2010

Modified Files:
src/sys/arch/x86/pci: ichlpcib.c

Log Message:
make it compile.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/x86/pci/ichlpcib.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/x86/pci/ichlpcib.c
diff -u src/sys/arch/x86/pci/ichlpcib.c:1.27 src/sys/arch/x86/pci/ichlpcib.c:1.28
--- src/sys/arch/x86/pci/ichlpcib.c:1.27	Mon Aug 16 21:45:51 2010
+++ src/sys/arch/x86/pci/ichlpcib.c	Mon Sep  6 16:03:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.27 2010/08/17 01:45:51 jakllsch Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.28 2010/09/06 20:03:56 christos Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.27 2010/08/17 01:45:51 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.28 2010/09/06 20:03:56 christos Exp $");
 
 #include 
 #include 
@@ -371,7 +371,7 @@
 static int
 lpcibrescan(device_t self, const char *ifattr, const int *locators)
 {
-#if NHPET > 0 || NGPIO > 0
+#if NHPET > 0 || NGPIO > 0 || NFWHRNG > 0
 	struct lpcib_softc *sc = device_private(self);
 #endif
 



CVS commit: src/sys/rump

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 20:01:31 UTC 2010

Modified Files:
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c

Log Message:
regen: umask


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/rump/include/rump/rump_syscalls.h
cvs rdiff -u -r1.49 -r1.50 src/sys/rump/librump/rumpkern/rump_syscalls.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/rump/include/rump/rump_syscalls.h
diff -u src/sys/rump/include/rump/rump_syscalls.h:1.29 src/sys/rump/include/rump/rump_syscalls.h:1.30
--- src/sys/rump/include/rump/rump_syscalls.h:1.29	Mon Aug 30 10:34:51 2010
+++ src/sys/rump/include/rump/rump_syscalls.h	Mon Sep  6 20:01:31 2010
@@ -1,10 +1,10 @@
-/* $NetBSD: rump_syscalls.h,v 1.29 2010/08/30 10:34:51 pooka Exp $ */
+/* $NetBSD: rump_syscalls.h,v 1.30 2010/09/06 20:01:31 pooka Exp $ */
 
 /*
  * System call protos in rump namespace.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.236 2010/08/30 10:32:54 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.237 2010/09/06 20:00:09 pooka Exp
  */
 
 #ifndef _RUMP_RUMP_SYSCALLS_H_
@@ -54,6 +54,7 @@
 int rump_sys_revoke(const char *);
 int rump_sys_symlink(const char *, const char *);
 ssize_t rump_sys_readlink(const char *, char *, size_t);
+mode_t rump_sys_umask(mode_t);
 int rump_sys_chroot(const char *);
 int rump_sys_getgroups(int, gid_t *);
 int rump_sys_setgroups(int, const gid_t *);

Index: src/sys/rump/librump/rumpkern/rump_syscalls.c
diff -u src/sys/rump/librump/rumpkern/rump_syscalls.c:1.49 src/sys/rump/librump/rumpkern/rump_syscalls.c:1.50
--- src/sys/rump/librump/rumpkern/rump_syscalls.c:1.49	Mon Aug 30 10:34:51 2010
+++ src/sys/rump/librump/rumpkern/rump_syscalls.c	Mon Sep  6 20:01:31 2010
@@ -1,14 +1,14 @@
-/* $NetBSD: rump_syscalls.c,v 1.49 2010/08/30 10:34:51 pooka Exp $ */
+/* $NetBSD: rump_syscalls.c,v 1.50 2010/09/06 20:01:31 pooka Exp $ */
 
 /*
  * System call vector and marshalling for rump.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.236 2010/08/30 10:32:54 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.237 2010/09/06 20:00:09 pooka Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.49 2010/08/30 10:34:51 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.50 2010/09/06 20:01:31 pooka Exp $");
 
 #include 
 #include 
@@ -744,6 +744,26 @@
 }
 __weak_alias(sys_readlink,rump_enosys);
 
+mode_t rump_sys_umask(mode_t);
+mode_t
+rump_sys_umask(mode_t newmask)
+{
+	register_t rval[2] = {0, 0};
+	int error = 0;
+	struct sys_umask_args callarg;
+
+	SPARG(&callarg, newmask) = newmask;
+
+	error = rump_sysproxy(SYS_umask, rump_sysproxy_arg,
+	(uint8_t *)&callarg, sizeof(callarg), rval);
+	if (error) {
+		rval[0] = -1;
+		rumpuser_seterrno(error);
+	}
+	return rval[0];
+}
+__weak_alias(sys_umask,rump_enosys);
+
 int rump_sys_chroot(const char *);
 int
 rump_sys_chroot(const char * path)
@@ -3278,8 +3298,8 @@
 	(sy_call_t *)sys_readlink },		/* 58 = readlink */
 	{ 0, 0, 0,
 	(sy_call_t *)rump_enosys },			/* 59 = unrumped */
-	{ 0, 0, 0,
-	(sy_call_t *)rump_enosys },			/* 60 = unrumped */
+	{ ns(struct sys_umask_args), 0,
+	(sy_call_t *)sys_umask },			/* 60 = umask */
 	{ ns(struct sys_chroot_args), 0,
 	(sy_call_t *)sys_chroot },			/* 61 = chroot */
 	{ 0, 0, 0,



CVS commit: src/sys/kern

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 20:00:09 UTC 2010

Modified Files:
src/sys/kern: syscalls.master

Log Message:
rump umask


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/sys/kern/syscalls.master

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/syscalls.master
diff -u src/sys/kern/syscalls.master:1.236 src/sys/kern/syscalls.master:1.237
--- src/sys/kern/syscalls.master:1.236	Mon Aug 30 10:32:54 2010
+++ src/sys/kern/syscalls.master	Mon Sep  6 20:00:09 2010
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.236 2010/08/30 10:32:54 pooka Exp $
+	$NetBSD: syscalls.master,v 1.237 2010/09/06 20:00:09 pooka Exp $
 
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
 
@@ -152,7 +152,7 @@
 			size_t count); }
 59	STD 		{ int|sys||execve(const char *path, \
 			char * const *argp, char * const *envp); }
-60	STD 		{ mode_t|sys||umask(mode_t newmask); }
+60	STD 	 RUMP	{ mode_t|sys||umask(mode_t newmask); }
 61	STD 	 RUMP	{ int|sys||chroot(const char *path); }
 62	COMPAT_43 MODULAR { int|sys||fstat(int fd, struct stat43 *sb); } fstat43
 63	COMPAT_43 MODULAR { int|sys||getkerninfo(int op, char *where, int *size, \



CVS commit: src/lib/libc/sys

2010-09-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep  6 19:48:38 UTC 2010

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

Log Message:
O_NOFOLLOW is not a non-standard extension any longer (2, 6 years? who counts).


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/lib/libc/sys/open.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/open.2
diff -u src/lib/libc/sys/open.2:1.44 src/lib/libc/sys/open.2:1.45
--- src/lib/libc/sys/open.2:1.44	Mon Sep  6 15:22:09 2010
+++ src/lib/libc/sys/open.2	Mon Sep  6 19:48:38 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: open.2,v 1.44 2010/09/06 15:22:09 wiz Exp $
+.\"	$NetBSD: open.2,v 1.45 2010/09/06 19:48:38 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -361,10 +361,9 @@
 .St -p1003.1b-93 .
 .Pp
 The
-.Dv O_SHLOCK ,
-.Dv O_EXLOCK ,
+.Dv O_SHLOCK
 and
-.Dv O_NOFOLLOW
+.Dv O_EXLOCK
 flags are non-standard extensions and should not be used if portability
 is of concern.
 .Sh HISTORY



CVS commit: src/lib/libc/stdio

2010-09-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep  6 19:47:38 UTC 2010

Modified Files:
src/lib/libc/stdio: printf.3

Log Message:
I assume "POSIX 200805" is IEEE Std 1003.1-2008 (POSIX.1), so use
appropriate .St.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/stdio/printf.3

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/stdio/printf.3
diff -u src/lib/libc/stdio/printf.3:1.53 src/lib/libc/stdio/printf.3:1.54
--- src/lib/libc/stdio/printf.3:1.53	Mon Sep  6 14:52:55 2010
+++ src/lib/libc/stdio/printf.3	Mon Sep  6 19:47:37 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: printf.3,v 1.53 2010/09/06 14:52:55 christos Exp $
+.\"	$NetBSD: printf.3,v 1.54 2010/09/06 19:47:37 wiz Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -829,7 +829,9 @@
 .Fn dprintf
 and
 .Fn vdprintf
-are parts of POSIX 200805 and appeared in
+are parts of
+.St -p1003.1-2008
+and appeared in
 .Nx 6.0 .
 .Sh CAVEATS
 Because



CVS commit: src/sys/rump/include/rump

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 18:43:29 UTC 2010

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

Log Message:
add a few more system calls


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/rump/include/rump/rump.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.h
diff -u src/sys/rump/include/rump/rump.h:1.44 src/sys/rump/include/rump/rump.h:1.45
--- src/sys/rump/include/rump/rump.h:1.44	Tue May 11 20:09:11 2010
+++ src/sys/rump/include/rump/rump.h	Mon Sep  6 18:43:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.h,v 1.44 2010/05/11 20:09:11 pooka Exp $	*/
+/*	$NetBSD: rump.h,v 1.45 2010/09/06 18:43:28 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -141,6 +141,7 @@
 
 #ifdef RUMP_SYS_IOCTL
 #define ioctl(...) rump_sys_ioctl(__VA_ARGS__)
+#define fnctl(...) rump_sys_fcntl(__VA_ARGS__)
 #endif /* RUMP_SYS_IOCTL */
 
 #ifdef RUMP_SYS_CLOSE
@@ -169,6 +170,29 @@
 #define symlink(a,b) rump_sys_symlink(a,b)
 #define unlink(a) rump_sys_unlink(a)
 #define readlink(a,b,c) rump_sys_readlink(a,b,c)
+#define chdir(a) rump_sys_chdir(a)
+#define fsync(a) rump_sys_fsync(a)
+#define sync() rump_sys_sync()
+#define chown(a,b,c) rump_sys_chown(a,b,c)
+#define fchown(a,b,c) rump_sys_fchown(a,b,c)
+#define lchown(a,b,c) rump_sys_lchown(a,b,c)
+#define lseek(a,b,c) rump_sys_lseek(a,b,c)
+#define mknod(a,b,c) rump_sys_mknod(a,b,c)
+#define rename(a,b) rump_sys_rename(a,b)
+#define truncate(a,b) rump_sys_truncate(a,b)
+#define ftruncate(a,b) rump_sys_ftruncate(a,b)
+#define umask(a) rump_sys_umask(a)
+#define getdents(a,b,c) rump_sys_getdents(a,b,c)
 #endif /* RUMP_SYS_FILEOPS */
 
+#ifdef RUMP_SYS_STAT
+#define stat(a,b) rump_sys_stat(a,b)
+#define fstat(a,b) rump_sys_fstat(a,b)
+#define lstat(a,b) rump_sys_lstat(a,b)
+#endif /* RUMP_SYS_STAT */
+
+#ifdef RUMP_SYS_PROCOPS
+#define getpid() rump_sys_getpid()
+#endif /* RUMP_SYS_PROCOPS */
+
 #endif /* _RUMP_RUMP_H_ */



CVS commit: src/crypto/external/bsd/netpgp/dist

2010-09-06 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Sep  6 18:19:39 UTC 2010

Modified Files:
src/crypto/external/bsd/netpgp/dist/include: netpgp.h
src/crypto/external/bsd/netpgp/dist/src/lib: netpgp.c

Log Message:
Add a utility function, netpgp_write_sshkey(3), which will take a PGP public
key (RSA only) and format it as an ssh pubkey.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 \
src/crypto/external/bsd/netpgp/dist/include/netpgp.h
cvs rdiff -u -r1.73 -r1.74 \
src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/include/netpgp.h
diff -u src/crypto/external/bsd/netpgp/dist/include/netpgp.h:1.20 src/crypto/external/bsd/netpgp/dist/include/netpgp.h:1.21
--- src/crypto/external/bsd/netpgp/dist/include/netpgp.h:1.20	Thu Sep  2 06:00:11 2010
+++ src/crypto/external/bsd/netpgp/dist/include/netpgp.h	Mon Sep  6 18:19:38 2010
@@ -101,6 +101,10 @@
 
 int netpgp_validate_sigs(netpgp_t *);
 
+/* save pgp key in ssh format */
+int netpgp_write_sshkey(netpgp_t *, char *, const char *, char *, size_t);
+
+
 __END_DECLS
 
 #endif /* !NETPGP_H_ */

Index: src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.73 src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.74
--- src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c:1.73	Thu Sep  2 07:31:16 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c	Mon Sep  6 18:19:38 2010
@@ -34,7 +34,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: netpgp.c,v 1.73 2010/09/02 07:31:16 agc Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.74 2010/09/06 18:19:38 agc Exp $");
 #endif
 
 #include 
@@ -621,6 +621,69 @@
 	p(fp, "\n", NULL);
 }
 
+/* save a pgp pubkey to a temp file */
+static int
+savepubkey(char *res, char *f, size_t size)
+{
+	size_t	len;
+	int	cc;
+	int	wc;
+	int	fd;
+
+	(void) snprintf(f, size, "/tmp/pgp2ssh.XXX");
+	if ((fd = mkstemp(f)) < 0) {
+		(void) fprintf(stderr, "can't create temp file '%s'\n", f);
+		return 0;
+	}
+	len = strlen(res);
+	for (cc = 0 ; (wc = write(fd, &res[cc], len - cc)) > 0 ; cc += wc) {
+	}
+	(void) close(fd);
+	return 1;
+}
+
+/* format a uint32_t */
+static int
+formatu32(uint8_t *buffer, uint32_t value)
+{
+	buffer[0] = (uint8_t)(value >> 24) & 0xff;
+	buffer[1] = (uint8_t)(value >> 16) & 0xff;
+	buffer[2] = (uint8_t)(value >> 8) & 0xff;
+	buffer[3] = (uint8_t)value & 0xff;
+	return sizeof(uint32_t);
+}
+
+/* format a string as (len, string) */
+static int
+formatstring(char *buffer, const uint8_t *s, size_t len)
+{
+	int	cc;
+
+	cc = formatu32((uint8_t *)buffer, len);
+	(void) memcpy(&buffer[cc], s, len);
+	return cc + len;
+}
+
+/* format a bignum, checking for "interesting" high bit values */
+static int
+formatbignum(char *buffer, BIGNUM *bn)
+{
+	size_t	 len;
+	uint8_t	*cp;
+	int	 cc;
+
+	len = (size_t) BN_num_bytes(bn);
+	if ((cp = calloc(1, len + 1)) == NULL) {
+		(void) fprintf(stderr, "calloc failure in formatbignum\n");
+		return 0;
+	}
+	(void) BN_bn2bin(bn, cp + 1);
+	cp[0] = 0x0;
+	cc = (cp[1] & 0x80) ? formatstring(buffer, cp, len + 1) : formatstring(buffer, &cp[1], len);
+	free(cp);
+	return cc;
+}
+
 /***/
 /* exported functions start here */
 /***/
@@ -1665,3 +1728,59 @@
 	mj_delete(&ids);
 	return idc;
 }
+
+/* find a key in keyring, and write it in ssh format */
+int
+netpgp_write_sshkey(netpgp_t *netpgp, char *s, const char *userid, char *out, size_t size)
+{
+	const __ops_key_t	*key;
+	__ops_keyring_t		*keyring;
+	__ops_io_t		*io;
+	unsigned		 k;
+	size_t			 cc;
+	char			 f[MAXPATHLEN];
+
+	if ((io = calloc(1, sizeof(__ops_io_t))) == NULL) {
+		(void) fprintf(stderr, "netpgp_save_sshpub: bad alloc 1\n");
+		return 0;
+	}
+	io->outs = stdout;
+	io->errs = stderr;
+	io->res = stderr;
+	netpgp->io = io;
+	/* write new to temp file */
+	savepubkey(s, f, sizeof(f));
+	if ((keyring = calloc(1, sizeof(*keyring))) == NULL) {
+		(void) fprintf(stderr, "netpgp_save_sshpub: bad alloc 2\n");
+		return 0;
+	}
+	if (!__ops_keyring_fileread(netpgp->pubring = keyring, 1, f)) {
+		(void) fprintf(stderr, "can't import key\n");
+		return 0;
+	}
+	/* get rsa key */
+	k = 0;
+	key = __ops_getnextkeybyname(netpgp->io, netpgp->pubring, userid, &k);
+	if (key == NULL) {
+		(void) fprintf(stderr, "no key found for '%s'\n", userid);
+		return 0;
+	}
+	if (key->key.pubkey.alg != OPS_PKA_RSA) {
+		/* we're not interested in supporting DSA either :-) */
+		(void) fprintf(stderr, "key not RSA '%s'\n", userid);
+		return 0;
+	}
+	/* XXX - check trust sigs */
+	/* XXX - check expiry */
+	/* XXX - check start */
+	/* XXX - check not w

CVS commit: src/crypto/external/bsd/netpgp/pgp2ssh

2010-09-06 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Sep  6 18:17:58 UTC 2010

Added Files:
src/crypto/external/bsd/netpgp/pgp2ssh: Makefile

Log Message:
Add a reachover Makefile for pgp2ssh(1). This utility has not yet been
hooked into the build infrastructure.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/netpgp/pgp2ssh/Makefile

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

Added files:

Index: src/crypto/external/bsd/netpgp/pgp2ssh/Makefile
diff -u /dev/null src/crypto/external/bsd/netpgp/pgp2ssh/Makefile:1.1
--- /dev/null	Mon Sep  6 18:17:58 2010
+++ src/crypto/external/bsd/netpgp/pgp2ssh/Makefile	Mon Sep  6 18:17:58 2010
@@ -0,0 +1,27 @@
+#	$NetBSD: Makefile,v 1.1 2010/09/06 18:17:58 agc Exp $
+
+.include 
+
+PROG=		pgp2ssh
+BINDIR=		/usr/bin
+
+SRCS=		b64.c hkpc.c main.c
+CPPFLAGS+=	-I${.CURDIR}/../dist/include -I${.CURDIR}/../dist/src/hkpclient
+
+LIBNETPGPDIR!=	cd ${.CURDIR}/../lib && ${PRINTOBJDIR}
+LDADD+=		-L${LIBNETPGPDIR} -lnetpgp
+DPADD+=		${LIBNETPGPDIR}/libnetpgp.a
+
+LIBMJDIR!=	cd ${.CURDIR}/../libmj && ${PRINTOBJDIR}
+LDADD+=		-L${LIBMJDIR} -lmj
+DPADD+=		${LIBMJDIR}/libmj.a
+
+LDADD+=		-lcrypto -lz -lbz2
+DPADD+=		${LIBCRYPTO} ${LIBZ} ${LIBBZ2}
+
+MAN=		pgp2ssh.1
+WARNS=		0
+
+.PATH: ${.CURDIR}/../dist/src/pgp2ssh ${.CURDIR}/../dist/src/hkpclient
+
+.include 



CVS commit: src/crypto/external/bsd/netpgp/dist/src/pgp2ssh

2010-09-06 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Sep  6 18:16:52 UTC 2010

Added Files:
src/crypto/external/bsd/netpgp/dist/src/pgp2ssh: b64.c b64.h main.c
pgp2ssh.1

Log Message:
Add pgp2ssh, a utility to retrieve PGP keys via HKP, and to store the keys
in ssh format. In combination with hkpd (using ssh key files), this utility
can be used to distribute ssh pubkey files to remote computers using the
HKP protocol.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/b64.c \
src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/b64.h \
src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/main.c \
src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/pgp2ssh.1

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

Added files:

Index: src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/b64.c
diff -u /dev/null src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/b64.c:1.1
--- /dev/null	Mon Sep  6 18:16:52 2010
+++ src/crypto/external/bsd/netpgp/dist/src/pgp2ssh/b64.c	Mon Sep  6 18:16:52 2010
@@ -0,0 +1,339 @@
+/*\
+
+MODULE NAME:b64.c
+
+AUTHOR: Bob Trower 08/04/01
+
+PROJECT:Crypt Data Packaging
+
+COPYRIGHT:  Copyright (c) Trantor Standard Systems Inc., 2001
+
+NOTE:   This source code may be used as you wish, subject to
+the MIT license.  See the LICENCE section below.
+
+DESCRIPTION:
+This little utility implements the Base64
+Content-Transfer-Encoding standard described in
+RFC1113 (http://www.faqs.org/rfcs/rfc1113.html).
+
+This is the coding scheme used by MIME to allow
+binary data to be transferred by SMTP mail.
+
+Groups of 3 bytes from a binary stream are coded as
+groups of 4 bytes in a text stream.
+
+The input stream is 'padded' with zeros to create
+an input that is an even multiple of 3.
+
+A special character ('=') is used to denote padding so
+that the stream can be decoded back to its exact size.
+
+Encoded output is formatted in lines which should
+be a maximum of 72 characters to conform to the
+specification.  This program defaults to 72 characters,
+but will allow more or less through the use of a
+switch.  The program enforces a minimum line size
+of 4 characters.
+
+Example encoding:
+
+The stream 'ABCD' is 32 bits long.  It is mapped as
+follows:
+
+ABCD
+
+ A (65) B (66) C (67) D (68)   (None) (None)
+0101   0110   0111   01000100
+
+16 (Q)  20 (U)  9 (J)   3 (D)17 (R) 0 (A)  NA (=) NA (=)
+01  010100  001001  11   010001 00 00 00
+
+
+QUJDRA==
+
+Decoding is the process in reverse.  A 'decode' lookup
+table has been created to avoid string scans.
+
+DESIGN GOALS:	Specifically:
+		Code is a stand-alone utility to perform base64
+		encoding/decoding. It should be genuinely useful
+		when the need arises and it meets a need that is
+		likely to occur for some users.
+		Code acts as sample code to show the author's
+		design and coding style.
+
+		Generally:
+		This program is designed to survive:
+		Everything you need is in a single source file.
+		It compiles cleanly using a vanilla ANSI C compiler.
+		It does its job correctly with a minimum of fuss.
+		The code is not overly clever, not overly simplistic
+		and not overly verbose.
+		Access is 'cut and paste' from a web page.
+		Terms of use are reasonable.
+
+VALIDATION: Non-trivial code is never without errors.  This
+file likely has some problems, since it has only
+been tested by the author.  It is expected with most
+source code that there is a period of 'burn-in' when
+problems are identified and corrected.  That being
+said, it is possible to have 'reasonably correct'
+code by following a regime of unit test that covers
+the most likely cases and regression testing prior
+to release.  This has been done with this code and
+it has a good probability of performing as expected.
+
+Unit Test Cases:
+
+case 0:empty file:
+CASE0.DAT  ->  ->
+(Zero length target file created
+on both encode and decode.)
+
+case 1:One input character:
+CASE1.DAT A -> QQ== -> A
+
+case 2:Two input characters:
+CASE2

CVS commit: src/sys/rump/librump/rumpvfs

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 18:03:57 UTC 2010

Modified Files:
src/sys/rump/librump/rumpvfs: rumpblk.c

Log Message:
Broadcast instead of signal since the condition is a boolean.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/rump/librump/rumpvfs/rumpblk.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/rump/librump/rumpvfs/rumpblk.c
diff -u src/sys/rump/librump/rumpvfs/rumpblk.c:1.41 src/sys/rump/librump/rumpvfs/rumpblk.c:1.42
--- src/sys/rump/librump/rumpvfs/rumpblk.c:1.41	Mon Jun 21 14:25:35 2010
+++ src/sys/rump/librump/rumpvfs/rumpblk.c	Mon Sep  6 18:03:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpblk.c,v 1.41 2010/06/21 14:25:35 pooka Exp $	*/
+/*	$NetBSD: rumpblk.c,v 1.42 2010/09/06 18:03:57 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpblk.c,v 1.41 2010/06/21 14:25:35 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpblk.c,v 1.42 2010/09/06 18:03:57 pooka Exp $");
 
 #include 
 #include 
@@ -272,7 +272,7 @@
 	mutex_enter(&rblk->rblk_memmtx);
 	if (--win->win_refcnt == 0 && rblk->rblk_waiting) {
 		rblk->rblk_waiting = false;
-		cv_signal(&rblk->rblk_memcv);
+		cv_broadcast(&rblk->rblk_memcv);
 	}
 	KASSERT(win->win_refcnt >= 0);
 	mutex_exit(&rblk->rblk_memmtx);



CVS commit: src/sys/rump/librump/rumpvfs

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 17:56:56 UTC 2010

Modified Files:
src/sys/rump/librump/rumpvfs: vm_vfs.c

Log Message:
pager wants truncated offsets


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/rump/librump/rumpvfs/vm_vfs.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/rump/librump/rumpvfs/vm_vfs.c
diff -u src/sys/rump/librump/rumpvfs/vm_vfs.c:1.18 src/sys/rump/librump/rumpvfs/vm_vfs.c:1.19
--- src/sys/rump/librump/rumpvfs/vm_vfs.c:1.18	Mon Sep  6 17:32:38 2010
+++ src/sys/rump/librump/rumpvfs/vm_vfs.c	Mon Sep  6 17:56:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_vfs.c,v 1.18 2010/09/06 17:32:38 pooka Exp $	*/
+/*	$NetBSD: vm_vfs.c,v 1.19 2010/09/06 17:56:56 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.18 2010/09/06 17:32:38 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.19 2010/09/06 17:56:56 pooka Exp $");
 
 #include 
 
@@ -107,8 +107,9 @@
 		npages = MIN(maxpages, round_page(len) >> PAGE_SHIFT);
 		memset(pgs, 0, npages * sizeof(struct vm_page *));
 		mutex_enter(&uobj->vmobjlock);
-		rv = uobj->pgops->pgo_get(uobj, off, pgs, &npages, 0, 
-		VM_PROT_READ | VM_PROT_WRITE, 0, PAGERFLAGS | PGO_PASTEOF);
+		rv = uobj->pgops->pgo_get(uobj, trunc_page(off),
+		pgs, &npages, 0, VM_PROT_READ | VM_PROT_WRITE,
+		0, PAGERFLAGS | PGO_PASTEOF);
 		KASSERT(npages > 0);
 
 		for (i = 0; i < npages; i++) {



CVS commit: src/lib/libc/include

2010-09-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Sep  6 17:49:56 UTC 2010

Modified Files:
src/lib/libc/include: namespace.h

Log Message:
New vdprintf needs "namespace protection".


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/lib/libc/include/namespace.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/include/namespace.h
diff -u src/lib/libc/include/namespace.h:1.142 src/lib/libc/include/namespace.h:1.143
--- src/lib/libc/include/namespace.h:1.142	Sun Apr 25 00:54:46 2010
+++ src/lib/libc/include/namespace.h	Mon Sep  6 17:49:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: namespace.h,v 1.142 2010/04/25 00:54:46 joerg Exp $	*/
+/*	$NetBSD: namespace.h,v 1.143 2010/09/06 17:49:56 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -669,6 +669,7 @@
 #define uuid_create_nil		_uuid_create_nil
 #define uuid_is_nil		_uuid_is_nil
 #define valloc			_valloc
+#define vdprintf		_vdprintf
 #define vis			_vis
 #ifndef vsnprintf
 #define vsnprintf		_vsnprintf



CVS commit: src/sys/rump/librump/rumpvfs

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 17:32:38 UTC 2010

Modified Files:
src/sys/rump/librump/rumpvfs: vm_vfs.c

Log Message:
simplify and fix len-to-npages calculation


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/rump/librump/rumpvfs/vm_vfs.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/rump/librump/rumpvfs/vm_vfs.c
diff -u src/sys/rump/librump/rumpvfs/vm_vfs.c:1.17 src/sys/rump/librump/rumpvfs/vm_vfs.c:1.18
--- src/sys/rump/librump/rumpvfs/vm_vfs.c:1.17	Thu Aug 19 02:07:11 2010
+++ src/sys/rump/librump/rumpvfs/vm_vfs.c	Mon Sep  6 17:32:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_vfs.c,v 1.17 2010/08/19 02:07:11 pooka Exp $	*/
+/*	$NetBSD: vm_vfs.c,v 1.18 2010/09/06 17:32:38 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.17 2010/08/19 02:07:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.18 2010/09/06 17:32:38 pooka Exp $");
 
 #include 
 
@@ -132,10 +132,8 @@
 	return;
 }
 
-/* dumdidumdum */
 #define len2npages(off, len)		\
-  (len) + PAGE_MASK) & ~(PAGE_MASK)) >> PAGE_SHIFT)			\
-+ (((off & PAGE_MASK) + (len & PAGE_MASK)) > PAGE_SIZE))
+((round_page(off+len) - trunc_page(off)) >> PAGE_SHIFT)
 
 int
 ubc_uiomove(struct uvm_object *uobj, struct uio *uio, vsize_t todo,



CVS commit: src/doc

2010-09-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Sep  6 16:03:56 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
acpi(4): The ACPI driver will no longer attach if the BIOS release
year is 2000 or older. To override this behaviour, set
acpi_force_load=1 or add options ACPI_BLACKLIST_YEAR=0 to your
kernel config. [jmcneill 20100906]


To generate a diff of this commit:
cvs rdiff -u -r1.1434 -r1.1435 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/CHANGES
diff -u src/doc/CHANGES:1.1434 src/doc/CHANGES:1.1435
--- src/doc/CHANGES:1.1434	Tue Aug 31 19:08:50 2010
+++ src/doc/CHANGES	Mon Sep  6 16:03:56 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1434 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1435 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -715,3 +715,7 @@
 		[kardel 20100827]
 	omapfb: a simple driver for OMAP 3xxx on-chip video, especially the
 		Beagleboard [macallan 20100831]
+	acpi(4): The ACPI driver will no longer attach if the BIOS release
+		year is 2000 or older. To override this behaviour, set
+		acpi_force_load=1 or add options ACPI_BLACKLIST_YEAR=0 to your
+		kernel config. [jmcneill 20100906]



CVS commit: src/share/man/man4

2010-09-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Sep  6 16:01:25 UTC 2010

Modified Files:
src/share/man/man4: acpi.4

Log Message:
document ACPI_BLACKLIST_YEAR


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/share/man/man4/acpi.4

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/man4/acpi.4
diff -u src/share/man/man4/acpi.4:1.57 src/share/man/man4/acpi.4:1.58
--- src/share/man/man4/acpi.4:1.57	Sat Sep  4 11:10:16 2010
+++ src/share/man/man4/acpi.4	Mon Sep  6 16:01:25 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpi.4,v 1.57 2010/09/04 11:10:16 jmcneill Exp $
+.\" $NetBSD: acpi.4,v 1.58 2010/09/06 16:01:25 jmcneill Exp $
 .\"
 .\" Copyright (c) 2002, 2004, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 8, 2010
+.Dd September 6, 2010
 .Dt ACPI 4
 .Os
 .Sh NAME
@@ -38,6 +38,7 @@
 .Cd "options	ACPI_ACTIVATE_DEV"
 .Cd "options	ACPI_DSDT_OVERRIDE"
 .Cd "options	ACPI_DSDT_FILE=\*[q]\*[q]"
+.Cd "options	ACPI_BLACKLIST_YEAR=2000"
 .Sh DESCRIPTION
 .Nx
 provides machine-independent bus support for
@@ -94,6 +95,8 @@
 is not specified, default to
 .Dq dsdt.hex
 in the build directory.
+.It Dv ACPI_BLACKLIST_YEAR=2000
+Do not use ACPI with any BIOS made on or before the specified year.
 .El
 .Sh SYSCTL SUPPORT
 Few



CVS commit: src/sys

2010-09-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Sep  6 15:54:27 UTC 2010

Modified Files:
src/sys/arch/x86/x86: platform.c
src/sys/dev/acpi: acpi.c acpi_quirks.c acpivar.h files.acpi

Log Message:
Add support for blacklisting ACPI BIOS implementations by year. By default,
don't use ACPI on BIOS which advertise release years <= 2000. This
can be changed by setting option ACPI_BLACKLIST_YEAR=0 or by setting
acpi_force_load=1.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/x86/platform.c
cvs rdiff -u -r1.218 -r1.219 src/sys/dev/acpi/acpi.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/acpi/acpi_quirks.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/acpi/acpivar.h
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/acpi/files.acpi

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/x86/x86/platform.c
diff -u src/sys/arch/x86/x86/platform.c:1.8 src/sys/arch/x86/x86/platform.c:1.9
--- src/sys/arch/x86/x86/platform.c:1.8	Tue Feb 17 21:15:19 2009
+++ src/sys/arch/x86/x86/platform.c	Mon Sep  6 15:54:27 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: platform.c,v 1.8 2009/02/17 21:15:19 ad Exp $ */
+/* $NetBSD: platform.c,v 1.9 2010/09/06 15:54:27 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "isa.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.8 2009/02/17 21:15:19 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.9 2010/09/06 15:54:27 jmcneill Exp $");
 
 #include 
 #include 
@@ -42,6 +42,7 @@
 
 void		platform_init(void);	/* XXX */
 static void	platform_add(struct smbtable *, const char *, int);
+static void	platform_add_date(struct smbtable *, const char *, int);
 static void	platform_print(void);
 
 void
@@ -49,6 +50,7 @@
 {
 	struct smbtable smbios;
 	struct smbios_sys *psys;
+	struct smbios_struct_bios *pbios;
 	struct smbios_slot *pslot;
 	int nisa, nother;
 
@@ -63,6 +65,15 @@
 	}
 
 	smbios.cookie = 0;
+	if (smbios_find_table(SMBIOS_TYPE_BIOS, &smbios)) {
+		pbios = smbios.tblhdr;
+
+		platform_add(&smbios, "firmware-vendor", pbios->vendor);
+		platform_add(&smbios, "firmware-version", pbios->version);
+		platform_add_date(&smbios, "firmware-date", pbios->release);
+	}
+
+	smbios.cookie = 0;
 	nisa = 0;
 	nother = 0;
 	while (smbios_find_table(SMBIOS_TYPE_SLOTS, &smbios)) {
@@ -118,3 +129,46 @@
 	if (smbios_get_string(tbl, idx, tmpbuf, 128) != NULL)
 		pmf_set_platform(key, tmpbuf);
 }
+
+static int
+platform_scan_date(char *buf, unsigned int *month, unsigned int *day,
+unsigned int *year)
+{
+	char *p, *s;
+
+	s = buf;
+	p = strchr(s, '/');
+	if (p) *p = '\0';
+	*month = strtoul(s, NULL, 10);
+	if (!p) return 1;
+
+	s = p + 1;
+	p = strchr(s, '/');
+	if (p) *p = '\0';
+	*day = strtoul(s, NULL, 10);
+	if (!p) return 2;
+
+	s = p + 1;
+	*year = strtoul(s, NULL, 10);
+	return 3;
+}
+
+static void
+platform_add_date(struct smbtable *tbl, const char *key, int idx)
+{
+	unsigned int month, day, year;
+	char tmpbuf[128], datestr[9];
+
+	if (smbios_get_string(tbl, idx, tmpbuf, 128) == NULL)
+		return;
+	if (platform_scan_date(tmpbuf, &month, &day, &year) != 3)
+		return;
+	if (month == 0 || month > 12 || day == 0 || day > 31)
+		return;
+	if (year < 100)
+		year += 1900;
+	if (year > )
+		return;
+	sprintf(datestr, "%04u%02u%02u", year, month, day);
+	pmf_set_platform(key, datestr);
+}

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.218 src/sys/dev/acpi/acpi.c:1.219
--- src/sys/dev/acpi/acpi.c:1.218	Tue Aug 24 04:36:02 2010
+++ src/sys/dev/acpi/acpi.c	Mon Sep  6 15:54:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.218 2010/08/24 04:36:02 pgoyette Exp $	*/
+/*	$NetBSD: acpi.c,v 1.219 2010/09/06 15:54:26 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.218 2010/08/24 04:36:02 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.219 2010/09/06 15:54:26 jmcneill Exp $");
 
 #include "opt_acpi.h"
 #include "opt_pcifixup.h"
@@ -333,6 +333,13 @@
 		AcpiTerminate();
 		return 0;
 	}
+	if (acpi_force_load == 0 && (acpi_find_quirks() & ACPI_QUIRK_OLDBIOS)) {
+		aprint_normal("ACPI: BIOS is too old (%s). Set acpi_force_load to use.\n",
+		pmf_get_platform("firmware-date"));
+		acpi_unmap_rsdt(rsdt);
+		AcpiTerminate();
+		return 0;
+	}
 
 	acpi_unmap_rsdt(rsdt);
 

Index: src/sys/dev/acpi/acpi_quirks.c
diff -u src/sys/dev/acpi/acpi_quirks.c:1.17 src/sys/dev/acpi/acpi_quirks.c:1.18
--- src/sys/dev/acpi/acpi_quirks.c:1.17	Mon Sep  6 14:09:54 2010
+++ src/sys/dev/acpi/acpi_quirks.c	Mon Sep  6 15:54:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_quirks.c,v 1.17 2010/09/06 14:09:54 jakllsch Exp $	*/
+/*	$NetBSD: acpi_quirks.c,v 1.18 2010/09/06 15:54:27 jmcneill Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: acpi_quirks.c,v 1.17 2010/09/

CVS commit: src/tests/fs/vfs

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 15:27:18 UTC 2010

Modified Files:
src/tests/fs/vfs: t_vnops.c

Log Message:
fill in PR number: kern/43843


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/vfs/t_vnops.c

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

Modified files:

Index: src/tests/fs/vfs/t_vnops.c
diff -u src/tests/fs/vfs/t_vnops.c:1.7 src/tests/fs/vfs/t_vnops.c:1.8
--- src/tests/fs/vfs/t_vnops.c:1.7	Mon Sep  6 15:21:34 2010
+++ src/tests/fs/vfs/t_vnops.c	Mon Sep  6 15:27:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_vnops.c,v 1.7 2010/09/06 15:21:34 pooka Exp $	*/
+/*	$NetBSD: t_vnops.c,v 1.8 2010/09/06 15:27:18 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -449,6 +449,11 @@
 	USES_SYMLINKS;
 
 	RL(rump_sys_chdir(mp));
+
+	if (FSTYPE_TMPFS(tc)) {
+		atf_tc_expect_signal(SIGABRT, "PR kern/43843");
+	}
+
 	RL(rump_sys_symlink("", "afile"));
 	RL(rump_sys_chdir("/"));
 }



CVS commit: src/lib/libc/sys

2010-09-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep  6 15:22:09 UTC 2010

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

Log Message:
Note a difference to IEEE Std 2003.1-2008. Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/lib/libc/sys/open.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/open.2
diff -u src/lib/libc/sys/open.2:1.43 src/lib/libc/sys/open.2:1.44
--- src/lib/libc/sys/open.2:1.43	Sun Sep  5 22:44:15 2010
+++ src/lib/libc/sys/open.2	Mon Sep  6 15:22:09 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: open.2,v 1.43 2010/09/05 22:44:15 wiz Exp $
+.\"	$NetBSD: open.2,v 1.44 2010/09/06 15:22:09 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)open.2	8.2 (Berkeley) 11/16/93
 .\"
-.Dd September 5, 2010
+.Dd September 6, 2010
 .Dt OPEN 2
 .Os
 .Sh NAME
@@ -261,6 +261,11 @@
 .It Bq Er EFTYPE
 .Dv O_NOFOLLOW
 was specified, but the last path component is a symlink.
+.Em Note :
+.St -p1003.1-2008
+specifies returning
+.Bq Er ELOOP
+for this case.
 .It Bq Er EINTR
 The
 .Fn open



CVS commit: src/tests/fs/vfs

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 15:21:34 UTC 2010

Modified Files:
src/tests/fs/vfs: t_vnops.c

Log Message:
symlink to a zero-len target (and watch tmpfs go kabloom)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/vfs/t_vnops.c

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

Modified files:

Index: src/tests/fs/vfs/t_vnops.c
diff -u src/tests/fs/vfs/t_vnops.c:1.6 src/tests/fs/vfs/t_vnops.c:1.7
--- src/tests/fs/vfs/t_vnops.c:1.6	Sun Aug  1 14:50:54 2010
+++ src/tests/fs/vfs/t_vnops.c	Mon Sep  6 15:21:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_vnops.c,v 1.6 2010/08/01 14:50:54 mlelstv Exp $	*/
+/*	$NetBSD: t_vnops.c,v 1.7 2010/09/06 15:21:34 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -44,6 +44,10 @@
 #define USES_DIRS \
 if (FSTYPE_SYSVBFS(tc)) atf_tc_skip("dirs not supported by file system")
 
+#define USES_SYMLINKS	\
+if (FSTYPE_SYSVBFS(tc) || FSTYPE_MSDOS(tc))		\
+	atf_tc_skip("dirs not supported by file system")
+
 static char *
 md(char *buf, const char *base, const char *tail)
 {
@@ -438,6 +442,17 @@
 	rump_sys_chdir("/");
 }
 
+static void
+symlink_zerolen(const atf_tc_t *tc, const char *mp)
+{
+
+	USES_SYMLINKS;
+
+	RL(rump_sys_chdir(mp));
+	RL(rump_sys_symlink("", "afile"));
+	RL(rump_sys_chdir("/"));
+}
+
 ATF_TC_FSAPPLY(lookup_simple, "simple lookup (./.. on root)");
 ATF_TC_FSAPPLY(lookup_complex, "lookup of non-dot entries");
 ATF_TC_FSAPPLY(dir_simple, "mkdir/rmdir");
@@ -447,6 +462,7 @@
 ATF_TC_FSAPPLY(rename_reg_nodir, "rename regular files, no subdirectories");
 ATF_TC_FSAPPLY(create_nametoolong, "create file with name too long");
 ATF_TC_FSAPPLY(rename_nametoolong, "rename to file with name too long");
+ATF_TC_FSAPPLY(symlink_zerolen, "symlink with 0-len target");
 
 ATF_TP_ADD_TCS(tp)
 {
@@ -460,6 +476,7 @@
 	ATF_TP_FSAPPLY(rename_reg_nodir);
 	ATF_TP_FSAPPLY(create_nametoolong);
 	ATF_TP_FSAPPLY(rename_nametoolong);
+	ATF_TP_FSAPPLY(symlink_zerolen);
 
 	return atf_no_error();
 }



CVS commit: src/sys/rump/librump/rumpvfs

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 15:07:33 UTC 2010

Modified Files:
src/sys/rump/librump/rumpvfs: rumpfs.c

Log Message:
renamelock is mandatory


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/rump/librump/rumpvfs/rumpfs.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/rump/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.64 src/sys/rump/librump/rumpvfs/rumpfs.c:1.65
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.64	Mon Sep  6 14:50:34 2010
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Mon Sep  6 15:07:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.64 2010/09/06 14:50:34 pooka Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.65 2010/09/06 15:07:33 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009  Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.64 2010/09/06 14:50:34 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.65 2010/09/06 15:07:33 pooka Exp $");
 
 #include 
 #include 
@@ -1195,6 +1195,8 @@
 	.vfs_snapshot =		(void *)eopnotsupp,
 	.vfs_extattrctl =	(void *)eopnotsupp,
 	.vfs_suspendctl =	(void *)eopnotsupp,
+	.vfs_renamelock_enter =	genfs_renamelock_enter,
+	.vfs_renamelock_exit =	genfs_renamelock_exit,
 	.vfs_opv_descs =	rump_opv_descs,
 	/* vfs_refcount */
 	/* vfs_list */



CVS commit: src/distrib/sets/lists/comp

2010-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  6 14:55:38 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
add dprintf and vdprintf


To generate a diff of this commit:
cvs rdiff -u -r1.1506 -r1.1507 src/distrib/sets/lists/comp/mi

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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1506 src/distrib/sets/lists/comp/mi:1.1507
--- src/distrib/sets/lists/comp/mi:1.1506	Thu Sep  2 08:29:49 2010
+++ src/distrib/sets/lists/comp/mi	Mon Sep  6 10:55:37 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1506 2010/09/02 12:29:49 pooka Exp $
+#	$NetBSD: mi,v 1.1507 2010/09/06 14:55:37 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5594,6 +5594,7 @@
 ./usr/share/man/cat3/dn_expand.0		comp-c-catman		.cat
 ./usr/share/man/cat3/dngettext.0		comp-c-catman		.cat
 ./usr/share/man/cat3/doupdate.0			comp-c-catman		.cat
+./usr/share/man/cat3/dprintf.0			comp-c-catman		.cat
 ./usr/share/man/cat3/drand48.0			comp-c-catman		.cat
 ./usr/share/man/cat3/dsa.0			comp-obsolete		obsolete
 ./usr/share/man/cat3/dup_field.0		comp-c-catman		.cat
@@ -8403,6 +8404,7 @@
 ./usr/share/man/cat3/valloc.0			comp-c-catman		.cat
 ./usr/share/man/cat3/varargs.0			comp-c-catman		.cat
 ./usr/share/man/cat3/vasprintf.0		comp-c-catman		.cat
+./usr/share/man/cat3/vdprintf.0			comp-c-catman		.cat
 ./usr/share/man/cat3/verr.0			comp-c-catman		.cat
 ./usr/share/man/cat3/verrx.0			comp-c-catman		.cat
 ./usr/share/man/cat3/vfprintf.0			comp-c-catman		.cat
@@ -11532,6 +11534,7 @@
 ./usr/share/man/html3/dn_expand.html		comp-c-htmlman		html
 ./usr/share/man/html3/dngettext.html		comp-c-htmlman		html
 ./usr/share/man/html3/doupdate.html		comp-c-htmlman		html
+./usr/share/man/html3/dprintf.html		comp-c-htmlman		html
 ./usr/share/man/html3/drand48.html		comp-c-htmlman		html
 ./usr/share/man/html3/dup_field.html		comp-c-htmlman		html
 ./usr/share/man/html3/dupwin.html		comp-c-htmlman		html
@@ -14257,6 +14260,7 @@
 ./usr/share/man/html3/valloc.html		comp-c-htmlman		html
 ./usr/share/man/html3/varargs.html		comp-c-htmlman		html
 ./usr/share/man/html3/vasprintf.html		comp-c-htmlman		html
+./usr/share/man/html3/vdprintf.html		comp-c-htmlman		html
 ./usr/share/man/html3/verr.html			comp-c-htmlman		html
 ./usr/share/man/html3/verrx.html		comp-c-htmlman		html
 ./usr/share/man/html3/vfprintf.html		comp-c-htmlman		html
@@ -17378,6 +17382,7 @@
 ./usr/share/man/man3/dn_expand.3		comp-c-man		.man
 ./usr/share/man/man3/dngettext.3		comp-c-man		.man
 ./usr/share/man/man3/doupdate.3			comp-c-man		.man
+./usr/share/man/man3/dprintf.3			comp-c-man		.man
 ./usr/share/man/man3/drand48.3			comp-c-man		.man
 ./usr/share/man/man3/dsa.3			comp-obsolete		obsolete
 ./usr/share/man/man3/dup_field.3		comp-c-man		.man
@@ -20183,6 +20188,7 @@
 ./usr/share/man/man3/valloc.3			comp-c-man		.man
 ./usr/share/man/man3/varargs.3			comp-c-man		.man
 ./usr/share/man/man3/vasprintf.3		comp-c-man		.man
+./usr/share/man/man3/vdprintf.3			comp-c-man		.man
 ./usr/share/man/man3/verr.3			comp-c-man		.man
 ./usr/share/man/man3/verrx.3			comp-c-man		.man
 ./usr/share/man/man3/vfprintf.3			comp-c-man		.man



CVS commit: src/lib/libc/stdio

2010-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  6 14:52:55 UTC 2010

Modified Files:
src/lib/libc/stdio: Makefile.inc findfp.c local.h printf.3
Added Files:
src/lib/libc/stdio: dprintf.c vdprintf.c

Log Message:
add dprintf and vdprintf


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/stdio/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/stdio/dprintf.c \
src/lib/libc/stdio/vdprintf.c
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/stdio/findfp.c \
src/lib/libc/stdio/local.h
cvs rdiff -u -r1.52 -r1.53 src/lib/libc/stdio/printf.3

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/stdio/Makefile.inc
diff -u src/lib/libc/stdio/Makefile.inc:1.36 src/lib/libc/stdio/Makefile.inc:1.37
--- src/lib/libc/stdio/Makefile.inc:1.36	Mon Jul 13 18:19:25 2009
+++ src/lib/libc/stdio/Makefile.inc	Mon Sep  6 10:52:55 2010
@@ -1,25 +1,25 @@
 #	from: @(#)Makefile.inc	5.7 (Berkeley) 6/27/91
-#	$NetBSD: Makefile.inc,v 1.36 2009/07/13 22:19:25 roy Exp $
+#	$NetBSD: Makefile.inc,v 1.37 2010/09/06 14:52:55 christos Exp $
 
 # stdio sources
 .PATH: ${.CURDIR}/stdio
 
 CPPFLAGS+=-DWIDE_DOUBLE
 
-SRCS+=	asprintf.c clrerr.c fclose.c fdopen.c feof.c ferror.c fflush.c \
-	fgetc.c fgetln.c fgetpos.c fgets.c fgetstr.c fgetwc.c fgetwln.c \
-	fgetws.c fileno.c findfp.c flags.c flockfile.c fopen.c fparseln.c \
-	fprintf.c fpurge.c fputc.c fputs.c fputwc.c fputws.c fread.c \
-	freopen.c fscanf.c fseek.c fseeko.c fsetpos.c ftell.c ftello.c \
+SRCS+=	asprintf.c clrerr.c dprintf.c fclose.c fdopen.c feof.c ferror.c \
+	fflush.c fgetc.c fgetln.c fgetpos.c fgets.c fgetstr.c fgetwc.c \
+	fgetwln.c fgetws.c fileno.c findfp.c flags.c flockfile.c fopen.c \
+	fparseln.c fprintf.c fpurge.c fputc.c fputs.c fputwc.c fputws.c \
+	fread.c freopen.c fscanf.c fseek.c fseeko.c fsetpos.c ftell.c ftello.c \
 	funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwrite.c fwscanf.c \
 	getc.c getchar.c getdelim.c getline.c gettemp.c getw.c getwc.c \
 	getwchar.c makebuf.c mkdtemp.c mkstemp.c perror.c printf.c putc.c \
 	putchar.c puts.c putw.c putwc.c putwchar.c refill.c remove.c rewind.c \
 	rget.c scanf.c setbuf.c setbuffer.c setvbuf.c snprintf.c snprintf_ss.c \
 	sscanf.c stdio.c swprintf.c swscanf.c tmpfile.c ungetc.c ungetwc.c \
-	vasprintf.c vfprintf.c vfscanf.c vfwprintf.c vfwscanf.c vprintf.c \
-	vscanf.c vsnprintf.c vsnprintf_ss.c vsscanf.c vswprintf.c vswscanf.c \
-	vwprintf.c vwscanf.c wbuf.c wprintf.c wscanf.c wsetup.c
+	vasprintf.c vdprintf.c vfprintf.c vfscanf.c vfwprintf.c vfwscanf.c \
+	vprintf.c vscanf.c vsnprintf.c vsnprintf_ss.c vsscanf.c vswprintf.c \
+	vswscanf.c vwprintf.c vwscanf.c wbuf.c wprintf.c wscanf.c wsetup.c
 
 .if !defined(AUDIT)
 SRCS+=	gets.c sprintf.c vsprintf.c tempnam.c tmpnam.c mktemp.c
@@ -50,7 +50,8 @@
 MLINKS+=mktemp.3 mkdtemp.3 mktemp.3 mkstemp.3
 MLINKS+=printf.3 asprintf.3 printf.3 fprintf.3 printf.3 snprintf.3 \
 	printf.3 sprintf.3 printf.3 vasprintf.3 printf.3 vfprintf.3 \
-	printf.3 vprintf.3 printf.3 vsnprintf.3 printf.3 vsprintf.3 
+	printf.3 vprintf.3 printf.3 vsnprintf.3 printf.3 vsprintf.3 \
+	printf.3 dprintf.3 printf.3 vdprintf.3
 MLINKS+=putc.3 fputc.3 putc.3 putc_unlocked.3 putc.3 putchar.3 \
 	putc.3 putchar_unlocked.3 putc.3 putw.3
 MLINKS+=scanf.3 fscanf.3 scanf.3 sscanf.3 scanf.3 vfscanf.3 scanf.3 vscanf.3 \

Index: src/lib/libc/stdio/findfp.c
diff -u src/lib/libc/stdio/findfp.c:1.24 src/lib/libc/stdio/findfp.c:1.25
--- src/lib/libc/stdio/findfp.c:1.24	Mon Jan 11 15:39:29 2010
+++ src/lib/libc/stdio/findfp.c	Mon Sep  6 10:52:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: findfp.c,v 1.24 2010/01/11 20:39:29 joerg Exp $	*/
+/*	$NetBSD: findfp.c,v 1.25 2010/09/06 14:52:55 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)findfp.c	8.2 (Berkeley) 1/4/94";
 #else
-__RCSID("$NetBSD: findfp.c,v 1.24 2010/01/11 20:39:29 joerg Exp $");
+__RCSID("$NetBSD: findfp.c,v 1.25 2010/09/06 14:52:55 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -119,6 +119,23 @@
 	return (g);
 }
 
+void
+__sfpinit(FILE *fp)
+{
+	fp->_flags = 1;		/* reserve this slot; caller sets real flags */
+	fp->_p = NULL;		/* no current pointer */
+	fp->_w = 0;		/* nothing to read or write */
+	fp->_r = 0;
+	fp->_bf._base = NULL;	/* no buffer */
+	fp->_bf._size = 0;
+	fp->_lbfsize = 0;	/* not line buffered */
+	fp->_file = -1;		/* no file */
+/*	fp->_cookie = ; */	/* caller sets cookie, _read/_write etc */
+	_UB(fp)._base = NULL;	/* no ungetc buffer */
+	_UB(fp)._size = 0;
+	memset(WCIO_GET(fp), 0, sizeof(struct wchar_io_data));
+}
+
 /*
  * Find a free FILE for fopen et al.
  */
@@ -143,18 +160,7 @@
 	rwlock_unlock(&__sfp_lock);
 	return (NULL);
 found:
-	fp->_flags = 1;		/* reserve this slot; caller sets real flags */
-	fp->_p = NULL;		/* no current pointer */
-	fp->_w = 0;		/* nothing to read or write */
-	fp->_r = 0;
-	fp->_bf

CVS commit: src/include

2010-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  6 14:52:26 UTC 2010

Modified Files:
src/include: stdio.h

Log Message:
Add dprintf and vdprintf. XXX: Might ifdef it if too many things break.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/include/stdio.h

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

Modified files:

Index: src/include/stdio.h
diff -u src/include/stdio.h:1.76 src/include/stdio.h:1.77
--- src/include/stdio.h:1.76	Thu Feb 25 13:37:12 2010
+++ src/include/stdio.h	Mon Sep  6 10:52:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdio.h,v 1.76 2010/02/25 18:37:12 joerg Exp $	*/
+/*	$NetBSD: stdio.h,v 1.77 2010/09/06 14:52:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -492,6 +492,13 @@
 #endif /* !_REENTRANT && !_PTHREADS */
 #endif /* !_ANSI_SOURCE */
 
+#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
+int	 vdprintf(int, const char * __restrict, _BSD_VA_LIST_)
+		__printflike(2, 0);
+int	 dprintf(int, const char * __restrict, ...)
+		__printflike(2, 3);
+#endif /* (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE) */
+
 #if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
 defined(_REENTRANT) || defined(_NETBSD_SOURCE)
 #define getc_unlocked(fp)	__sgetc(fp)



CVS commit: src/sys/rump/librump/rumpvfs

2010-09-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  6 14:50:34 UTC 2010

Modified Files:
src/sys/rump/librump/rumpvfs: rumpfs.c

Log Message:
Try to draw faster than Lucky Locke.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/rump/librump/rumpvfs/rumpfs.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/rump/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.63 src/sys/rump/librump/rumpvfs/rumpfs.c:1.64
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.63	Wed Jul 21 17:52:13 2010
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Mon Sep  6 14:50:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.63 2010/07/21 17:52:13 hannken Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.64 2010/09/06 14:50:34 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009  Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.63 2010/07/21 17:52:13 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.64 2010/09/06 14:50:34 pooka Exp $");
 
 #include 
 #include 
@@ -106,6 +106,8 @@
 	{ &vop_islocked_desc, genfs_islocked },
 	{ &vop_inactive_desc, rump_vop_inactive },
 	{ &vop_reclaim_desc, rump_vop_reclaim },
+	{ &vop_remove_desc, genfs_eopnotsupp },
+	{ &vop_link_desc, genfs_eopnotsupp },
 	{ NULL, NULL }
 };
 const struct vnodeopv_desc rump_vnodeop_opv_desc =



CVS commit: src/tests/lib/libc/gen

2010-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  6 14:41:21 UTC 2010

Added Files:
src/tests/lib/libc/gen: Makefile t_glob_star.c

Log Message:
Add tests for GLOB_STAR


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/gen/Makefile \
src/tests/lib/libc/gen/t_glob_star.c

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

Added files:

Index: src/tests/lib/libc/gen/Makefile
diff -u /dev/null src/tests/lib/libc/gen/Makefile:1.1
--- /dev/null	Mon Sep  6 10:41:21 2010
+++ src/tests/lib/libc/gen/Makefile	Mon Sep  6 10:41:21 2010
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2010/09/06 14:41:21 christos Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/lib/libc/gen
+
+TESTS_C+=	t_glob_star
+
+.include 
Index: src/tests/lib/libc/gen/t_glob_star.c
diff -u /dev/null src/tests/lib/libc/gen/t_glob_star.c:1.1
--- /dev/null	Mon Sep  6 10:41:21 2010
+++ src/tests/lib/libc/gen/t_glob_star.c	Mon Sep  6 10:41:21 2010
@@ -0,0 +1,222 @@
+/*	$NetBSD: t_glob_star.c,v 1.1 2010/09/06 14:41:21 christos Exp $	*/
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__RCSID("$NetBSD: t_glob_star.c,v 1.1 2010/09/06 14:41:21 christos Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+#ifdef DEBUG
+#define DPRINTF(a) printf a
+#else
+#define DPRINTF(a)
+#endif
+
+ATF_TC(t_glob_star);
+ATF_TC(t_glob_star_not);
+
+struct gl_file {
+	const char *name;
+	int dir;
+};
+
+static struct gl_file a[] = {
+	{ "1", 0 },
+	{ "b", 1 },
+	{ "3", 0 },
+	{ "4", 0 },
+};
+
+static struct gl_file b[] = {
+	{ "x", 0 },
+	{ "y", 0 },
+	{ "z", 0 },
+	{ "w", 0 },
+};
+
+struct gl_dir {
+	const char *name;	/* directory name */
+	const struct gl_file *dir;
+	size_t len, pos;
+};
+
+static struct gl_dir d[] = {
+	{ "a", a, __arraycount(a), 0 },
+	{ "a/b", b, __arraycount(b), 0 },
+};
+
+static const char *glob_star[] = { 
+"a/1", "a/3", "a/4", "a/b", "a/b/w", "a/b/x", "a/b/y", "a/b/z",
+};
+
+static const char *glob_star_not[] = {
+	"a/1", "a/3", "a/4", "a/b",
+};
+
+static void
+trim(char *buf, size_t len, const char *name)
+{
+	char *path = buf, *epath = buf + sizeof(buf) - 1;
+	while (path < epath && (*path++ = *name++) != '\0')
+		continue;
+	path--;
+	while (path > buf && *--path == '/')
+		*path = '\0';
+}
+
+static void *
+gl_opendir(const char *dir)
+{
+	size_t i;
+	char buf[MAXPATHLEN];
+	trim(buf, sizeof(buf), dir);
+
+	for (i = 0; i < __arraycount(d); i++)
+		if (strcmp(buf, d[i].name) == 0) {
+			DPRINTF(("opendir %s %zu\n", buf, i));
+			return &d[i];
+		}
+	errno = ENOENT;
+	return NULL;
+}
+
+static struct dirent *
+gl_readdir(void *v)
+{
+	static struct dirent dir;
+	struct gl_dir *d = v;
+	if (d->pos < d->len) {
+		const struct gl_file *f = &d->dir[d->pos++];
+		strcpy(dir.d_name, f->name);
+		dir.d_namlen = strlen(f->name);
+		dir.d_ino = d->pos;
+		dir.d_type = f->dir ? DT_DIR : DT_REG;
+		DPRINTF(("readdir %s %d\n", dir.d_name, dir.d_type));
+		dir.d_reclen = _DIRENT_RECLEN(&dir, dir.d_namlen);
+		return &dir;
+	}
+	return NULL;
+}
+
+static int
+gl_stat(const char *name , __gl_stat_t *st)
+{
+	char buf[MAXPATHLEN];
+	trim(buf, sizeof(buf), name);
+	memset(st, 0, sizeof(*st));
+	if (strcmp(buf, "a") == 0 || strcmp(buf, "a/b") == 0)
+		st->st_mode |= _S_IFDIR;
+	DPRINTF(("stat %s %d\n", buf, st->st_mode));
+	return 0;
+}
+
+static int
+gl_lstat(const char *name , __gl_stat_t *st)
+{
+	return gl_sta

CVS commit: src/lib/libc/gen

2010-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  6 14:40:25 UTC 2010

Modified Files:
src/lib/libc/gen: glob.3 glob.c

Log Message:
Add GLOB_STAR support from Greg Dionne.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libc/gen/glob.3
cvs rdiff -u -r1.26 -r1.27 src/lib/libc/gen/glob.c

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/gen/glob.3
diff -u src/lib/libc/gen/glob.3:1.37 src/lib/libc/gen/glob.3:1.38
--- src/lib/libc/gen/glob.3:1.37	Tue Jul  6 10:59:22 2010
+++ src/lib/libc/gen/glob.3	Mon Sep  6 10:40:24 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: glob.3,v 1.37 2010/07/06 14:59:22 christos Exp $
+.\"	$NetBSD: glob.3,v 1.38 2010/09/06 14:40:24 christos Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -31,7 +31,7 @@
 .\"
 .\" @(#)glob.3	8.3 (Berkeley) 4/16/94
 .\"
-.Dd July 6, 2010
+.Dd September 3, 2010
 .Dt GLOB 3
 .Os
 .Sh NAME
@@ -277,6 +277,13 @@
 from metacharacter matches, regardless of whether
 .Dv GLOB_PERIOD
 is set and whether the pattern component begins with a literal period.
+.Dv GLOB_STAR
+Indicates that two adjacent
+.Li *
+characters will do a recursive match in all subdirs, without following
+symbolic links and three adjacent
+.Li *
+characters will also follow symbolic links.
 .El
 .Pp
 If, during the search, a directory is encountered that cannot be opened

Index: src/lib/libc/gen/glob.c
diff -u src/lib/libc/gen/glob.c:1.26 src/lib/libc/gen/glob.c:1.27
--- src/lib/libc/gen/glob.c:1.26	Tue Jul  6 10:59:22 2010
+++ src/lib/libc/gen/glob.c	Mon Sep  6 10:40:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: glob.c,v 1.26 2010/07/06 14:59:22 christos Exp $	*/
+/*	$NetBSD: glob.c,v 1.27 2010/09/06 14:40:25 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)glob.c	8.3 (Berkeley) 10/13/93";
 #else
-__RCSID("$NetBSD: glob.c,v 1.26 2010/07/06 14:59:22 christos Exp $");
+__RCSID("$NetBSD: glob.c,v 1.27 2010/09/06 14:40:25 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -160,16 +160,16 @@
 static int	 g_stat(Char *, __gl_stat_t *, glob_t *);
 static int	 glob0(const Char *, glob_t *, size_t *);
 static int	 glob1(Char *, glob_t *, size_t *);
-static int	 glob2(Char *, Char *, Char *, Char *, glob_t *,
-size_t *);
-static int	 glob3(Char *, Char *, Char *, Char *, Char *, glob_t *,
+static int	 glob2(Char *, Char *, Char *, const Char *, glob_t *,
 size_t *);
+static int	 glob3(Char *, Char *, Char *, const Char *, const Char *,
+const Char *, glob_t *, size_t *);
 static int	 globextend(const Char *, glob_t *, size_t *);
 static const Char *globtilde(const Char *, Char *, size_t, glob_t *);
 static int	 globexp1(const Char *, glob_t *, size_t *);
 static int	 globexp2(const Char *, const Char *, glob_t *, int *,
 size_t *);
-static int	 match(Char *, Char *, Char *);
+static int	 match(const Char *, const Char *, const Char *);
 #ifdef DEBUG
 static void	 qprintf(const char *, Char *);
 #endif
@@ -346,7 +346,7 @@
 
 /* Expand the current pattern */
 #ifdef DEBUG
-qprintf("globexp2:", patbuf);
+qprintf("globexp2", patbuf);
 #endif
 *rv = globexp1(patbuf, pglob, limit);
 
@@ -513,10 +513,13 @@
 			break;
 		case STAR:
 			pglob->gl_flags |= GLOB_MAGCHAR;
-			/* collapse adjacent stars to one, 
+			/* collapse adjacent stars to one [or three if globstar]
 			 * to avoid exponential behavior
 			 */
-			if (bufnext == patbuf || bufnext[-1] != M_ALL)
+			if (bufnext == patbuf || bufnext[-1] != M_ALL ||
+			((pglob->gl_flags & GLOB_STAR) != 0 && 
+			(bufnext - 1 == patbuf || bufnext[-2] != M_ALL ||
+			bufnext - 2 == patbuf || bufnext[-3] != M_ALL)))
 *bufnext++ = M_ALL;
 			break;
 		default:
@@ -526,7 +529,7 @@
 	}
 	*bufnext = EOS;
 #ifdef DEBUG
-	qprintf("glob0:", patbuf);
+	qprintf("glob0", patbuf);
 #endif
 
 	if ((error = glob1(patbuf, pglob, limit)) != 0)
@@ -592,11 +595,12 @@
  * meta characters.
  */
 static int
-glob2(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern, glob_t *pglob,
-size_t *limit)
+glob2(Char *pathbuf, Char *pathend, Char *pathlim, const Char *pattern,
+glob_t *pglob, size_t *limit)
 {
 	__gl_stat_t sb;
-	Char *p, *q;
+	const Char *p;
+	Char *q;
 	int anymeta;
 	Char *pend;
 	ptrdiff_t diff;
@@ -606,6 +610,9 @@
 	_DIAGASSERT(pattern != NULL);
 	_DIAGASSERT(pglob != NULL);
 
+#ifdef DEBUG
+	qprintf("glob2", pathbuf);
+#endif
 	/*
 	 * Loop over pattern segments until end of pattern or until
 	 * segment with meta character found.
@@ -677,19 +684,24 @@
 			}
 		} else			/* Need expansion, recurse. */
 			return glob3(pathbuf, pathend, pathlim, pattern, p,
-			pglob, limit);
+			pattern, pglob, limit);
 	}
 	/* NOTREACHED */
 }
 
 static int
-glob3(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern,
-Ch

CVS commit: src/include

2010-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  6 14:38:56 UTC 2010

Modified Files:
src/include: glob.h

Log Message:
add globstar.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/include/glob.h

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

Modified files:

Index: src/include/glob.h
diff -u src/include/glob.h:1.25 src/include/glob.h:1.26
--- src/include/glob.h:1.25	Wed Apr  8 12:28:50 2009
+++ src/include/glob.h	Mon Sep  6 10:38:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: glob.h,v 1.25 2009/04/08 16:28:50 christos Exp $	*/
+/*	$NetBSD: glob.h,v 1.26 2010/09/06 14:38:56 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -93,6 +93,7 @@
 /*	GLOB_NOESCAPE	0x1000	above */
 #define	GLOB_PERIOD	0x2000	/* Allow metachars to match leading periods. */
 #define	GLOB_NO_DOTDIRS	0x4000	/* Make . and .. vanish from wildcards. */
+#define	GLOB_STAR	0x8000	/* Use glob ** to recurse directories */
 #define	GLOB_QUOTE	0	/* source compatibility */
 
 #define	GLOB_ABEND	GLOB_ABORTED	/* source compatibility */



CVS commit: src/sys/dev/acpi

2010-09-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Sep  6 14:09:54 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_quirks.c

Log Message:
Remove quirk added in rev 1.14.  Even after the change of 1.16, it
still matches more boards that just the one with the problem.

Interrupts from the SATA controllers on my MSI K8N Neo3 boards
(which both versions of this quirk matched) are broken when ACPI
is disabled.  My board does not exhibit AE_AML_INFINITE_LOOP
problems.

If we want to avoid manually specifying RB_MD2 in boothowto on
pgoyette@'s board, we're going to have to find another way; perhaps
with the DMI strings available from pmf(9).

Anyhow, some boards needing RB_MD2 during boot(8) is in my opinion
better than others needing to set acpi_force_load in ddb or gdb.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/acpi/acpi_quirks.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/dev/acpi/acpi_quirks.c
diff -u src/sys/dev/acpi/acpi_quirks.c:1.16 src/sys/dev/acpi/acpi_quirks.c:1.17
--- src/sys/dev/acpi/acpi_quirks.c:1.16	Sat Sep  4 17:48:26 2010
+++ src/sys/dev/acpi/acpi_quirks.c	Mon Sep  6 14:09:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_quirks.c,v 1.16 2010/09/04 17:48:26 jruoho Exp $	*/
+/*	$NetBSD: acpi_quirks.c,v 1.17 2010/09/06 14:09:54 jakllsch Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: acpi_quirks.c,v 1.16 2010/09/04 17:48:26 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_quirks.c,v 1.17 2010/09/06 14:09:54 jakllsch Exp $");
 
 #include "opt_acpi.h"
 
@@ -69,9 +69,6 @@
 	{ ACPI_SIG_FADT, "NVIDIA", 0x0604, AQ_EQ, "CK8 ",
 	  ACPI_QUIRK_IRQ0 },
 
-	{ ACPI_SIG_FADT, "Nvidia", 0x42302e31, AQ_EQ, "AWRDACPI",
-	  ACPI_QUIRK_BROKEN },
-
 	{ ACPI_SIG_FADT, "HP", 0x06040012, AQ_LTE, "HWPC20F ",
 	  ACPI_QUIRK_BROKEN },
 };



CVS commit: src/usr.sbin/perfused

2010-09-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep  6 13:15:29 UTC 2010

Modified Files:
src/usr.sbin/perfused: perfused.c

Log Message:
Fix some typos in messages. Make usage match manpage.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/perfused/perfused.c

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

Modified files:

Index: src/usr.sbin/perfused/perfused.c
diff -u src/usr.sbin/perfused/perfused.c:1.5 src/usr.sbin/perfused/perfused.c:1.6
--- src/usr.sbin/perfused/perfused.c:1.5	Mon Sep  6 01:40:24 2010
+++ src/usr.sbin/perfused/perfused.c	Mon Sep  6 13:15:29 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfused.c,v 1.5 2010/09/06 01:40:24 manu Exp $ */
+/*  $NetBSD: perfused.c,v 1.6 2010/09/06 13:15:29 wiz Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -205,14 +205,14 @@
 	 * Get peer identity
 	 */
 	if (getpeerid(fd, NULL, &pmi.pmi_uid, NULL) != 0)
-		DWARNX("Unable to retreive peer identity");
+		DWARNX("Unable to retrieve peer identity");
 
 	/*
 	 * Check that peer owns mountpoint and read (and write) on it?
 	 */
 	ro_flag = pmi.pmi_mountflags & MNT_RDONLY;
 	if (access_mount(pmi.pmi_target, pmi.pmi_uid, ro_flag) != 0)
-		DERRX(EX_NOPERM, "insuficient privvileges to mount %s", 
+		DERRX(EX_NOPERM, "insufficient privileges to mount %s", 
 		  pmi.pmi_target);
 
 
@@ -343,7 +343,7 @@
 			foreground = 1;
 			break;
 		default:
-			DERR(EX_USAGE, "%s [-d level] [-s] [-f] [-i fd]", argv[0]);
+			DERR(EX_USAGE, "%s [-fs] [-d level] [-i fd]", argv[0]);
 			break;
 		}
 	}