summaryrefslogtreecommitdiff
path: root/sys/miscfs/procfs/procfs_vfsops.c
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>2001-04-09 07:14:24 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>2001-04-09 07:14:24 +0000
commit9b1fe5fc1ac937b51295538f4b165a1d9fc9ac95 (patch)
treec6461a4d96f7af1694080600ef5db641bf8ac344 /sys/miscfs/procfs/procfs_vfsops.c
parent6f2fdb9ba0804df4f105421d41cd208c8b2f1807 (diff)
Add emulation of Linux features to procfs; mostly from NetBSD. ok deraadt@
Diffstat (limited to 'sys/miscfs/procfs/procfs_vfsops.c')
-rw-r--r--sys/miscfs/procfs/procfs_vfsops.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c
index 287138795e0..9c1601ca502 100644
--- a/sys/miscfs/procfs/procfs_vfsops.c
+++ b/sys/miscfs/procfs/procfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procfs_vfsops.c,v 1.12 2001/02/20 01:50:10 assar Exp $ */
+/* $OpenBSD: procfs_vfsops.c,v 1.13 2001/04/09 07:14:23 tholo Exp $ */
/* $NetBSD: procfs_vfsops.c,v 1.25 1996/02/09 22:40:53 christos Exp $ */
/*
@@ -54,7 +54,10 @@
#include <sys/mount.h>
#include <sys/signalvar.h>
#include <sys/vnode.h>
+#include <sys/malloc.h>
+
#include <miscfs/procfs/procfs.h>
+
#include <vm/vm.h> /* for PAGE_SIZE */
#if defined(UVM)
@@ -81,6 +84,9 @@ procfs_mount(mp, path, data, ndp, p)
struct proc *p;
{
size_t size;
+ struct procfsmount *pmnt;
+ struct procfs_args args;
+ int error;
if (UIO_MX & (UIO_MX-1)) {
log(LOG_ERR, "procfs: invalid directory entry size");
@@ -90,14 +96,33 @@ procfs_mount(mp, path, data, ndp, p)
if (mp->mnt_flag & MNT_UPDATE)
return (EOPNOTSUPP);
+ if (data != NULL) {
+ error = copyin(data, &args, sizeof args);
+ if (error != 0)
+ return (error);
+
+ if (args.version != PROCFS_ARGSVERSION)
+ return (EINVAL);
+ } else
+ args.flags = 0;
+
mp->mnt_flag |= MNT_LOCAL;
- mp->mnt_data = 0;
+ pmnt = (struct procfsmount *) malloc(sizeof(struct procfsmount),
+ M_UFSMNT, M_WAITOK); /* XXX need new malloc type */
+
+ mp->mnt_data = (qaddr_t)pmnt;
vfs_getnewfsid(mp);
(void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN, &size);
bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
bcopy("procfs", mp->mnt_stat.f_mntfromname, sizeof("procfs"));
+
+#ifdef notyet
+ pmnt->pmnt_exechook = exechook_establish(procfs_revoke_vnodes, mp);
+#endif
+ pmnt->pmnt_flags = args.flags;
+
return (0);
}