]>
git.saurik.com Git - apple/xnu.git/blob - bsd/sys/vnioctl.h
2 * Copyright (c) 2004-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 * Copyright (c) 1988 University of Utah.
25 * Copyright (c) 1990, 1993
26 * The Regents of the University of California. All rights reserved.
28 * This code is derived from software contributed to Berkeley by
29 * the Systems Programming Group of the University of Utah Computer
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions
35 * 1. Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * 2. Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in the
39 * documentation and/or other materials provided with the distribution.
40 * 3. All advertising materials mentioning features or use of this software
41 * must display the following acknowledgement:
42 * This product includes software developed by the University of
43 * California, Berkeley and its contributors.
44 * 4. Neither the name of the University nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
48 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60 * from: Utah $Hdr: fdioctl.h 1.1 90/07/09$
62 * @(#)vnioctl.h 8.1 (Berkeley) 6/10/93
64 * $FreeBSD: src/sys/sys/vnioctl.h,v 1.4 1999/09/17 05:33:58 dillon Exp $
67 #ifndef _SYS_VNIOCTL_H_
68 #define _SYS_VNIOCTL_H_
70 #include <sys/appleapiopts.h>
71 #include <sys/cdefs.h>
75 * Ioctl definitions for file (vnode) disk pseudo-device.
78 #define _PATH_VNTAB "/etc/vntab" /* default config file */
81 vncontrol_readwrite_io_e
= 0
85 char * vn_file
; /* pathname of file to mount */
86 int vn_size
; /* (returned) size of disk */
87 vncontrol_t vn_control
;
92 #if __DARWIN_ALIGN_NATURAL
93 #pragma options align=natural
96 struct user_vn_ioctl
{
97 u_int64_t vn_file
; /* pathname of file to mount */
98 int vn_size
; /* (returned) size of disk */
99 vncontrol_t vn_control
;
102 #if __DARWIN_ALIGN_NATURAL
103 #pragma options align=reset
106 #endif /* KERNEL_PRIVATE */
109 * Before you can use a unit, it must be configured with VNIOCSET.
110 * The configuration persists across opens and closes of the device;
111 * an VNIOCCLR must be used to reset a configuration. An attempt to
112 * VNIOCSET an already active unit will return EBUSY.
114 #define VNIOCATTACH _IOWR('F', 0, struct vn_ioctl) /* attach file */
115 #define VNIOCDETACH _IOWR('F', 1, struct vn_ioctl) /* detach disk */
116 #define VNIOCGSET _IOWR('F', 2, u_int32_t ) /* set global option */
117 #define VNIOCGCLEAR _IOWR('F', 3, u_int32_t ) /* reset --//-- */
118 #define VNIOCUSET _IOWR('F', 4, u_int32_t ) /* set unit option */
119 #define VNIOCUCLEAR _IOWR('F', 5, u_int32_t ) /* reset --//-- */
120 #define VNIOCSHADOW _IOWR('F', 6, struct vn_ioctl) /* attach shadow */
121 #ifdef KERNEL_PRIVATE
122 #define VNIOCATTACH64 _IOWR('F', 0, struct user_vn_ioctl) /* attach file - LP64 */
123 #define VNIOCDETACH64 _IOWR('F', 1, struct user_vn_ioctl) /* detach disk - LP64 */
124 #define VNIOCSHADOW64 _IOWR('F', 6, struct user_vn_ioctl) /* attach shadow - LP64 */
125 #endif /* KERNEL_PRIVATE */
127 #define VN_LABELS 0x1 /* Use disk(/slice) labels */
128 #define VN_FOLLOW 0x2 /* Debug flow in vn driver */
129 #define VN_DEBUG 0x4 /* Debug data in vn driver */
130 #define VN_IO 0x8 /* Debug I/O in vn driver */
131 #define VN_DONTCLUSTER 0x10 /* Don't cluster */
132 #define VN_RESERVE 0x20 /* Pre-reserve swap */
135 #endif /* _SYS_VNIOCTL_H_*/