2 * Copyright (c) 1992, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
5 * This code is derived from software contributed to Berkeley
6 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
7 * Support code is derived from software contributed to Berkeley
8 * by Atsushi Murai (amurai@spec.co.jp).
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of the University nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * @(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95
36 * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved.
37 * @(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95
38 * $FreeBSD: src/sbin/mount_cd9660/mount_cd9660.c,v 1.15.2.3 2001/03/14 12:05:01 bp Exp $
43 #include <sys/param.h>
44 #include <sys/mount.h>
45 #include <vfs/udf/udf_mount.h>
56 static struct mntopt mopts
[] = {
62 static void usage(void) __dead2
;
65 main(int argc
, char **argv
)
68 int ch
, mntflags
, opts
;
69 char *dev
, *dir
, mntpath
[MAXPATHLEN
];
73 mntflags
= opts
= verbose
= 0;
74 memset(&args
, 0, sizeof args
);
75 while ((ch
= getopt(argc
, argv
, "o:v")) != -1)
78 getmntopts(optarg
, mopts
, &mntflags
, &opts
);
97 * Resolve the mountpoint with realpath(3) and remove unnecessary
98 * slashes from the devicename if there are any.
100 checkpath(dir
, mntpath
);
103 #define DEFAULT_ROOTUID -2
105 * UDF filesystems are not writeable.
107 mntflags
|= MNT_RDONLY
;
108 args
.export
.ex_flags
= MNT_EXRDONLY
;
110 args
.export
.ex_root
= DEFAULT_ROOTUID
;
113 error
= getvfsbyname("udf", &vfc
);
114 if (error
&& vfsisloadable("udf")) {
116 err(EX_OSERR
, "vfsload(udf)");
117 endvfsent(); /* flush cache */
118 error
= getvfsbyname("udf", &vfc
);
121 errx(1, "UDF filesystem is not available");
123 if (mount(vfc
.vfc_name
, mntpath
, mntflags
, &args
) < 0)
124 err(1, "%s", args
.fspec
);
131 fprintf(stderr
, "usage: mount_udf [-o options] special node\n");