xref: /illumos-gate/usr/src/uts/common/sys/filio.h (revision 7c478bd95313f5f23a4c958a745db2134aa0324)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
28*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate /*
31*7c478bd9Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
32*7c478bd9Sstevel@tonic-gate  * The Regents of the University of California
33*7c478bd9Sstevel@tonic-gate  * All Rights Reserved
34*7c478bd9Sstevel@tonic-gate  *
35*7c478bd9Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
36*7c478bd9Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
37*7c478bd9Sstevel@tonic-gate  * contributors.
38*7c478bd9Sstevel@tonic-gate  */
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate #ifndef _SYS_FILIO_H
41*7c478bd9Sstevel@tonic-gate #define	_SYS_FILIO_H
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
44*7c478bd9Sstevel@tonic-gate 
45*7c478bd9Sstevel@tonic-gate /*
46*7c478bd9Sstevel@tonic-gate  * General file ioctl definitions.
47*7c478bd9Sstevel@tonic-gate  */
48*7c478bd9Sstevel@tonic-gate 
49*7c478bd9Sstevel@tonic-gate #include <sys/ioccom.h>
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
52*7c478bd9Sstevel@tonic-gate extern "C" {
53*7c478bd9Sstevel@tonic-gate #endif
54*7c478bd9Sstevel@tonic-gate 
55*7c478bd9Sstevel@tonic-gate #define	FIOCLEX		_IO('f', 1)		/* set exclusive use on fd */
56*7c478bd9Sstevel@tonic-gate #define	FIONCLEX	_IO('f', 2)		/* remove exclusive use */
57*7c478bd9Sstevel@tonic-gate /* another local */
58*7c478bd9Sstevel@tonic-gate #define	FIONREAD	_IOR('f', 127, int)	/* get # bytes to read */
59*7c478bd9Sstevel@tonic-gate #define	FIONBIO		_IOW('f', 126, int)	/* set/clear non-blocking i/o */
60*7c478bd9Sstevel@tonic-gate #define	FIOASYNC	_IOW('f', 125, int)	/* set/clear async i/o */
61*7c478bd9Sstevel@tonic-gate #define	FIOSETOWN	_IOW('f', 124, int)	/* set owner */
62*7c478bd9Sstevel@tonic-gate #define	FIOGETOWN	_IOR('f', 123, int)	/* get owner */
63*7c478bd9Sstevel@tonic-gate 
64*7c478bd9Sstevel@tonic-gate /*
65*7c478bd9Sstevel@tonic-gate  * ioctl's for Online: DiskSuite.
66*7c478bd9Sstevel@tonic-gate  * WARNING - the support for these ioctls may be withdrawn
67*7c478bd9Sstevel@tonic-gate  * in future OS releases.
68*7c478bd9Sstevel@tonic-gate  */
69*7c478bd9Sstevel@tonic-gate #define	_FIOLFS		_IO('f', 64)		/* file system lock */
70*7c478bd9Sstevel@tonic-gate #define	_FIOLFSS	_IO('f', 65)		/* file system lock status */
71*7c478bd9Sstevel@tonic-gate #define	_FIOFFS		_IO('f', 66)		/* file system flush */
72*7c478bd9Sstevel@tonic-gate #define	_FIOAI		_FIOOBSOLETE67		/* get allocation info is */
73*7c478bd9Sstevel@tonic-gate #define	_FIOOBSOLETE67	_IO('f', 67)		/* obsolete and unsupported */
74*7c478bd9Sstevel@tonic-gate #define	_FIOSATIME	_IO('f', 68)		/* set atime */
75*7c478bd9Sstevel@tonic-gate #define	_FIOSDIO	_IO('f', 69)		/* set delayed io */
76*7c478bd9Sstevel@tonic-gate #define	_FIOGDIO	_IO('f', 70)		/* get delayed io */
77*7c478bd9Sstevel@tonic-gate #define	_FIOIO		_IO('f', 71)		/* inode open */
78*7c478bd9Sstevel@tonic-gate #define	_FIOISLOG	_IO('f', 72)		/* disksuite/ufs protocol */
79*7c478bd9Sstevel@tonic-gate #define	_FIOISLOGOK	_IO('f', 73)		/* disksuite/ufs protocol */
80*7c478bd9Sstevel@tonic-gate #define	_FIOLOGRESET	_IO('f', 74)		/* disksuite/ufs protocol */
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate /*
83*7c478bd9Sstevel@tonic-gate  * Contract-private ioctl()
84*7c478bd9Sstevel@tonic-gate  */
85*7c478bd9Sstevel@tonic-gate #define	_FIOISBUSY	_IO('f', 75)		/* networker/ufs protocol */
86*7c478bd9Sstevel@tonic-gate #define	_FIODIRECTIO	_IO('f', 76)		/* directio */
87*7c478bd9Sstevel@tonic-gate #define	_FIOTUNE	_IO('f', 77)		/* tuning */
88*7c478bd9Sstevel@tonic-gate 
89*7c478bd9Sstevel@tonic-gate /*
90*7c478bd9Sstevel@tonic-gate  * WARNING: These 'f' ioctls are also defined in sys/fs/cachefs_fs.h
91*7c478bd9Sstevel@tonic-gate  * It currently defines 78-86.
92*7c478bd9Sstevel@tonic-gate  */
93*7c478bd9Sstevel@tonic-gate 
94*7c478bd9Sstevel@tonic-gate /*
95*7c478bd9Sstevel@tonic-gate  * Internal Logging UFS
96*7c478bd9Sstevel@tonic-gate  */
97*7c478bd9Sstevel@tonic-gate #define	_FIOLOGENABLE	_IO('f', 87)		/* logging/ufs protocol */
98*7c478bd9Sstevel@tonic-gate #define	_FIOLOGDISABLE	_IO('f', 88)		/* logging/ufs protocol */
99*7c478bd9Sstevel@tonic-gate 
100*7c478bd9Sstevel@tonic-gate /*
101*7c478bd9Sstevel@tonic-gate  * File system snapshot ioctls (see sys/fs/ufs_snap.h)
102*7c478bd9Sstevel@tonic-gate  * (there is another snapshot ioctl, _FIOSNAPSHOTCREATE_MULTI,
103*7c478bd9Sstevel@tonic-gate  * defined farther down in this file.)
104*7c478bd9Sstevel@tonic-gate  */
105*7c478bd9Sstevel@tonic-gate #define	_FIOSNAPSHOTCREATE	_IO('f', 89)	/* create a snapshot */
106*7c478bd9Sstevel@tonic-gate #define	_FIOSNAPSHOTDELETE	_IO('f', 90)	/* delete a snapshot */
107*7c478bd9Sstevel@tonic-gate 
108*7c478bd9Sstevel@tonic-gate /*
109*7c478bd9Sstevel@tonic-gate  * Return the current superblock of size SBSIZE
110*7c478bd9Sstevel@tonic-gate  */
111*7c478bd9Sstevel@tonic-gate #define	_FIOGETSUPERBLOCK	_IO('f', 91)
112*7c478bd9Sstevel@tonic-gate 
113*7c478bd9Sstevel@tonic-gate /*
114*7c478bd9Sstevel@tonic-gate  * Contract private ioctl
115*7c478bd9Sstevel@tonic-gate  */
116*7c478bd9Sstevel@tonic-gate #define	_FIOGETMAXPHYS		_IO('f', 92)
117*7c478bd9Sstevel@tonic-gate 
118*7c478bd9Sstevel@tonic-gate /*
119*7c478bd9Sstevel@tonic-gate  * TSufs support
120*7c478bd9Sstevel@tonic-gate  */
121*7c478bd9Sstevel@tonic-gate #define	_FIO_SET_LUFS_DEBUG	_IO('f', 93) /* set lufs_debug */
122*7c478bd9Sstevel@tonic-gate #define	_FIO_SET_LUFS_ERROR	_IO('f', 94) /* set a lufs error */
123*7c478bd9Sstevel@tonic-gate #define	_FIO_GET_TOP_STATS	_IO('f', 95) /* get lufs tranaction stats */
124*7c478bd9Sstevel@tonic-gate 
125*7c478bd9Sstevel@tonic-gate /*
126*7c478bd9Sstevel@tonic-gate  * create a snapshot with multiple backing files
127*7c478bd9Sstevel@tonic-gate  */
128*7c478bd9Sstevel@tonic-gate #define	_FIOSNAPSHOTCREATE_MULTI	_IO('f', 96)
129*7c478bd9Sstevel@tonic-gate 
130*7c478bd9Sstevel@tonic-gate /*
131*7c478bd9Sstevel@tonic-gate  * handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge
132*7c478bd9Sstevel@tonic-gate  */
133*7c478bd9Sstevel@tonic-gate #define	_FIO_SEEK_DATA		_IO('f', 97) /* SEEK_DATA */
134*7c478bd9Sstevel@tonic-gate #define	_FIO_SEEK_HOLE		_IO('f', 98) /* SEEK_HOLE */
135*7c478bd9Sstevel@tonic-gate 
136*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
137*7c478bd9Sstevel@tonic-gate }
138*7c478bd9Sstevel@tonic-gate #endif
139*7c478bd9Sstevel@tonic-gate 
140*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_FILIO_H */
141