1df8bae1dSRodney W. Grimes /*- 251369649SPedro F. Giffuni * SPDX-License-Identifier: BSD-3-Clause 351369649SPedro F. Giffuni * 4df8bae1dSRodney W. Grimes * Copyright (c) 1982, 1986, 1990, 1993, 1994 5df8bae1dSRodney W. Grimes * The Regents of the University of California. All rights reserved. 6df8bae1dSRodney W. Grimes * (c) UNIX System Laboratories, Inc. 7df8bae1dSRodney W. Grimes * All or some portions of this file are derived from material licensed 8df8bae1dSRodney W. Grimes * to the University of California by American Telephone and Telegraph 9df8bae1dSRodney W. Grimes * Co. or Unix System Laboratories, Inc. and are reproduced herein with 10df8bae1dSRodney W. Grimes * the permission of UNIX System Laboratories, Inc. 11df8bae1dSRodney W. Grimes * 12df8bae1dSRodney W. Grimes * Redistribution and use in source and binary forms, with or without 13df8bae1dSRodney W. Grimes * modification, are permitted provided that the following conditions 14df8bae1dSRodney W. Grimes * are met: 15df8bae1dSRodney W. Grimes * 1. Redistributions of source code must retain the above copyright 16df8bae1dSRodney W. Grimes * notice, this list of conditions and the following disclaimer. 17df8bae1dSRodney W. Grimes * 2. Redistributions in binary form must reproduce the above copyright 18df8bae1dSRodney W. Grimes * notice, this list of conditions and the following disclaimer in the 19df8bae1dSRodney W. Grimes * documentation and/or other materials provided with the distribution. 20fbbd9655SWarner Losh * 3. Neither the name of the University nor the names of its contributors 21df8bae1dSRodney W. Grimes * may be used to endorse or promote products derived from this software 22df8bae1dSRodney W. Grimes * without specific prior written permission. 23df8bae1dSRodney W. Grimes * 24df8bae1dSRodney W. Grimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25df8bae1dSRodney W. Grimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26df8bae1dSRodney W. Grimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27df8bae1dSRodney W. Grimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28df8bae1dSRodney W. Grimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29df8bae1dSRodney W. Grimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30df8bae1dSRodney W. Grimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31df8bae1dSRodney W. Grimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32df8bae1dSRodney W. Grimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33df8bae1dSRodney W. Grimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34df8bae1dSRodney W. Grimes * SUCH DAMAGE. 35df8bae1dSRodney W. Grimes */ 36df8bae1dSRodney W. Grimes 37df8bae1dSRodney W. Grimes #ifndef _SYS_FILIO_H_ 38df8bae1dSRodney W. Grimes #define _SYS_FILIO_H_ 39df8bae1dSRodney W. Grimes 401bb95729SAlan Somers #include <sys/_types.h> 41df8bae1dSRodney W. Grimes #include <sys/ioccom.h> 42df8bae1dSRodney W. Grimes 43df8bae1dSRodney W. Grimes /* Generic file-descriptor ioctl's. */ 44df8bae1dSRodney W. Grimes #define FIOCLEX _IO('f', 1) /* set close on exec on fd */ 45df8bae1dSRodney W. Grimes #define FIONCLEX _IO('f', 2) /* remove close on exec */ 46df8bae1dSRodney W. Grimes #define FIONREAD _IOR('f', 127, int) /* get # bytes to read */ 47df8bae1dSRodney W. Grimes #define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */ 48df8bae1dSRodney W. Grimes #define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */ 49df8bae1dSRodney W. Grimes #define FIOSETOWN _IOW('f', 124, int) /* set owner */ 50df8bae1dSRodney W. Grimes #define FIOGETOWN _IOR('f', 123, int) /* get owner */ 51b5fca1cbSBrian Feldman #define FIODTYPE _IOR('f', 122, int) /* get d_flags type part */ 52cb2a8dffSSøren Schmidt #define FIOGETLBA _IOR('f', 121, int) /* get start blk # */ 53d65030e5SPoul-Henning Kamp struct fiodgname_arg { 54d65030e5SPoul-Henning Kamp int len; 55d65030e5SPoul-Henning Kamp void *buf; 56d65030e5SPoul-Henning Kamp }; 57d65030e5SPoul-Henning Kamp #define FIODGNAME _IOW('f', 120, struct fiodgname_arg) /* get dev. name */ 58bb520069SPoul-Henning Kamp #define FIONWRITE _IOR('f', 119, int) /* get # bytes (yet) to write */ 592dafac39SEd Maste #define FIONSPACE _IOR('f', 118, int) /* get space in send queue */ 60f6521d1cSPawel Jakub Dawidek /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */ 61f6521d1cSPawel Jakub Dawidek #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ 62f6521d1cSPawel Jakub Dawidek #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ 63d49b446bSAlan Somers struct fiobmap2_arg { 641bb95729SAlan Somers __daddr_t bn; 65d49b446bSAlan Somers int runp; 66d49b446bSAlan Somers int runb; 67d49b446bSAlan Somers }; 681bb95729SAlan Somers /* Get the file's bmap info for the logical block bn. */ 69d49b446bSAlan Somers #define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg) 70*d301b358SKonstantin Belousov /* POSIX shm largepage set/get config */ 71*d301b358SKonstantin Belousov #define FIOSSHMLPGCNF _IOW('f', 100, struct shm_largepage_conf) 72*d301b358SKonstantin Belousov #define FIOGSHMLPGCNF _IOR('f', 101, struct shm_largepage_conf) 73df8bae1dSRodney W. Grimes 74ed34a7fcSBrooks Davis #ifdef _KERNEL 75ed34a7fcSBrooks Davis #ifdef COMPAT_FREEBSD32 76ed34a7fcSBrooks Davis struct fiodgname_arg32 { 77ed34a7fcSBrooks Davis int len; 78ed34a7fcSBrooks Davis uint32_t buf; /* (void *) */ 79ed34a7fcSBrooks Davis }; 80ed34a7fcSBrooks Davis #define FIODGNAME_32 _IOC_NEWTYPE(FIODGNAME, struct fiodgname_arg32) 81ed34a7fcSBrooks Davis #endif 82ed34a7fcSBrooks Davis 83ed34a7fcSBrooks Davis void *fiodgname_buf_get_ptr(void *fgnp, u_long com); 84ed34a7fcSBrooks Davis #endif 85ed34a7fcSBrooks Davis 86df8bae1dSRodney W. Grimes #endif /* !_SYS_FILIO_H_ */ 87