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. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * @(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95
40 * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved.
41 * @(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95
42 * $FreeBSD: src/sbin/mount_cd9660/mount_cd9660.c,v 1.15.2.3 2001/03/14 12:05:01 bp Exp $
43 * $DragonFly: src/sbin/mount_udf/mount_udf.c,v 1.3 2004/12/18 21:43:39 swildner Exp $
48 #include <sys/param.h>
49 #include <sys/mount.h>
50 #include <vfs/udf/udf_mount.h>
62 struct mntopt mopts
[] = {
71 main(int argc
, char **argv
)
74 int ch
, mntflags
, opts
;
75 char *dev
, *dir
, mntpath
[MAXPATHLEN
];
79 mntflags
= opts
= verbose
= 0;
80 memset(&args
, 0, sizeof args
);
81 while ((ch
= getopt(argc
, argv
, "o:v")) != -1)
84 getmntopts(optarg
, mopts
, &mntflags
, &opts
);
103 * Resolve the mountpoint with realpath(3) and remove unnecessary
104 * slashes from the devicename if there are any.
106 checkpath(dir
, mntpath
);
109 #define DEFAULT_ROOTUID -2
111 * UDF filesystems are not writeable.
113 mntflags
|= MNT_RDONLY
;
114 args
.export
.ex_flags
= MNT_EXRDONLY
;
116 args
.export
.ex_root
= DEFAULT_ROOTUID
;
119 error
= getvfsbyname("udf", &vfc
);
120 if (error
&& vfsisloadable("udf")) {
122 err(EX_OSERR
, "vfsload(udf)");
123 endvfsent(); /* flush cache */
124 error
= getvfsbyname("udf", &vfc
);
127 errx(1, "UDF filesystem is not available");
129 if (mount(vfc
.vfc_name
, mntpath
, mntflags
, &args
) < 0)
130 err(1, "%s", args
.fspec
);
137 fprintf(stderr
, "usage: mount_udf [-o options] special node\n");