diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 2001-04-09 07:14:24 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 2001-04-09 07:14:24 +0000 |
commit | 9b1fe5fc1ac937b51295538f4b165a1d9fc9ac95 (patch) | |
tree | c6461a4d96f7af1694080600ef5db641bf8ac344 /sbin/mount_procfs | |
parent | 6f2fdb9ba0804df4f105421d41cd208c8b2f1807 (diff) |
Add emulation of Linux features to procfs; mostly from NetBSD. ok deraadt@
Diffstat (limited to 'sbin/mount_procfs')
-rw-r--r-- | sbin/mount_procfs/Makefile | 4 | ||||
-rw-r--r-- | sbin/mount_procfs/mount_procfs.8 | 7 | ||||
-rw-r--r-- | sbin/mount_procfs/mount_procfs.c | 19 |
3 files changed, 21 insertions, 9 deletions
diff --git a/sbin/mount_procfs/Makefile b/sbin/mount_procfs/Makefile index 7b40484837d..ca95dfb2b3b 100644 --- a/sbin/mount_procfs/Makefile +++ b/sbin/mount_procfs/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.3 1997/09/21 11:37:31 deraadt Exp $ +# $OpenBSD: Makefile,v 1.4 2001/04/09 07:14:19 tholo Exp $ PROG= mount_procfs SRCS= mount_procfs.c getmntopts.c MAN= mount_procfs.8 -MOUNT= ${.CURDIR}/../mount +MOUNT= ${.CURDIR}/../mount_nfs CFLAGS+= -I${MOUNT} .PATH: ${MOUNT} diff --git a/sbin/mount_procfs/mount_procfs.8 b/sbin/mount_procfs/mount_procfs.8 index 1adeec34500..daf297288e6 100644 --- a/sbin/mount_procfs/mount_procfs.8 +++ b/sbin/mount_procfs/mount_procfs.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mount_procfs.8,v 1.15 2000/11/09 17:53:01 aaron Exp $ +.\" $OpenBSD: mount_procfs.8,v 1.16 2001/04/09 07:14:19 tholo Exp $ .\" $NetBSD: mount_procfs.8,v 1.6 1995/03/18 14:58:10 cgd Exp $ .\" .\" Copyright (c) 1992, 1993 @@ -69,6 +69,11 @@ flag followed by a comma separated string of options. See the .Xr mount 8 man page for possible options and their meanings. +The following procfs specific option is also available: +.Bl -tag -width indent +.It linux +Add Linux compatibility links and nodes to procfs. +.El .El .Pp The root of the process filesystem diff --git a/sbin/mount_procfs/mount_procfs.c b/sbin/mount_procfs/mount_procfs.c index b42c961c47f..dce84a64bbc 100644 --- a/sbin/mount_procfs/mount_procfs.c +++ b/sbin/mount_procfs/mount_procfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_procfs.c,v 1.6 1997/08/24 08:07:17 downsj Exp $ */ +/* $OpenBSD: mount_procfs.c,v 1.7 2001/04/09 07:14:20 tholo Exp $ */ /* $NetBSD: mount_procfs.c,v 1.7 1996/04/13 01:31:59 jtc Exp $ */ /* @@ -48,7 +48,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_procfs.c 8.3 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_procfs.c,v 1.6 1997/08/24 08:07:17 downsj Exp $"; +static char rcsid[] = "$OpenBSD: mount_procfs.c,v 1.7 2001/04/09 07:14:20 tholo Exp $"; #endif #endif /* not lint */ @@ -62,10 +62,13 @@ static char rcsid[] = "$OpenBSD: mount_procfs.c,v 1.6 1997/08/24 08:07:17 downsj #include <stdlib.h> #include <string.h> +#include <miscfs/procfs/procfs.h> + #include "mntopts.h" const struct mntopt mopts[] = { MOPT_STDOPTS, + { "linux", 0, PROCFSMNT_LINUXCOMPAT, 1 }, { NULL } }; @@ -76,13 +79,14 @@ main(argc, argv) int argc; char *argv[]; { - int ch, mntflags; + int ch, mntflags, altflags; + struct procfs_args args; - mntflags = 0; + mntflags = altflags = 0; while ((ch = getopt(argc, argv, "o:")) != -1) switch (ch) { case 'o': - getmntopts(optarg, mopts, &mntflags); + getmntopts(optarg, mopts, &mntflags, &altflags); break; case '?': default: @@ -94,7 +98,10 @@ main(argc, argv) if (argc != 2) usage(); - if (mount(MOUNT_PROCFS, argv[1], mntflags, NULL)) { + args.version = PROCFS_ARGSVERSION; + args.flags = altflags; + + if (mount(MOUNT_PROCFS, argv[1], mntflags, &args)) { if (errno == EOPNOTSUPP) errx(1, "%s: Filesystem not supported by kernel", argv[1]); |