xref: /illumos-gate/usr/src/uts/common/sys/mount.h (revision 0f1f78266c1aea63b41bde99723de7aa3fa9f7cc)
1 /*
2  * CDDL HEADER START
3  *
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.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 /*
27  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28  *
29  * Copyright (c) 1996, 1999 by Sun Microsystems, Inc.
30  * All rights reserved.
31  */
32 
33 #ifndef _SYS_MOUNT_H
34 #define	_SYS_MOUNT_H
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * Flag bits passed to mount(2).
42  */
43 #define	MS_RDONLY	0x0001	/* Read-only */
44 #define	MS_FSS		0x0002	/* Old (4-argument) mount (compatibility) */
45 #define	MS_DATA		0x0004	/* 6-argument mount */
46 #define	MS_NOSUID	0x0010	/* Setuid programs disallowed */
47 #define	MS_REMOUNT	0x0020	/* Remount */
48 #define	MS_NOTRUNC	0x0040	/* Return ENAMETOOLONG for long filenames */
49 #define	MS_OVERLAY	0x0080	/* Allow overlay mounts */
50 #define	MS_OPTIONSTR	0x0100	/* Data is a an in/out option string */
51 #define	MS_GLOBAL	0x0200	/* Clustering: Mount into global name space */
52 #define	MS_FORCE	0x0400	/* Forced unmount */
53 #define	MS_NOMNTTAB	0x0800	/* Don't show mount in mnttab */
54 /*
55  * Additional flag bits that domount() is prepared to interpret, but that
56  * can't be passed through mount(2).
57  */
58 #define	MS_SYSSPACE	0x0008	/* Mounta already in kernel space */
59 #define	MS_NOSPLICE	0x1000	/* Don't splice fs instance into name space */
60 #define	MS_NOCHECK	0x2000	/* Clustering: suppress mount busy checks */
61 /*
62  * Mask to sift out flag bits allowable from mount(2).
63  */
64 #define	MS_MASK	\
65 	(MS_RDONLY|MS_FSS|MS_DATA|MS_NOSUID|MS_REMOUNT|MS_NOTRUNC|MS_OVERLAY|\
66 	    MS_OPTIONSTR|MS_GLOBAL|MS_NOMNTTAB)
67 
68 /*
69  * Mask to sift out flag bits allowable from umount2(2).
70  */
71 
72 #define	MS_UMOUNT_MASK	(MS_FORCE)
73 
74 /*
75  * Maximum option string length accepted or returned by mount(2).
76  */
77 #define	MAX_MNTOPT_STR	1024	/* max length of mount options string */
78 
79 #if !defined(_KERNEL)
80 int mount(const char *, const char *, int, ...);
81 int umount(const char *);
82 int umount2(const char *, int);
83 #endif
84 
85 #ifdef	__cplusplus
86 }
87 #endif
88 
89 #endif	/* _SYS_MOUNT_H */
90