]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
5d5c5d0d A |
2 | * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. |
3 | * | |
2d21ac55 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
0a7de745 | 5 | * |
2d21ac55 A |
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. The rights granted to you under the License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
0a7de745 | 14 | * |
2d21ac55 A |
15 | * Please obtain a copy of the License at |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
0a7de745 | 17 | * |
2d21ac55 A |
18 | * The Original Code and all software distributed under the License are |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
8f6c56a5 A |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
2d21ac55 A |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
0a7de745 | 25 | * |
2d21ac55 | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
1c79356b A |
27 | */ |
28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | |
29 | /* | |
30 | * Copyright (c) 1992, 1993 | |
31 | * The Regents of the University of California. All rights reserved. | |
32 | * | |
33 | * This code is derived from software donated to Berkeley by | |
34 | * Jan-Simon Pendry. | |
35 | * | |
36 | * Redistribution and use in source and binary forms, with or without | |
37 | * modification, are permitted provided that the following conditions | |
38 | * are met: | |
39 | * 1. Redistributions of source code must retain the above copyright | |
40 | * notice, this list of conditions and the following disclaimer. | |
41 | * 2. Redistributions in binary form must reproduce the above copyright | |
42 | * notice, this list of conditions and the following disclaimer in the | |
43 | * documentation and/or other materials provided with the distribution. | |
44 | * 3. All advertising materials mentioning features or use of this software | |
45 | * must display the following acknowledgement: | |
46 | * This product includes software developed by the University of | |
47 | * California, Berkeley and its contributors. | |
48 | * 4. Neither the name of the University nor the names of its contributors | |
49 | * may be used to endorse or promote products derived from this software | |
50 | * without specific prior written permission. | |
51 | * | |
52 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
53 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
54 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
55 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
56 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
57 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
58 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
59 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
60 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
61 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
62 | * SUCH DAMAGE. | |
63 | * | |
64 | * @(#)fdesc.h 8.6 (Berkeley) 8/20/94 | |
65 | * | |
66 | * #Id: fdesc.h,v 1.8 1993/04/06 15:28:33 jsp Exp # | |
67 | */ | |
9bccf70c A |
68 | #ifndef __FDESC_FDESC_H__ |
69 | #define __FDESC_FDESC_H__ | |
1c79356b | 70 | |
9bccf70c A |
71 | #include <sys/appleapiopts.h> |
72 | ||
73 | #ifdef __APPLE_API_PRIVATE | |
1c79356b | 74 | #ifdef KERNEL |
1c79356b | 75 | |
0a7de745 A |
76 | #define FD_ROOT 2 |
77 | #define FD_DEVFD 3 | |
78 | #define FD_STDIN 4 | |
79 | #define FD_STDOUT 5 | |
80 | #define FD_STDERR 6 | |
81 | #define FD_DESC 8 | |
82 | #define FD_MAX 12 | |
1c79356b A |
83 | |
84 | typedef enum { | |
1c79356b | 85 | Fdesc, |
1c79356b A |
86 | } fdntype; |
87 | ||
88 | struct fdescnode { | |
0a7de745 A |
89 | LIST_ENTRY(fdescnode) fd_hash; /* Hash list */ |
90 | struct vnode *fd_vnode; /* Back ptr to vnode */ | |
91 | fdntype fd_type; /* Type of this node */ | |
f427ee49 | 92 | int fd_fd; /* Fd to be dup'ed */ |
0a7de745 A |
93 | const char *fd_link; /* Link to fd/n */ |
94 | int fd_ix; /* filesystem index */ | |
1c79356b A |
95 | }; |
96 | ||
0a7de745 A |
97 | #define VFSTOFDESC(mp) ((struct fdescmount *)((mp)->mnt_data)) |
98 | #define VTOFDESC(vp) ((struct fdescnode *)(vp)->v_data) | |
1c79356b | 99 | |
b0d623f7 A |
100 | __BEGIN_DECLS |
101 | extern int fdesc_allocvp(fdntype, int, struct mount *, struct vnode **, enum vtype, int); | |
91447636 A |
102 | extern int fdesc_badop(void); |
103 | extern int fdesc_getattr(struct vnop_getattr_args *ap); | |
104 | extern int fdesc_inactive(struct vnop_inactive_args *ap); | |
b0d623f7 A |
105 | extern int devfs_fdesc_init(void); |
106 | extern int devfs_fdesc_makelinks(void); | |
91447636 | 107 | extern int fdesc_ioctl(struct vnop_ioctl_args *ap); |
b0d623f7 A |
108 | extern int devfs_devfd_lookup(struct vnop_lookup_args *ap); |
109 | extern int devfs_devfd_readdir(struct vnop_readdir_args *ap); | |
91447636 A |
110 | extern int fdesc_open(struct vnop_open_args *ap); |
111 | extern int fdesc_pathconf(struct vnop_pathconf_args *ap); | |
112 | extern int fdesc_read(struct vnop_read_args *ap); | |
113 | extern int fdesc_readdir(struct vnop_readdir_args *ap); | |
114 | extern int fdesc_readlink(struct vnop_readlink_args *ap); | |
115 | extern int fdesc_reclaim(struct vnop_reclaim_args *ap); | |
116 | extern int fdesc_root(struct mount *, struct vnode **, vfs_context_t); | |
117 | extern int fdesc_select(struct vnop_select_args *ap); | |
118 | extern int fdesc_setattr(struct vnop_setattr_args *ap); | |
119 | extern int fdesc_write(struct vnop_write_args *ap); | |
120 | ||
0a7de745 A |
121 | extern int(**fdesc_vnodeop_p)(void *); |
122 | extern int(**devfs_devfd_vnodeop_p)(void*); | |
1c79356b | 123 | extern struct vfsops fdesc_vfsops; |
b0d623f7 A |
124 | __END_DECLS |
125 | ||
1c79356b | 126 | #endif /* KERNEL */ |
9bccf70c A |
127 | #endif /* __APPLE_API_PRIVATE */ |
128 | #endif /* __FDESC_FDESC_H__ */ |