xref: /titanic_44/usr/src/uts/common/sys/filio.h (revision 6dfee4834394825da35b977ca71cdc965bc7b6a4)
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 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 /*
31  * University Copyright- Copyright (c) 1982, 1986, 1988
32  * The Regents of the University of California
33  * All Rights Reserved
34  *
35  * University Acknowledgment- Portions of this document are derived from
36  * software developed by the University of California, Berkeley, and its
37  * contributors.
38  */
39 
40 #ifndef _SYS_FILIO_H
41 #define	_SYS_FILIO_H
42 
43 #pragma ident	"%Z%%M%	%I%	%E% SMI"
44 
45 /*
46  * General file ioctl definitions.
47  */
48 
49 #include <sys/ioccom.h>
50 
51 #ifdef	__cplusplus
52 extern "C" {
53 #endif
54 
55 #define	FIOCLEX		_IO('f', 1)		/* set exclusive use on fd */
56 #define	FIONCLEX	_IO('f', 2)		/* remove exclusive use */
57 /* another local */
58 #define	FIONREAD	_IOR('f', 127, int)	/* get # bytes to read */
59 #define	FIONBIO		_IOW('f', 126, int)	/* set/clear non-blocking i/o */
60 #define	FIOASYNC	_IOW('f', 125, int)	/* set/clear async i/o */
61 #define	FIOSETOWN	_IOW('f', 124, int)	/* set owner */
62 #define	FIOGETOWN	_IOR('f', 123, int)	/* get owner */
63 
64 /*
65  * ioctl's for Online: DiskSuite.
66  * WARNING - the support for these ioctls may be withdrawn
67  * in future OS releases.
68  */
69 #define	_FIOLFS		_IO('f', 64)		/* file system lock */
70 #define	_FIOLFSS	_IO('f', 65)		/* file system lock status */
71 #define	_FIOFFS		_IO('f', 66)		/* file system flush */
72 #define	_FIOAI		_FIOOBSOLETE67		/* get allocation info is */
73 #define	_FIOOBSOLETE67	_IO('f', 67)		/* obsolete and unsupported */
74 #define	_FIOSATIME	_IO('f', 68)		/* set atime */
75 #define	_FIOSDIO	_IO('f', 69)		/* set delayed io */
76 #define	_FIOGDIO	_IO('f', 70)		/* get delayed io */
77 #define	_FIOIO		_IO('f', 71)		/* inode open */
78 #define	_FIOISLOG	_IO('f', 72)		/* disksuite/ufs protocol */
79 #define	_FIOISLOGOK	_IO('f', 73)		/* disksuite/ufs protocol */
80 #define	_FIOLOGRESET	_IO('f', 74)		/* disksuite/ufs protocol */
81 
82 /*
83  * Contract-private ioctl()
84  */
85 #define	_FIOISBUSY	_IO('f', 75)		/* networker/ufs protocol */
86 #define	_FIODIRECTIO	_IO('f', 76)		/* directio */
87 #define	_FIOTUNE	_IO('f', 77)		/* tuning */
88 
89 /*
90  * WARNING: These 'f' ioctls are also defined in sys/fs/cachefs_fs.h
91  * It currently defines 78-86.
92  */
93 
94 /*
95  * Internal Logging UFS
96  */
97 #define	_FIOLOGENABLE	_IO('f', 87)		/* logging/ufs protocol */
98 #define	_FIOLOGDISABLE	_IO('f', 88)		/* logging/ufs protocol */
99 
100 /*
101  * File system snapshot ioctls (see sys/fs/ufs_snap.h)
102  * (there is another snapshot ioctl, _FIOSNAPSHOTCREATE_MULTI,
103  * defined farther down in this file.)
104  */
105 #define	_FIOSNAPSHOTCREATE	_IO('f', 89)	/* create a snapshot */
106 #define	_FIOSNAPSHOTDELETE	_IO('f', 90)	/* delete a snapshot */
107 
108 /*
109  * Return the current superblock of size SBSIZE
110  */
111 #define	_FIOGETSUPERBLOCK	_IO('f', 91)
112 
113 /*
114  * Contract private ioctl
115  */
116 #define	_FIOGETMAXPHYS		_IO('f', 92)
117 
118 /*
119  * TSufs support
120  */
121 #define	_FIO_SET_LUFS_DEBUG	_IO('f', 93) /* set lufs_debug */
122 #define	_FIO_SET_LUFS_ERROR	_IO('f', 94) /* set a lufs error */
123 #define	_FIO_GET_TOP_STATS	_IO('f', 95) /* get lufs tranaction stats */
124 
125 /*
126  * create a snapshot with multiple backing files
127  */
128 #define	_FIOSNAPSHOTCREATE_MULTI	_IO('f', 96)
129 
130 /*
131  * handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge
132  */
133 #define	_FIO_SEEK_DATA		_IO('f', 97) /* SEEK_DATA */
134 #define	_FIO_SEEK_HOLE		_IO('f', 98) /* SEEK_HOLE */
135 
136 #ifdef	__cplusplus
137 }
138 #endif
139 
140 #endif	/* _SYS_FILIO_H */
141