1 /* $NetBSD: mnttab.h,v 1.5 2018/05/28 21:05:10 chs 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 #ifndef _KERNEL 37 #include <mnttab.h> 38 #endif 39 40 #if 0 41 42 #pragma ident "%Z%%M% %I% %E% SMI" 43 44 #include <sys/types.h> 45 #include <sys/statvfs.h> 46 47 #ifdef __cplusplus 48 extern "C" { 49 #endif 50 51 #define MNTTAB "/dev/null" 52 #define MNT_LINE_MAX 1024 53 54 #define MNT_TOOLONG 1 /* entry exceeds MNT_LINE_MAX */ 55 #define MNT_TOOMANY 2 /* too many fields in line */ 56 #define MNT_TOOFEW 3 /* too few fields in line */ 57 58 #define mntnull(mp)\ 59 ((mp)->mnt_special = (mp)->mnt_mountp = \ 60 (mp)->mnt_fstype = (mp)->mnt_mntopts = \ 61 (mp)->mnt_time = NULL) 62 63 #define putmntent(fd, mp) (-1) 64 65 struct mnttab { 66 char *mnt_special; 67 char *mnt_mountp; 68 char *mnt_fstype; 69 char *mnt_mntopts; 70 char *mnt_time; 71 }; 72 73 /* 74 * NOTE: fields in extmnttab should match struct mnttab till new fields 75 * are encountered, this allows hasmntopt to work properly when its arg is 76 * a pointer to an extmnttab struct cast to a mnttab struct pointer. 77 */ 78 struct extmnttab { 79 char *mnt_special; 80 char *mnt_mountp; 81 char *mnt_fstype; 82 char *mnt_mntopts; 83 char *mnt_time; 84 uint_t mnt_major; 85 uint_t mnt_minor; 86 }; 87 88 #if !defined(_KERNEL) 89 #ifdef __STDC__ 90 extern void resetmnttab(FILE *); 91 extern int getmntent(FILE *, struct mnttab *); 92 extern int getextmntent(FILE *, struct extmnttab *, size_t); 93 extern int getmntany(FILE *, struct mnttab *, struct mnttab *); 94 extern int getstatfs(struct statvfs *, const char *); 95 extern char *hasmntopt(struct mnttab *, char *); 96 extern char *mntopt(char **); 97 #else 98 extern void resetmnttab(); 99 extern int getmntent(); 100 extern int getextmntent(); 101 extern int getmntany(); 102 extern char *hasmntopt(); 103 extern char *mntopt(); 104 #endif 105 #endif 106 107 #ifdef __cplusplus 108 } 109 #endif 110 111 #endif 112 113 #endif /* _SYS_MNTTAB_H */ 114