summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authormux <mux@FreeBSD.org>2002-05-23 23:08:27 +0000
committermux <mux@FreeBSD.org>2002-05-23 23:08:27 +0000
commit92d62e0ebadb2bafa11948045ed07ea0c30d9686 (patch)
treec1fa97786b7cf094b88599ab9374963017f1eee7 /sbin
parentae75686d456b5a65caa193a0a467c19fb3f05003 (diff)
downloadFreeBSD-src-92d62e0ebadb2bafa11948045ed07ea0c30d9686.zip
FreeBSD-src-92d62e0ebadb2bafa11948045ed07ea0c30d9686.tar.gz
Make mount_nullfs(8) use nmount(2) rather than mount(2) now
that nullfs has been converted to nmount.
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 31f2d96..5af8daa 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);
}
OpenPOWER on IntegriCloud