4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990, 1991, 1997 SMI */
23 /* All Rights Reserved */
25 #ident "%Z%%M% %I% %E% SMI"
31 #define LOCAL "/etc/default/fs"
32 #define REMOTE "/etc/dfs/fstypes"
35 * This is used to figure out the default file system type if "-F FStype"
36 * is not specified with the file system command and no entry in the
37 * /etc/vfstab matches the specified special.
38 * If the first character of the "special" is a "/" (eg, "/dev/dsk/c0d1s2"),
39 * returns the default local filesystem type.
40 * Otherwise (eg, "server:/path/name" or "resource"), returns the default
41 * remote filesystem type.
44 default_fstype(char *special
)
47 static char buf
[BUFSIZ
];
50 if (*special
== '/') {
51 if (defopen(LOCAL
) != 0)
54 if ((deffs
= defread("LOCAL=")) == NULL
) {
55 defopen(NULL
); /* close default file */
58 defopen(NULL
); /* close default file */
63 if ((fp
= fopen(REMOTE
, "r")) == NULL
)
66 if (fgets(buf
, sizeof (buf
), fp
) == NULL
) {
70 deffs
= strtok(buf
, " \t\n");