rump_v7fs.c revision 1.1
11.1Such/*	$NetBSD: rump_v7fs.c,v 1.1 2011/07/24 08:55:31 uch Exp $	*/
21.1Such
31.1Such/*
41.1Such * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
51.1Such *
61.1Such * Redistribution and use in source and binary forms, with or without
71.1Such * modification, are permitted provided that the following conditions
81.1Such * are met:
91.1Such * 1. Redistributions of source code must retain the above copyright
101.1Such *    notice, this list of conditions and the following disclaimer.
111.1Such * 2. Redistributions in binary form must reproduce the above copyright
121.1Such *    notice, this list of conditions and the following disclaimer in the
131.1Such *    documentation and/or other materials provided with the distribution.
141.1Such *
151.1Such * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
161.1Such * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
171.1Such * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
181.1Such * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
191.1Such * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
201.1Such * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
211.1Such * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
221.1Such * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
231.1Such * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
241.1Such * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
251.1Such * SUCH DAMAGE.
261.1Such */
271.1Such
281.1Such#include <sys/types.h>
291.1Such#include <sys/mount.h>
301.1Such
311.1Such#include <rump/p2k.h>
321.1Such#include <rump/ukfs.h>
331.1Such
341.1Such#include <err.h>
351.1Such#include <puffs.h>
361.1Such#include <stdlib.h>
371.1Such#include <string.h>
381.1Such
391.1Such#include "mount_v7fs.h"
401.1Such
411.1Suchint
421.1Suchmain(int argc, char *argv[])
431.1Such{
441.1Such	struct v7fs_args args;
451.1Such	char canon_dev[UKFS_DEVICE_MAXPATHLEN], canon_dir[MAXPATHLEN];
461.1Such	struct ukfs_part *part;
471.1Such	int mntflags;
481.1Such	int rv;
491.1Such
501.1Such	setprogname(argv[0]);
511.1Such	puffs_unmountonsignal(SIGINT, true);
521.1Such	puffs_unmountonsignal(SIGTERM, true);
531.1Such
541.1Such	UKFS_DEVICE_ARGVPROBE(&part);
551.1Such	mount_v7fs_parseargs(argc, argv, &args, &mntflags,
561.1Such	    canon_dev, canon_dir);
571.1Such	rv = p2k_run_diskfs(MOUNT_V7FS, canon_dev, part, canon_dir, mntflags,
581.1Such	    &args, sizeof(args), 0);
591.1Such	ukfs_part_release(part);
601.1Such	if (rv)
611.1Such		err(1, "mount");
621.1Such
631.1Such	return 0;
641.1Such}
65