17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
5986fd29setje * Common Development and Distribution License (the "License").
6986fd29setje * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
217c478bdstevel@tonic-gate/*
22986fd29setje * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bdstevel@tonic-gate * Use is subject to license terms.
24bd93c05Alexander Eremin * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
257c478bdstevel@tonic-gate */
267c478bdstevel@tonic-gate
277c478bdstevel@tonic-gate/*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
28b4203d7Marcel Telka/*	  All Rights Reserved	*/
297c478bdstevel@tonic-gate
307c478bdstevel@tonic-gate/*
317c478bdstevel@tonic-gate * University Copyright- Copyright (c) 1982, 1986, 1988
327c478bdstevel@tonic-gate * The Regents of the University of California
337c478bdstevel@tonic-gate * All Rights Reserved
347c478bdstevel@tonic-gate *
357c478bdstevel@tonic-gate * University Acknowledgment- Portions of this document are derived from
367c478bdstevel@tonic-gate * software developed by the University of California, Berkeley, and its
377c478bdstevel@tonic-gate * contributors.
387c478bdstevel@tonic-gate */
397c478bdstevel@tonic-gate
402bcf024Max Grossman/*
412bcf024Max Grossman * Copyright (c) 2013 by Delphix. All rights reserved.
422bcf024Max Grossman */
432bcf024Max Grossman
447c478bdstevel@tonic-gate#ifndef _SYS_FILIO_H
457c478bdstevel@tonic-gate#define	_SYS_FILIO_H
467c478bdstevel@tonic-gate
477c478bdstevel@tonic-gate/*
487c478bdstevel@tonic-gate * General file ioctl definitions.
497c478bdstevel@tonic-gate */
507c478bdstevel@tonic-gate
517c478bdstevel@tonic-gate#include <sys/ioccom.h>
527c478bdstevel@tonic-gate
537c478bdstevel@tonic-gate#ifdef	__cplusplus
547c478bdstevel@tonic-gateextern "C" {
557c478bdstevel@tonic-gate#endif
567c478bdstevel@tonic-gate
577c478bdstevel@tonic-gate#define	FIOCLEX		_IO('f', 1)		/* set exclusive use on fd */
587c478bdstevel@tonic-gate#define	FIONCLEX	_IO('f', 2)		/* remove exclusive use */
597c478bdstevel@tonic-gate/* another local */
607c478bdstevel@tonic-gate#define	FIONREAD	_IOR('f', 127, int)	/* get # bytes to read */
617c478bdstevel@tonic-gate#define	FIONBIO		_IOW('f', 126, int)	/* set/clear non-blocking i/o */
627c478bdstevel@tonic-gate#define	FIOASYNC	_IOW('f', 125, int)	/* set/clear async i/o */
637c478bdstevel@tonic-gate#define	FIOSETOWN	_IOW('f', 124, int)	/* set owner */
647c478bdstevel@tonic-gate#define	FIOGETOWN	_IOR('f', 123, int)	/* get owner */
657c478bdstevel@tonic-gate
667c478bdstevel@tonic-gate/*
677c478bdstevel@tonic-gate * ioctl's for Online: DiskSuite.
687c478bdstevel@tonic-gate * WARNING - the support for these ioctls may be withdrawn
697c478bdstevel@tonic-gate * in future OS releases.
707c478bdstevel@tonic-gate */
717c478bdstevel@tonic-gate#define	_FIOLFS		_IO('f', 64)		/* file system lock */
727c478bdstevel@tonic-gate#define	_FIOLFSS	_IO('f', 65)		/* file system lock status */
737c478bdstevel@tonic-gate#define	_FIOFFS		_IO('f', 66)		/* file system flush */
747c478bdstevel@tonic-gate#define	_FIOAI		_FIOOBSOLETE67		/* get allocation info is */
757c478bdstevel@tonic-gate#define	_FIOOBSOLETE67	_IO('f', 67)		/* obsolete and unsupported */
767c478bdstevel@tonic-gate#define	_FIOSATIME	_IO('f', 68)		/* set atime */
777c478bdstevel@tonic-gate#define	_FIOSDIO	_IO('f', 69)		/* set delayed io */
787c478bdstevel@tonic-gate#define	_FIOGDIO	_IO('f', 70)		/* get delayed io */
797c478bdstevel@tonic-gate#define	_FIOIO		_IO('f', 71)		/* inode open */
807c478bdstevel@tonic-gate#define	_FIOISLOG	_IO('f', 72)		/* disksuite/ufs protocol */
817c478bdstevel@tonic-gate#define	_FIOISLOGOK	_IO('f', 73)		/* disksuite/ufs protocol */
827c478bdstevel@tonic-gate#define	_FIOLOGRESET	_IO('f', 74)		/* disksuite/ufs protocol */
837c478bdstevel@tonic-gate
847c478bdstevel@tonic-gate/*
857c478bdstevel@tonic-gate * Contract-private ioctl()
867c478bdstevel@tonic-gate */
877c478bdstevel@tonic-gate#define	_FIOISBUSY	_IO('f', 75)		/* networker/ufs protocol */
887c478bdstevel@tonic-gate#define	_FIODIRECTIO	_IO('f', 76)		/* directio */
897c478bdstevel@tonic-gate#define	_FIOTUNE	_IO('f', 77)		/* tuning */
907c478bdstevel@tonic-gate
917c478bdstevel@tonic-gate/*
927c478bdstevel@tonic-gate * Internal Logging UFS
937c478bdstevel@tonic-gate */
947c478bdstevel@tonic-gate#define	_FIOLOGENABLE	_IO('f', 87)		/* logging/ufs protocol */
957c478bdstevel@tonic-gate#define	_FIOLOGDISABLE	_IO('f', 88)		/* logging/ufs protocol */
967c478bdstevel@tonic-gate
977c478bdstevel@tonic-gate/*
987c478bdstevel@tonic-gate * File system snapshot ioctls (see sys/fs/ufs_snap.h)
997c478bdstevel@tonic-gate * (there is another snapshot ioctl, _FIOSNAPSHOTCREATE_MULTI,
1007c478bdstevel@tonic-gate * defined farther down in this file.)
1017c478bdstevel@tonic-gate */
1027c478bdstevel@tonic-gate#define	_FIOSNAPSHOTCREATE	_IO('f', 89)	/* create a snapshot */
1037c478bdstevel@tonic-gate#define	_FIOSNAPSHOTDELETE	_IO('f', 90)	/* delete a snapshot */
1047c478bdstevel@tonic-gate
1057c478bdstevel@tonic-gate/*
1067c478bdstevel@tonic-gate * Return the current superblock of size SBSIZE
1077c478bdstevel@tonic-gate */
1087c478bdstevel@tonic-gate#define	_FIOGETSUPERBLOCK	_IO('f', 91)
1097c478bdstevel@tonic-gate
1107c478bdstevel@tonic-gate/*
1117c478bdstevel@tonic-gate * Contract private ioctl
1127c478bdstevel@tonic-gate */
1137c478bdstevel@tonic-gate#define	_FIOGETMAXPHYS		_IO('f', 92)
1147c478bdstevel@tonic-gate
1157c478bdstevel@tonic-gate/*
1167c478bdstevel@tonic-gate * TSufs support
1177c478bdstevel@tonic-gate */
1187c478bdstevel@tonic-gate#define	_FIO_SET_LUFS_DEBUG	_IO('f', 93) /* set lufs_debug */
1197c478bdstevel@tonic-gate#define	_FIO_SET_LUFS_ERROR	_IO('f', 94) /* set a lufs error */
1207c478bdstevel@tonic-gate#define	_FIO_GET_TOP_STATS	_IO('f', 95) /* get lufs tranaction stats */
1217c478bdstevel@tonic-gate
1227c478bdstevel@tonic-gate/*
1237c478bdstevel@tonic-gate * create a snapshot with multiple backing files
1247c478bdstevel@tonic-gate */
1257c478bdstevel@tonic-gate#define	_FIOSNAPSHOTCREATE_MULTI	_IO('f', 96)
1267c478bdstevel@tonic-gate
1277c478bdstevel@tonic-gate/*
1287c478bdstevel@tonic-gate * handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge
1297c478bdstevel@tonic-gate */
1307c478bdstevel@tonic-gate#define	_FIO_SEEK_DATA		_IO('f', 97) /* SEEK_DATA */
1317c478bdstevel@tonic-gate#define	_FIO_SEEK_HOLE		_IO('f', 98) /* SEEK_HOLE */
1327c478bdstevel@tonic-gate
133986fd29setje/*
134986fd29setje * boot archive compression
135986fd29setje */
136986fd29setje#define	_FIO_COMPRESSED		_IO('f', 99) /* mark file as compressed */
137986fd29setje
1382bcf024Max Grossman/*
1392bcf024Max Grossman * Expose fill information through ioctl
1402bcf024Max Grossman */
1412bcf024Max Grossman#define	_FIO_COUNT_FILLED	_IO('f', 100)	/* count holes in a file */
1422bcf024Max Grossman
1437c478bdstevel@tonic-gate#ifdef	__cplusplus
1447c478bdstevel@tonic-gate}
1457c478bdstevel@tonic-gate#endif
1467c478bdstevel@tonic-gate
1477c478bdstevel@tonic-gate#endif	/* _SYS_FILIO_H */
148