1 /* $NetBSD: mnttab.h,v 1.4 2010/12/14 01:00:26 haad Exp $ */ 2 3 /* 4 * CDDL HEADER START 5 * 6 * The contents of this file are subject to the terms of the 7 * Common Development and Distribution License, Version 1.0 only 8 * (the "License"). You may not use this file except in compliance 9 * with the License. 10 * 11 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 12 * or http://www.opensolaris.org/os/licensing. 13 * See the License for the specific language governing permissions 14 * and limitations under the License. 15 * 16 * When distributing Covered Code, include this CDDL HEADER in each 17 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 18 * If applicable, add the following below this CDDL HEADER, with the 19 * fields enclosed by brackets "[]" replaced with your own identifying 20 * information: Portions Copyright [yyyy] [name of copyright owner] 21 * 22 * CDDL HEADER END 23 */ 24 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 25 /* All Rights Reserved */ 26 27 28 /* 29 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 30 * Use is subject to license terms. 31 */ 32 33 #ifndef _SYS_MNTTAB_H 34 #define _SYS_MNTTAB_H 35 36 #pragma ident "%Z%%M% %I% %E% SMI" 37 38 #include <sys/types.h> 39 #include <sys/statvfs.h> 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 #define MNTTAB "/dev/null" 46 #define MNT_LINE_MAX 1024 47 48 #define MNT_TOOLONG 1 /* entry exceeds MNT_LINE_MAX */ 49 #define MNT_TOOMANY 2 /* too many fields in line */ 50 #define MNT_TOOFEW 3 /* too few fields in line */ 51 52 #define mntnull(mp)\ 53 ((mp)->mnt_special = (mp)->mnt_mountp = \ 54 (mp)->mnt_fstype = (mp)->mnt_mntopts = \ 55 (mp)->mnt_time = NULL) 56 57 #define putmntent(fd, mp) (-1) 58 59 struct mnttab { 60 char *mnt_special; 61 char *mnt_mountp; 62 char *mnt_fstype; 63 char *mnt_mntopts; 64 char *mnt_time; 65 }; 66 67 /* 68 * NOTE: fields in extmnttab should match struct mnttab till new fields 69 * are encountered, this allows hasmntopt to work properly when its arg is 70 * a pointer to an extmnttab struct cast to a mnttab struct pointer. 71 */ 72 struct extmnttab { 73 char *mnt_special; 74 char *mnt_mountp; 75 char *mnt_fstype; 76 char *mnt_mntopts; 77 char *mnt_time; 78 uint_t mnt_major; 79 uint_t mnt_minor; 80 }; 81 82 #if !defined(_KERNEL) 83 #ifdef __STDC__ 84 extern void resetmnttab(FILE *); 85 extern int getmntent(FILE *, struct mnttab *); 86 extern int getextmntent(FILE *, struct extmnttab *, size_t); 87 extern int getmntany(FILE *, struct mnttab *, struct mnttab *); 88 extern int getstatfs(struct statvfs *, const char *); 89 extern char *hasmntopt(struct mnttab *, char *); 90 extern char *mntopt(char **); 91 #else 92 extern void resetmnttab(); 93 extern int getmntent(); 94 extern int getextmntent(); 95 extern int getmntany(); 96 extern char *hasmntopt(); 97 extern char *mntopt(); 98 #endif 99 #endif 100 101 #ifdef __cplusplus 102 } 103 #endif 104 105 #endif /* _SYS_MNTTAB_H */ 106