aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorMaxime Henrion <mux@FreeBSD.org>2002-05-23 23:08:27 +0000
committerMaxime Henrion <mux@FreeBSD.org>2002-05-23 23:08:27 +0000
commitdc5d2b0281fe8003897cf5e2d943f1f7c7f8e17e (patch)
treec1fa97786b7cf094b88599ab9374963017f1eee7 /sbin
parent9fcc512cd6b665fb4164ff63c6d050b6b7fc746a (diff)
downloadsrc-dc5d2b0281fe8003897cf5e2d943f1f7c7f8e17e.tar.gz
src-dc5d2b0281fe8003897cf5e2d943f1f7c7f8e17e.zip
Make mount_nullfs(8) use nmount(2) rather than mount(2) now
that nullfs has been converted to nmount.
Notes
Notes: svn path=/head/; revision=97187
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mount_nullfs/mount_nullfs.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c
index 31f2d96bbfd5..5af8daa9640d 100644
--- a/sbin/mount_nullfs/mount_nullfs.c
+++ b/sbin/mount_nullfs/mount_nullfs.c
@@ -50,7 +50,6 @@ static const char rcsid[] =
#include <sys/param.h>
#include <sys/mount.h>
-#include <fs/nullfs/null.h>
#include <err.h>
#include <stdio.h>
@@ -74,7 +73,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- struct null_args args;
+ struct iovec iov[6];
int ch, mntflags;
char source[MAXPATHLEN];
char target[MAXPATHLEN];
@@ -105,8 +104,6 @@ main(argc, argv)
errx(EX_USAGE, "%s (%s) and %s are not distinct paths",
argv[0], target, argv[1]);
- args.target = target;
-
error = getvfsbyname("nullfs", &vfc);
if (error && vfsisloadable("nullfs")) {
if(vfsload("nullfs"))
@@ -117,7 +114,20 @@ main(argc, argv)
if (error)
errx(EX_OSERR, "null/loopback filesystem is not available");
- if (mount(vfc.vfc_name, source, mntflags, &args))
+ iov[0].iov_base = "fstype";
+ iov[0].iov_len = sizeof("fstype");
+ iov[1].iov_base = vfc.vfc_name;
+ iov[1].iov_len = strlen(vfc.vfc_name) + 1;
+ iov[2].iov_base = "fspath";
+ iov[2].iov_len = sizeof("fspath");
+ iov[3].iov_base = source;
+ iov[3].iov_len = strlen(source) + 1;
+ iov[4].iov_base = "target";
+ iov[4].iov_len = sizeof("target");
+ iov[5].iov_base = target;
+ iov[5].iov_len = strlen(target) + 1;
+
+ if (nmount(iov, 6, mntflags))
err(1, NULL);
exit(0);
}