Merge commit 'ad3ad82ad2fb99c424a8482bd1908d08b990ccea'
[unleashed.git] / usr / src / cmd / fs.d / fslib.h
blob69216bf2bb2a31cbef296e877826396bfe4ff90e
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _FSLIB_H
28 #define _FSLIB_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #include <sys/mnttab.h>
39 * This structure is used to build a list of
40 * mnttab structures from /etc/mnttab.
42 typedef struct mntlist {
43 int mntl_flags;
44 uint_t mntl_dev;
45 struct extmnttab *mntl_mnt;
46 struct mntlist *mntl_next;
47 } mntlist_t;
50 * Bits for mntl_flags.
52 #define MNTL_UNMOUNT 0x01 /* unmount this entry */
53 #define MNTL_DIRECT 0x02 /* direct mount entry */
56 * Routines available in fslib.c:
58 void fsfreemnttab(struct extmnttab *);
59 struct extmnttab *fsdupmnttab(struct extmnttab *);
60 void fsfreemntlist(mntlist_t *);
62 mntlist_t *fsmkmntlist(FILE *);
63 mntlist_t *fsgetmntlist(void);
64 mntlist_t *fsgetmlast(mntlist_t *, struct mnttab *);
65 void cmp_requested_to_actual_options(char *, char *, char *, char *);
67 int fsgetmlevel(char *);
68 int fsstrinlist(const char *, const char **);
69 int fsgetmaxphys(int *, int *);
71 boolean_t fsisstdopt(const char *);
74 * Routines for determining which zone a mount resides in.
76 struct zone_summary;
78 struct zone_summary *fs_get_zone_summaries(void);
79 boolean_t fs_mount_in_other_zone(const struct zone_summary *,
80 const char *);
82 #undef MIN
83 #undef MAX
84 #define MIN(a, b) ((a) < (b) ? (a) : (b))
85 #define MAX(a, b) ((a) > (b) ? (a) : (b))
87 #define MAXLINE 2048
89 #ifdef __cplusplus
91 #endif
93 #endif /* _FSLIB_H */