macos-rollup-20051013
[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 #ifdef UKERNEL
11 #include <UKERNEL/sysincludes.h>
12 #else
13
14 #ifndef __AFS_SYSINCLUDESH__
15 #define __AFS_SYSINCLUDESH__ 1
16
17 #ifdef AFS_OBSD_ENV
18 #include <sys/errno.h>
19 #include <sys/types.h>
20 #include <sys/param.h>
21 #include <sys/lock.h>
22 #include <sys/queue.h>
23 #include <sys/resourcevar.h>
24 #include <sys/kernel.h>
25 #include <sys/proc.h>
26 #include <sys/time.h>
27 #include <sys/filedesc.h>
28 #include <sys/file.h>
29 #include <sys/socket.h>
30 #include <sys/socketvar.h>
31 #include <sys/dirent.h>
32 #include <sys/user.h>
33 #include <sys/uio.h>
34 #include <sys/buf.h>
35 #include <sys/stat.h>
36 #include <sys/mount.h>
37 #include <sys/vnode.h>
38 #include <sys/malloc.h>
39 #include <ufs/ffs/fs.h>
40 #include <ufs/ufs/quota.h>
41 #include <ufs/ufs/inode.h>
42 #ifndef AFS_OBSD38_ENV
43 #include <ufs/ufs/extattr.h>
44 #endif
45 #include <ufs/ufs/ufsmount.h>
46 #ifndef MLEN
47 #include <sys/mbuf.h>
48 #include <net/if.h>
49 #endif
50 #include <sys/protosw.h>
51 #include <sys/ioctl.h>
52 #include <sys/timeout.h>
53 #else /* AFS_OBSD_ENV */
54 #ifdef AFS_LINUX22_ENV
55 #include <linux/version.h>
56 #include <linux/config.h>
57 #include <linux/linkage.h>
58 #include <linux/limits.h>
59 #include <linux/wait.h>
60 #include <linux/types.h>
61 #include <linux/vfs.h>
62 #include <linux/net.h>
63 #include <linux/kdev_t.h>
64 #include <linux/ioctl.h>
65 #if defined(AFS_LINUX26_ENV)
66 #include <linux/backing-dev.h>
67 #include <linux/pagemap.h>
68 #include <linux/namei.h>
69 #ifdef STRUCT_INODE_HAS_I_SECURITY
70 #include <linux/security.h>
71 #endif
72 #include <linux/suspend.h>
73 #endif
74 /* Avoid conflicts with coda overloading AFS type namespace. Must precede
75  * inclusion of uaccess.h.
76  */
77 #ifndef _LINUX_CODA_FS_I
78 #define _LINUX_CODA_FS_I
79 #define _CODA_HEADER_
80 #define _CFS_HEADER_
81 struct coda_inode_info {
82 };
83 #endif
84 #ifndef _LINUX_XFS_FS_I
85 #define _LINUX_XFS_FS_I
86 struct xfs_inode_info {
87 };
88 #endif
89 #include <asm/uaccess.h>
90 #include <linux/list.h>
91 #include <linux/dcache.h>
92 #include <linux/mount.h>
93 #include <linux/fs.h>
94 #include <linux/quota.h>
95 #include <linux/sched.h>
96 #include <linux/mm.h>
97 #include <linux/slab.h>
98 #include <linux/string.h>
99 #include <asm/semaphore.h>
100 #include <linux/errno.h>
101 #ifdef COMPLETION_H_EXISTS
102 #include <linux/completion.h>
103 #endif
104
105 #else /* AFS_LINUX22_ENV */
106 #if defined(AFS_DARWIN_ENV)
107 #ifndef _MACH_ETAP_H_
108 #define _MACH_ETAP_H_
109 typedef unsigned short etap_event_t;
110 #endif
111 #endif
112 #if     !defined(AFS_OSF_ENV)
113 #include "h/errno.h"
114 #include "h/types.h"
115 #include "h/param.h"
116
117 #ifdef  AFS_AUX_ENV
118 #ifdef  PAGING
119 #include "h/mmu.h"
120 #include "h/seg.h"
121 #include "h/page.h"
122 #include "h/region.h"
123 #endif /* PAGING */
124 #include "h/sysmacros.h"
125 #include "h/signal.h"
126 #include "h/var.h"
127 #endif /* AFS_AUX_ENV */
128
129 #include "h/systm.h"
130 #include "h/time.h"
131
132 #ifdef  AFS_AIX_ENV
133 #ifdef AFS_AIX41_ENV
134 #include "sys/statfs.h"
135 #endif
136 #ifdef AFS_AIX51_ENV
137 #include "sys/acl.h"
138 #endif
139 #include "../h/file.h"
140 #include "../h/fullstat.h"
141 #include "../h/vattr.h"
142 #include "../h/var.h"
143 #include "../h/access.h"
144 #endif /* AFS_AIX_ENV */
145
146 #if defined(AFS_SGI_ENV)
147 #include "values.h"
148 #include "sys/sema.h"
149 #include "sys/cmn_err.h"
150 #ifdef AFS_SGI64_ENV
151 #include <ksys/behavior.h>
152 /* in 6.5.20f, ksys/behavior.h doesn't bother to define BHV_IS_BHVL,
153  * but sys/vnode.h uses it in VNODE_TO_FIRST_BHV. It looks like from
154  * older headers like we want the old behavior, so we fake it. */
155 #if defined(BHV_PREPARE) && !defined(CELL_CAPABLE)
156 #define BHV_IS_BHVL(bhp) (0)
157 #endif
158 #endif /* AFS_SGI64_ENV */
159 #include "fs/efs_inode.h"
160 #ifdef AFS_SGI_EFS_IOPS_ENV
161 #include "sgiefs/efs.h"
162 #endif
163 #include "sys/kmem.h"
164 #include "sys/cred.h"
165 #include "sys/resource.h"
166
167 /*
168  * ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG
169  * is on (see afs_osi.h).
170  * In IRIX 6.5 we cannot have DEBUG turned on since certain
171  * system-defined structures have different members with DEBUG on, and
172  * this breaks our ability to interact with the rest of the kernel.
173  *
174  * Instead of using ASSERT(), we use our own osi_Assert().
175  */
176 #if defined(AFS_SGI65_ENV) && !defined(DEBUG)
177 #define DEBUG
178 #include "sys/debug.h"
179 #undef DEBUG
180 #else
181 #include "sys/debug.h"
182 #endif
183
184 #include "sys/statvfs.h"
185 #include "sys/sysmacros.h"
186 #include "sys/fs_subr.h"
187 #include "sys/siginfo.h"
188 #endif /* AFS_SGI_ENV */
189
190 #if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
191 #  include "h/kernel.h"
192 #endif /* !SUN5 && !SGI */
193
194 #ifdef  AFS_SUN5_ENV
195 #include <sys/cmn_err.h>        /* for kernel printf() prototype */
196 #endif
197
198 #if     defined(AFS_SUN56_ENV)
199 #include "h/vfs.h"              /* stops SUN56 socketvar.h warnings */
200 #include "h/stropts.h"          /* stops SUN56 socketvar.h warnings */
201 #include "h/stream.h"           /* stops SUN56 socketvar.h errors */
202 #endif
203
204 #ifdef AFS_SUN510_ENV
205 #include <sys/cred_impl.h>
206 #endif
207
208 #include "h/socket.h"
209 #include "h/socketvar.h"
210 #include "h/protosw.h"
211
212 #if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV)
213 #  include "h/dirent.h"
214 #  ifdef        AFS_SUN5_ENV
215 #    include "h/sysmacros.h"
216 #    include "h/fs/ufs_fsdir.h"
217 #  endif /* AFS_SUN5_ENV */
218 #else
219 #  include "h/dir.h"
220 #endif /* SGI || SUN || HPUX */
221
222 #if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV)
223 #include "h/user.h"
224 #endif /* AFS_SGI64_ENV */
225 #define MACH_USER_API   1
226 #if defined(AFS_FBSD50_ENV)
227 #include "h/bio.h"
228 #include "h/filedesc.h"
229 #endif
230 #include "h/file.h"
231 #include "h/uio.h"
232 #include "h/buf.h"
233 #include "h/stat.h"
234
235
236 /* ----- The following mainly deal with vnodes/inodes stuff ------ */
237 #  ifdef        AFS_SUN5_ENV
238 #    include "h/statvfs.h"
239 #  endif /* AFS_SUN5_ENV */
240 #  ifdef AFS_HPUX_ENV
241 struct vfspage;                 /* for vnode.h compiler warnings */
242 #    include "h/swap.h"         /* for struct swpdbd, for vnode.h compiler warnings */
243 #    include "h/dbd.h"          /* for union idbd, for vnode.h compiler warnings */
244 #ifdef AFS_HPUX110_ENV
245 #    include "h/resource.h"
246 #endif
247 #ifdef AFS_HPUX1123_ENV 
248 #       include <sys/user.h>
249 #       include <sys/cred.h>
250 #endif
251 #  endif /* AFS_HPUX_ENV */
252 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
253 #  if defined(AFS_FBSD50_ENV)
254 struct vop_getwritemount_args;
255 #  endif
256 #  include <sys/uio.h>
257 #  include <sys/mount.h>
258 #  include <sys/namei.h>
259 #ifdef AFS_DARWIN80_ENV
260 #  include <sys/kauth.h>
261 #include <string.h>
262 #endif
263 #  include <sys/vnode.h>
264 #  include <sys/queue.h>
265 #  include <sys/malloc.h>
266 #ifndef AFS_FBSD_ENV
267 #  include <sys/ubc.h>
268 #define timeout_fcn_t mach_timeout_fcn_t
269 #  include <kern/sched_prim.h>
270 #else
271 MALLOC_DECLARE(M_AFS);
272 #  include <ufs/ufs/dinode.h>
273 #  include <vm/vm.h>
274 #  include <vm/vm_extern.h>
275 #  include <vm/pmap.h>
276 #  include <vm/vm_map.h>
277 #  include <sys/lock.h>
278 #  include <sys/user.h>
279 #endif
280 #undef timeout_fcn_t
281 #define _DIR_H_
282 #define doff_t          int32_t
283 #ifndef AFS_DARWIN80_ENV
284 #  include <ufs/ufs/quota.h>
285 #  include <ufs/ufs/inode.h>
286 #  include <ufs/ffs/fs.h>
287 #endif
288 #else
289 #  include "h/vfs.h"
290 #  include "h/vnode.h"
291 #  ifdef        AFS_SUN5_ENV
292 #    include "h/fs/ufs_inode.h"
293 #    include "h/fs/ufs_mount.h"
294 #  else
295 #    if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV)
296 #      include "ufs/inode.h"
297 #      if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV)
298 #        include "ufs/mount.h"
299 #      endif /* !AFS_HPUX_ENV */
300 #    endif /* !AFS_AIX32_ENV */
301 #  endif /* AFS_SUN5_ENV */
302 #endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
303
304 /* These mainly deal with networking and rpc headers */
305 #include "netinet/in.h"
306 #undef  MFREE                   /* defined at mount.h for AIX */
307 #ifdef  AFS_SUN5_ENV
308 #  include "h/time.h"
309 #else
310 #if !defined(AFS_HPUX_ENV)
311 #  include "h/mbuf.h"
312 #endif
313 #endif /* AFS_SUN5_ENV */
314
315 #include "rpc/types.h"
316 #include "rx/xdr.h"
317
318 /* Miscellaneous headers */
319 #include "h/proc.h"
320 #if !defined(AFS_FBSD_ENV)
321 #include "h/ioctl.h"
322 #endif /* AFS_FBSD_ENV */
323
324 #if     defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV)
325 #include "h/proc_iface.h"
326 #include "h/vas.h"
327 #endif
328
329 #if     defined(AFS_HPUX102_ENV)
330 #include "h/unistd.h"
331 #include "h/tty.h"
332 #endif
333
334 #if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
335
336 #  include "h/text.h"
337 #endif
338
339
340 #if     defined(AFS_AIX_ENV) 
341 #  include "h/flock.h"          /* fcntl.h is a user-level include in aix */
342 #else
343 #  include "h/fcntl.h"
344 #endif /* AIX */
345
346 #if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
347 #  include "h/unistd.h"
348 #endif /* SGI || SUN */
349
350 #ifdef  AFS_AIX32_ENV
351 #  include "h/vmuser.h"
352 #endif /* AFS_AIX32_ENV */
353
354 #if     defined(AFS_SUN5_ENV)
355 #include <sys/tiuser.h>
356 #include <sys/t_lock.h>
357 #include <sys/mutex.h>
358 #include <sys/vtrace.h>
359 #include <sys/pathname.h>
360 #include <sys/debug.h>
361 #endif
362
363 #else /* ! AFS_OSF_ENV */
364 /* All of the OSF/1 stuff is here */
365 #include <net/net_globals.h>
366 #include <errno.h>
367 #include <sys/types.h>
368 #include <sys/param.h>
369 #include <sys/systm.h>
370 #include <sys/time.h>
371 #include <sys/kernel.h>
372 #include <sys/socket.h>
373 #include <sys/socketvar.h>
374 #include <sys/protosw.h>
375 #include <ufs/dir.h>
376 #include <sys/user.h>
377 #include <sys/file.h>
378 #include <sys/uio.h>
379 #include <sys/buf.h>
380 #include <sys/stat.h>
381 #include <sys/vnode.h>
382 #include <ufs/inode.h>
383 #include <sys/mount.h>
384 #include <vm/vm_page.h>
385 #include <mach/vm_param.h>
386 #include <kern/parallel.h>
387 #include <mach/mach_types.h>
388 #ifndef AFS_OSF30_ENV
389 #include <kern/mfs.h>
390 #endif
391 #include <mach/vm_param.h>
392 #include <kern/parallel.h>
393
394 /* These mainly deal with networking and rpc headers */
395 #include <netinet/in.h>
396 #include <sys/mbuf.h>
397 #include <rpc/types.h>
398
399 #ifdef  AFS_OSF_ENV
400 #undef kmem_alloc
401 #undef kmem_free
402 #undef mem_alloc
403 #undef mem_free
404 #undef register
405 #endif /* AFS_OSF_ENV */
406
407 #include <rx/xdr.h>
408 #include <sys/proc.h>
409 #include <sys/ioctl.h>
410
411 #endif /* AFS_OSF_ENV */
412 #endif /* AFS_LINUX22_ENV */
413 #endif /* AFS_OBSD_ENV */
414
415 #endif /* __AFS_SYSINCLUDESH__  so idempotent */
416
417 #endif