summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2013-03-28 02:08:39 +0000
committerguenther <guenther@openbsd.org>2013-03-28 02:08:39 +0000
commit5540ae6649b2a30ca9b1de8b06ace6a2dee3721c (patch)
tree035b08b978302576ecd3979dd1cda6facc54eaae /sys/kern
parentUnfortunately the satosin, sintosa, ifatoia, satosin6, sin6tosa, (diff)
downloadwireguard-openbsd-5540ae6649b2a30ca9b1de8b06ace6a2dee3721c.tar.xz
wireguard-openbsd-5540ae6649b2a30ca9b1de8b06ace6a2dee3721c.zip
Handle the pathconf _PC_PATH_MAX, _PC_PIPE_BUF, _PC_ASYNC_IO,
_PC_PRIO_IO, and _PC_SYNC_IO names in VOP_PATHCONF(), as they're fs-independent for us. Since we don't support latter three on any fs, we can also define the related _POSIX_{ASYNC,PRIO,SYNC}_IO symbols in <unistd.h> (via sys/unistd.h) with value -1. Also, zap pointless tty-only values from procfs(!). ok beck@, deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/spec_vnops.c5
-rw-r--r--sys/kern/vfs_vops.c22
2 files changed, 22 insertions, 5 deletions
diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c
index bc2d60c3230..9c54d61ee7d 100644
--- a/sys/kern/spec_vnops.c
+++ b/sys/kern/spec_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spec_vnops.c,v 1.69 2012/06/20 17:30:22 matthew Exp $ */
+/* $OpenBSD: spec_vnops.c,v 1.70 2013/03/28 02:08:39 guenther Exp $ */
/* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */
/*
@@ -617,9 +617,6 @@ spec_pathconf(void *v)
case _PC_MAX_INPUT:
*ap->a_retval = MAX_INPUT;
break;
- case _PC_PIPE_BUF:
- *ap->a_retval = PIPE_BUF;
- break;
case _PC_CHOWN_RESTRICTED:
*ap->a_retval = 1;
break;
diff --git a/sys/kern/vfs_vops.c b/sys/kern/vfs_vops.c
index 8b9f6e49735..a89a7746457 100644
--- a/sys/kern/vfs_vops.c
+++ b/sys/kern/vfs_vops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_vops.c,v 1.4 2011/07/02 15:52:25 thib Exp $ */
+/* $OpenBSD: vfs_vops.c,v 1.5 2013/03/28 02:08:39 guenther Exp $ */
/*
* Copyright (c) 2010 Thordur I. Bjornsson <thib@openbsd.org>
*
@@ -45,6 +45,7 @@
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/vnode.h>
+#include <sys/unistd.h>
#ifdef VFSLCKDEBUG
#define ASSERT_VP_ISLOCKED(vp) do { \
@@ -562,6 +563,25 @@ int
VOP_PATHCONF(struct vnode *vp, int name, register_t *retval)
{
struct vop_pathconf_args a;
+
+ /*
+ * Handle names that are constant across filesystem
+ */
+ switch (name) {
+ case _PC_PATH_MAX:
+ *retval = PATH_MAX;
+ return (0);
+ case _PC_PIPE_BUF:
+ *retval = PIPE_BUF;
+ return (0);
+ case _PC_ASYNC_IO:
+ case _PC_PRIO_IO:
+ case _PC_SYNC_IO:
+ *retval = 0;
+ return (0);
+
+ }
+
a.a_vp = vp;
a.a_name = name;
a.a_retval = retval;