xref: /onnv-gate/usr/src/uts/common/sys/filio.h (revision 5648:161f8007cab9)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*5648Ssetje  * Common Development and Distribution License (the "License").
6*5648Ssetje  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*5648Ssetje  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
270Sstevel@tonic-gate /*	  All Rights Reserved  	*/
280Sstevel@tonic-gate 
290Sstevel@tonic-gate /*
300Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
310Sstevel@tonic-gate  * The Regents of the University of California
320Sstevel@tonic-gate  * All Rights Reserved
330Sstevel@tonic-gate  *
340Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
350Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
360Sstevel@tonic-gate  * contributors.
370Sstevel@tonic-gate  */
380Sstevel@tonic-gate 
390Sstevel@tonic-gate #ifndef _SYS_FILIO_H
400Sstevel@tonic-gate #define	_SYS_FILIO_H
410Sstevel@tonic-gate 
420Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
430Sstevel@tonic-gate 
440Sstevel@tonic-gate /*
450Sstevel@tonic-gate  * General file ioctl definitions.
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate 
480Sstevel@tonic-gate #include <sys/ioccom.h>
490Sstevel@tonic-gate 
500Sstevel@tonic-gate #ifdef	__cplusplus
510Sstevel@tonic-gate extern "C" {
520Sstevel@tonic-gate #endif
530Sstevel@tonic-gate 
540Sstevel@tonic-gate #define	FIOCLEX		_IO('f', 1)		/* set exclusive use on fd */
550Sstevel@tonic-gate #define	FIONCLEX	_IO('f', 2)		/* remove exclusive use */
560Sstevel@tonic-gate /* another local */
570Sstevel@tonic-gate #define	FIONREAD	_IOR('f', 127, int)	/* get # bytes to read */
580Sstevel@tonic-gate #define	FIONBIO		_IOW('f', 126, int)	/* set/clear non-blocking i/o */
590Sstevel@tonic-gate #define	FIOASYNC	_IOW('f', 125, int)	/* set/clear async i/o */
600Sstevel@tonic-gate #define	FIOSETOWN	_IOW('f', 124, int)	/* set owner */
610Sstevel@tonic-gate #define	FIOGETOWN	_IOR('f', 123, int)	/* get owner */
620Sstevel@tonic-gate 
630Sstevel@tonic-gate /*
640Sstevel@tonic-gate  * ioctl's for Online: DiskSuite.
650Sstevel@tonic-gate  * WARNING - the support for these ioctls may be withdrawn
660Sstevel@tonic-gate  * in future OS releases.
670Sstevel@tonic-gate  */
680Sstevel@tonic-gate #define	_FIOLFS		_IO('f', 64)		/* file system lock */
690Sstevel@tonic-gate #define	_FIOLFSS	_IO('f', 65)		/* file system lock status */
700Sstevel@tonic-gate #define	_FIOFFS		_IO('f', 66)		/* file system flush */
710Sstevel@tonic-gate #define	_FIOAI		_FIOOBSOLETE67		/* get allocation info is */
720Sstevel@tonic-gate #define	_FIOOBSOLETE67	_IO('f', 67)		/* obsolete and unsupported */
730Sstevel@tonic-gate #define	_FIOSATIME	_IO('f', 68)		/* set atime */
740Sstevel@tonic-gate #define	_FIOSDIO	_IO('f', 69)		/* set delayed io */
750Sstevel@tonic-gate #define	_FIOGDIO	_IO('f', 70)		/* get delayed io */
760Sstevel@tonic-gate #define	_FIOIO		_IO('f', 71)		/* inode open */
770Sstevel@tonic-gate #define	_FIOISLOG	_IO('f', 72)		/* disksuite/ufs protocol */
780Sstevel@tonic-gate #define	_FIOISLOGOK	_IO('f', 73)		/* disksuite/ufs protocol */
790Sstevel@tonic-gate #define	_FIOLOGRESET	_IO('f', 74)		/* disksuite/ufs protocol */
800Sstevel@tonic-gate 
810Sstevel@tonic-gate /*
820Sstevel@tonic-gate  * Contract-private ioctl()
830Sstevel@tonic-gate  */
840Sstevel@tonic-gate #define	_FIOISBUSY	_IO('f', 75)		/* networker/ufs protocol */
850Sstevel@tonic-gate #define	_FIODIRECTIO	_IO('f', 76)		/* directio */
860Sstevel@tonic-gate #define	_FIOTUNE	_IO('f', 77)		/* tuning */
870Sstevel@tonic-gate 
880Sstevel@tonic-gate /*
890Sstevel@tonic-gate  * WARNING: These 'f' ioctls are also defined in sys/fs/cachefs_fs.h
900Sstevel@tonic-gate  * It currently defines 78-86.
910Sstevel@tonic-gate  */
920Sstevel@tonic-gate 
930Sstevel@tonic-gate /*
940Sstevel@tonic-gate  * Internal Logging UFS
950Sstevel@tonic-gate  */
960Sstevel@tonic-gate #define	_FIOLOGENABLE	_IO('f', 87)		/* logging/ufs protocol */
970Sstevel@tonic-gate #define	_FIOLOGDISABLE	_IO('f', 88)		/* logging/ufs protocol */
980Sstevel@tonic-gate 
990Sstevel@tonic-gate /*
1000Sstevel@tonic-gate  * File system snapshot ioctls (see sys/fs/ufs_snap.h)
1010Sstevel@tonic-gate  * (there is another snapshot ioctl, _FIOSNAPSHOTCREATE_MULTI,
1020Sstevel@tonic-gate  * defined farther down in this file.)
1030Sstevel@tonic-gate  */
1040Sstevel@tonic-gate #define	_FIOSNAPSHOTCREATE	_IO('f', 89)	/* create a snapshot */
1050Sstevel@tonic-gate #define	_FIOSNAPSHOTDELETE	_IO('f', 90)	/* delete a snapshot */
1060Sstevel@tonic-gate 
1070Sstevel@tonic-gate /*
1080Sstevel@tonic-gate  * Return the current superblock of size SBSIZE
1090Sstevel@tonic-gate  */
1100Sstevel@tonic-gate #define	_FIOGETSUPERBLOCK	_IO('f', 91)
1110Sstevel@tonic-gate 
1120Sstevel@tonic-gate /*
1130Sstevel@tonic-gate  * Contract private ioctl
1140Sstevel@tonic-gate  */
1150Sstevel@tonic-gate #define	_FIOGETMAXPHYS		_IO('f', 92)
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate /*
1180Sstevel@tonic-gate  * TSufs support
1190Sstevel@tonic-gate  */
1200Sstevel@tonic-gate #define	_FIO_SET_LUFS_DEBUG	_IO('f', 93) /* set lufs_debug */
1210Sstevel@tonic-gate #define	_FIO_SET_LUFS_ERROR	_IO('f', 94) /* set a lufs error */
1220Sstevel@tonic-gate #define	_FIO_GET_TOP_STATS	_IO('f', 95) /* get lufs tranaction stats */
1230Sstevel@tonic-gate 
1240Sstevel@tonic-gate /*
1250Sstevel@tonic-gate  * create a snapshot with multiple backing files
1260Sstevel@tonic-gate  */
1270Sstevel@tonic-gate #define	_FIOSNAPSHOTCREATE_MULTI	_IO('f', 96)
1280Sstevel@tonic-gate 
1290Sstevel@tonic-gate /*
1300Sstevel@tonic-gate  * handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge
1310Sstevel@tonic-gate  */
1320Sstevel@tonic-gate #define	_FIO_SEEK_DATA		_IO('f', 97) /* SEEK_DATA */
1330Sstevel@tonic-gate #define	_FIO_SEEK_HOLE		_IO('f', 98) /* SEEK_HOLE */
1340Sstevel@tonic-gate 
135*5648Ssetje /*
136*5648Ssetje  * boot archive compression
137*5648Ssetje  */
138*5648Ssetje #define	_FIO_COMPRESSED		_IO('f', 99) /* mark file as compressed */
139*5648Ssetje 
1400Sstevel@tonic-gate #ifdef	__cplusplus
1410Sstevel@tonic-gate }
1420Sstevel@tonic-gate #endif
1430Sstevel@tonic-gate 
1440Sstevel@tonic-gate #endif	/* _SYS_FILIO_H */
145