initial-darwin-support-20010327
[openafs.git] / src / afs / sysincludes.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef __AFS_SYSINCLUDESH__
11 #define __AFS_SYSINCLUDESH__ 1
12
13 #ifdef AFS_LINUX22_ENV
14 #include <linux/version.h>
15 #include <linux/config.h>
16 #include <linux/linkage.h>
17 #include <linux/limits.h>
18 #include <linux/wait.h>
19 #include <linux/types.h>
20 #include <linux/vfs.h>
21 #include <linux/net.h>
22 #include <linux/kdev_t.h>
23 #include <linux/ioctl.h>
24 /* Avoid conflicts with coda overloading AFS type namespace. Must precede
25  * inclusion of uaccess.h.
26  */
27 #define _LINUX_CODA_FS_I
28 #define _CFS_HEADER_
29 struct coda_inode_info {};
30 #define _LINUX_XFS_FS_I
31 struct xfs_inode_info {};
32 #include <asm/uaccess.h>
33 #include <linux/list.h>
34 #include <linux/dcache.h>
35 #include <linux/fs.h>
36 #include <linux/quota.h>
37 #include <linux/sched.h>
38 #include <linux/mm.h>
39 #include <linux/string.h>
40 #include <asm/semaphore.h>
41 #include <linux/errno.h>
42
43 #else /* AFS_LINUX22_ENV */
44 #ifdef AFS_DARWIN_ENV    
45 #define _MACH_ETAP_H_   
46 typedef unsigned short                  etap_event_t; 
47 #endif
48 #if     !defined(AFS_OSF_ENV)
49 #include "../h/errno.h"
50 #include "../h/types.h"
51 #include "../h/param.h"
52
53 #ifdef  AFS_AUX_ENV
54 #ifdef  PAGING
55 #include "../h/mmu.h"
56 #include "../h/seg.h"
57 #include "../h/page.h"
58 #include "../h/region.h"
59 #endif /* PAGING */
60 #include "../h/sysmacros.h"
61 #include "../h/signal.h"
62 #include "../h/var.h"
63 #endif /* AFS_AUX_ENV */
64
65 #include "../h/systm.h"
66 #include "../h/time.h"
67
68 #ifdef  AFS_AIX_ENV
69 #ifdef AFS_AIX41_ENV
70 #include "sys/statfs.h"
71 #endif
72 #include "../h/file.h"
73 #include "../h/fullstat.h"
74 #include "../h/vattr.h"
75 #include "../h/var.h"
76 #include "../h/access.h"
77 #endif /* AFS_AIX_ENV */
78
79 #if defined(AFS_SGI_ENV)
80 #include "values.h"
81 #include "../sys/sema.h"
82 #include "../sys/cmn_err.h"
83 #ifdef AFS_SGI64_ENV
84 #include <ksys/behavior.h>
85 #endif /* AFS_SGI64_ENV */
86 #include "../fs/efs_inode.h"
87 #ifdef AFS_SGI_EFS_IOPS_ENV
88 #include "../sgiefs/efs.h"
89 #endif
90 #include "../sys/kmem.h"
91 #include "../sys/cred.h"
92 #include "../sys/resource.h"
93
94 /*
95  * ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG
96  * is on (see afs_osi.h).
97  * In IRIX 6.5 we cannot have DEBUG turned on since certain
98  * system-defined structures have different members with DEBUG on, and
99  * this breaks our ability to interact with the rest of the kernel.
100  *
101  * Instead of using ASSERT(), we use our own osi_Assert().
102  */
103 #if defined(AFS_SGI65_ENV) && !defined(DEBUG)
104 #define DEBUG
105 #include "../sys/debug.h"
106 #undef DEBUG
107 #else
108 #include "../sys/debug.h"
109 #endif
110
111 #include "../sys/statvfs.h"
112 #include "../sys/sysmacros.h"
113 #include "../sys/fs_subr.h"
114 #include "../sys/siginfo.h"
115 #endif  /* AFS_SGI_ENV */
116
117 #if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
118 #  include "../h/kernel.h"
119 #endif /* !SUN5 && !SGI */
120
121 #ifdef  AFS_SUN5_ENV
122 #include <sys/cmn_err.h>        /* for kernel printf() prototype */
123 #endif
124
125 #if     defined(AFS_SUN56_ENV)
126 #include "../h/vfs.h"           /* stops SUN56 socketvar.h warnings */
127 #include "../h/stropts.h"       /* stops SUN56 socketvar.h warnings */
128 #include "../h/stream.h"        /* stops SUN56 socketvar.h errors */
129 #endif
130
131 #include "../h/socket.h"
132 #include "../h/socketvar.h"
133 #include "../h/protosw.h"
134
135 #if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV)
136 #  include "../h/dirent.h"
137 #  ifdef        AFS_SUN5_ENV
138 #    include "../h/sysmacros.h"
139 #    include "../h/fs/ufs_fsdir.h"
140 #  endif /* AFS_SUN5_ENV */
141 #else
142 #  include "../h/dir.h"
143 #endif /* SGI || SUN || HPUX */
144
145 #ifdef AFS_DEC_ENV
146 #  include "../h/smp_lock.h"
147 #endif /* AFS_DEC_ENV */
148
149
150 #ifndef AFS_SGI64_ENV
151 #include "../h/user.h"
152 #endif /* AFS_SGI64_ENV */
153 #define MACH_USER_API   1
154 #include "../h/file.h"
155 #include "../h/uio.h"
156 #include "../h/buf.h"
157 #include "../h/stat.h"
158
159
160 /* ----- The following mainly deal with vnodes/inodes stuff ------ */
161 #ifdef  AFS_DEC_ENV
162 #  include "../h/mount.h"
163 #  include "../machine/psl.h"
164 #  include "../afs/gfs_vnode.h"
165 #endif
166
167 #ifdef  AFS_MACH_ENV
168 #    include <vfs/vfs.h>
169 #    include <vfs/vnode.h>
170 #    include <sys/inode.h>
171 #    include <sys/mount.h>
172 #    include <vm/vm_pager.h>
173 #    include <kern/mfs.h>
174 #    include <mach/vm_param.h>
175 #    include <kern/parallel.h>
176 #endif /* AFS_MACH_ENV */
177
178 #ifndef AFS_DEC_ENV
179 #  ifdef        AFS_SUN5_ENV
180 #    include "../h/statvfs.h"
181 #  endif /* AFS_SUN5_ENV */
182 #  ifdef AFS_HPUX_ENV
183 struct vfspage;                 /* for vnode.h compiler warnings */
184 #    include "../h/swap.h"      /* for struct swpdbd, for vnode.h compiler warnings */
185 #    include "../h/dbd.h"       /* for union idbd, for vnode.h compiler warnings */
186 #  endif /* AFS_HPUX_ENV */
187 #ifdef AFS_DARWIN_ENV
188 #  include <sys/uio.h>
189 #  include <sys/mount.h> 
190 #  include <sys/namei.h>
191 #  include <sys/vnode.h>  
192 #  include <sys/queue.h>    
193 #  include <sys/ubc.h>
194 #define timeout_fcn_t mach_timeout_fcn_t
195 #  include <kern/sched_prim.h>
196 #undef timeout_fcn_t
197 #define _DIR_H_
198 #define doff_t          int32_t
199 #  include <ufs/ufs/quota.h>
200 #  include <ufs/ufs/inode.h>
201 #  include <ufs/ffs/fs.h>
202 #else
203 #  include "../h/vfs.h"
204 #  include "../h/vnode.h"
205 #  ifdef        AFS_SUN5_ENV
206 #    include "../h/fs/ufs_inode.h"
207 #    include "../h/fs/ufs_mount.h"
208 #  else
209 #    if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV)
210 #      include "../ufs/inode.h"
211 #      if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV)
212 #        include "../ufs/mount.h"
213 #      endif /* !AFS_HPUX_ENV */
214 #    endif /* !AFS_AIX32_ENV */
215 #  endif /* AFS_SUN5_ENV */
216 #endif /* AFS_DARWIN_ENV */
217 #endif /* AFS_DEC_ENV */
218
219 /* These mainly deal with networking and rpc headers */
220 #include "../netinet/in.h"
221 #undef  MFREE   /* defined at mount.h for AIX */
222 #ifdef  AFS_SUN5_ENV
223 #  include "../h/time.h"
224 #else
225 #  include "../h/mbuf.h"
226 #endif /* AFS_SUN5_ENV */
227
228 #include "../rpc/types.h"
229 #include "../rpc/xdr.h"
230
231 #ifdef AFS_AIX32_ENV
232 #  include "net/spl.h"
233 #endif
234
235 /* Miscellaneous headers */
236 #include "../h/proc.h"
237 #include "../h/ioctl.h"
238
239 #if     defined(AFS_HPUX101_ENV)
240 #include "../h/proc_iface.h"
241 #include "../h/vas.h"
242 #endif
243
244 #if     defined(AFS_HPUX102_ENV)
245 #include "../h/unistd.h"
246 #include "../h/tty.h"
247 #endif
248
249 #if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV)
250
251 #  include "../h/text.h"
252 #endif 
253
254
255 #if     defined(AFS_AIX_ENV) || defined(AFS_DEC_ENV)
256 #  include "../h/flock.h"       /* fcntl.h is a user-level include in aix */
257 #else
258 #  include "../h/fcntl.h"
259 #endif /* AIX || DEC */
260
261 #if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
262 #  include "../h/unistd.h"
263 #endif /* SGI || SUN */
264
265 #ifdef  AFS_AIX32_ENV
266 #  include "../h/vmuser.h"
267 #endif /* AFS_AIX32_ENV */
268
269 #if     defined(AFS_SUN5_ENV)
270 #include <sys/tiuser.h>
271 #include <sys/t_lock.h>
272 #include <sys/mutex.h>
273 #include <sys/vtrace.h>
274 #include <sys/pathname.h>
275 #include <sys/debug.h>
276 #endif
277
278 #else   /* ! AFS_OSF_ENV */
279 /* All of the OSF/1 stuff is here */
280 #include <net/net_globals.h>
281 #include <errno.h>
282 #include <sys/types.h>
283 #include <sys/param.h>
284 #include <sys/systm.h>
285 #include <sys/time.h>
286 #include <sys/kernel.h>
287 #include <sys/socket.h>
288 #include <sys/socketvar.h>
289 #include <sys/protosw.h>
290 #include <ufs/dir.h>
291 #include <sys/user.h>
292 #include <sys/file.h>
293 #include <sys/uio.h>
294 #include <sys/buf.h>
295 #include <sys/stat.h>
296 #include <sys/vnode.h>
297 #include <ufs/inode.h>
298 #include <sys/mount.h>
299 #include <vm/vm_page.h>
300 #include <mach/vm_param.h>
301 #include <kern/parallel.h>
302 #include <mach/mach_types.h>
303 #ifndef AFS_OSF30_ENV
304 #include <kern/mfs.h>
305 #endif
306 #include <mach/vm_param.h>
307 #include <kern/parallel.h>
308
309 /* These mainly deal with networking and rpc headers */
310 #include <netinet/in.h>
311 #include <sys/mbuf.h>
312 #include <rpc/types.h>
313
314 #ifdef  AFS_ALPHA_ENV
315 #undef kmem_alloc
316 #undef kmem_free
317 #undef mem_alloc
318 #undef mem_free
319 #undef register
320 #endif  /* AFS_ALPHA_ENV */
321
322 #include <rpc/xdr.h>
323 #include <sys/proc.h>
324 #include <sys/ioctl.h>
325
326 #endif  /* AFS_OSF_ENV */
327 #endif /* AFS_LINUX22_ENV */
328
329 #endif /* __AFS_SYSINCLUDESH__  so idempotent */