]>
git.proxmox.com Git - mirror_zfs.git/blob - lib/libspl/include/sys/mnttab.h
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 AT&T */
23 /* All Rights Reserved */
25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
28 /* Copyright 2006 Ricardo Correia */
35 #include <sys/types.h>
41 #define MNTTAB "/etc/mtab"
42 #define MNT_LINE_MAX 1024
44 #define MNT_TOOLONG 1 /* entry exceeds MNT_LINE_MAX */
45 #define MNT_TOOMANY 2 /* too many fields in line */
46 #define MNT_TOOFEW 3 /* too few fields in line */
56 * NOTE: fields in extmnttab should match struct mnttab till new fields
57 * are encountered, this allows hasmntopt to work properly when its arg is
58 * a pointer to an extmnttab struct cast to a mnttab struct pointer.
70 extern int getmntany(FILE *fp
, struct mnttab
*mp
, struct mnttab
*mpref
);
71 extern int _sol_getmntent(FILE *fp
, struct mnttab
*mp
);
72 extern int getextmntent(FILE *fp
, struct extmnttab
*mp
, int len
);
74 static inline char *_sol_hasmntopt(struct mnttab
*mnt
, char *opt
)
76 struct mntent mnt_new
;
78 mnt_new
.mnt_opts
= mnt
->mnt_mntopts
;
80 return (hasmntopt(&mnt_new
, opt
));
83 #define hasmntopt _sol_hasmntopt
84 #define getmntent _sol_getmntent