1eda14cbcSMatt Macy /* 2eda14cbcSMatt Macy * CDDL HEADER START 3eda14cbcSMatt Macy * 4eda14cbcSMatt Macy * The contents of this file are subject to the terms of the 5eda14cbcSMatt Macy * Common Development and Distribution License, Version 1.0 only 6eda14cbcSMatt Macy * (the "License"). You may not use this file except in compliance 7eda14cbcSMatt Macy * with the License. 8eda14cbcSMatt Macy * 9eda14cbcSMatt Macy * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*271171e0SMartin Matuska * or https://opensource.org/licenses/CDDL-1.0. 11eda14cbcSMatt Macy * See the License for the specific language governing permissions 12eda14cbcSMatt Macy * and limitations under the License. 13eda14cbcSMatt Macy * 14eda14cbcSMatt Macy * When distributing Covered Code, include this CDDL HEADER in each 15eda14cbcSMatt Macy * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16eda14cbcSMatt Macy * If applicable, add the following below this CDDL HEADER, with the 17eda14cbcSMatt Macy * fields enclosed by brackets "[]" replaced with your own identifying 18eda14cbcSMatt Macy * information: Portions Copyright [yyyy] [name of copyright owner] 19eda14cbcSMatt Macy * 20eda14cbcSMatt Macy * CDDL HEADER END 21eda14cbcSMatt Macy */ 22eda14cbcSMatt Macy /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 23eda14cbcSMatt Macy /* All Rights Reserved */ 24eda14cbcSMatt Macy /* 25eda14cbcSMatt Macy * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 26eda14cbcSMatt Macy * Use is subject to license terms. 27eda14cbcSMatt Macy */ 28eda14cbcSMatt Macy /* Copyright 2006 Ricardo Correia */ 29eda14cbcSMatt Macy 30eda14cbcSMatt Macy #ifndef _SYS_MNTTAB_H 31eda14cbcSMatt Macy #define _SYS_MNTTAB_H 32eda14cbcSMatt Macy 33eda14cbcSMatt Macy #include <stdio.h> 34eda14cbcSMatt Macy #include <sys/types.h> 35eda14cbcSMatt Macy 36eda14cbcSMatt Macy #ifdef MNTTAB 37eda14cbcSMatt Macy #undef MNTTAB 38eda14cbcSMatt Macy #endif /* MNTTAB */ 39eda14cbcSMatt Macy 40eda14cbcSMatt Macy #include <paths.h> 41eda14cbcSMatt Macy #include <sys/mount.h> 42eda14cbcSMatt Macy #define MNTTAB _PATH_DEVZERO 43eda14cbcSMatt Macy #define MS_NOMNTTAB 0x0 44eda14cbcSMatt Macy #define MS_RDONLY 0x1 45eda14cbcSMatt Macy #define umount2(p, f) unmount(p, f) 46eda14cbcSMatt Macy #define MNT_LINE_MAX 4108 47eda14cbcSMatt Macy 48eda14cbcSMatt Macy #define MNT_TOOLONG 1 /* entry exceeds MNT_LINE_MAX */ 49eda14cbcSMatt Macy #define MNT_TOOMANY 2 /* too many fields in line */ 50eda14cbcSMatt Macy #define MNT_TOOFEW 3 /* too few fields in line */ 51eda14cbcSMatt Macy 52eda14cbcSMatt Macy struct mnttab { 53eda14cbcSMatt Macy char *mnt_special; 54eda14cbcSMatt Macy char *mnt_mountp; 55eda14cbcSMatt Macy char *mnt_fstype; 56eda14cbcSMatt Macy char *mnt_mntopts; 57eda14cbcSMatt Macy }; 58eda14cbcSMatt Macy 59eda14cbcSMatt Macy /* 60eda14cbcSMatt Macy * NOTE: fields in extmnttab should match struct mnttab till new fields 61eda14cbcSMatt Macy * are encountered, this allows hasmntopt to work properly when its arg is 62eda14cbcSMatt Macy * a pointer to an extmnttab struct cast to a mnttab struct pointer. 63eda14cbcSMatt Macy */ 64eda14cbcSMatt Macy 65eda14cbcSMatt Macy struct extmnttab { 66eda14cbcSMatt Macy char *mnt_special; 67eda14cbcSMatt Macy char *mnt_mountp; 68eda14cbcSMatt Macy char *mnt_fstype; 69eda14cbcSMatt Macy char *mnt_mntopts; 70eda14cbcSMatt Macy uint_t mnt_major; 71eda14cbcSMatt Macy uint_t mnt_minor; 72eda14cbcSMatt Macy }; 73eda14cbcSMatt Macy 74eda14cbcSMatt Macy struct stat64; 75eda14cbcSMatt Macy struct statfs; 76eda14cbcSMatt Macy 77eda14cbcSMatt Macy extern int getmntany(FILE *fp, struct mnttab *mp, struct mnttab *mpref); 78eda14cbcSMatt Macy extern int _sol_getmntent(FILE *fp, struct mnttab *mp); 79eda14cbcSMatt Macy extern int getextmntent(const char *path, struct extmnttab *entry, 80eda14cbcSMatt Macy struct stat64 *statbuf); 81eda14cbcSMatt Macy extern void statfs2mnttab(struct statfs *sfs, struct mnttab *mp); 82a0b956f5SMartin Matuska extern char *hasmntopt(struct mnttab *mnt, const char *opt); 83e3aa18adSMartin Matuska extern int getmntent(FILE *fp, struct mnttab *mp); 84eda14cbcSMatt Macy 85eda14cbcSMatt Macy #endif 86