Merge 1.8.0~pre4 packaging into master
[pkg-k5-afs_openafs.git] / src / afs / sysincludes.h
blob629b3e6f9a3850fe1c5279d3a8ea566783b0f8af
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
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 */
10 #ifdef UKERNEL
11 # include <UKERNEL/sysincludes.h>
12 #else
14 #ifndef __AFS_SYSINCLUDESH__
15 #define __AFS_SYSINCLUDESH__ 1
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>
54 #elif defined(AFS_NBSD40_ENV)
55 # if defined(AFS_NBSD50_ENV) && !defined(AFS_NBSD70_ENV)
56 # include <sys/simplelock.h>
57 # endif
58 # include <sys/errno.h>
59 # include <sys/types.h>
60 # include <sys/mount.h> /* may define MOUNT_AFS */
61 # include <sys/param.h>
62 # include <sys/systm.h>
63 # include <sys/conf.h>
64 # include <sys/exec.h>
65 # include <sys/lock.h>
66 # include <sys/syscall.h>
67 # include <sys/syscallargs.h>
68 # include <sys/queue.h>
69 # include <sys/resourcevar.h>
70 # include <sys/kernel.h>
71 # include <sys/proc.h>
72 # include <sys/time.h>
73 # include <sys/filedesc.h>
74 # include <sys/exec.h>
75 # include <sys/lock.h>
76 # include <sys/syscall.h>
77 # include <sys/syscallargs.h>
78 # include <sys/queue.h>
79 # include <sys/resourcevar.h>
80 # include <sys/kernel.h>
81 # include <sys/proc.h>
82 # include <sys/time.h>
83 # include <sys/filedesc.h>
84 # include <sys/file.h>
85 # include <sys/socket.h>
86 # include <sys/socketvar.h>
87 # include <sys/dirent.h>
88 # include <sys/kauth.h>
89 # include <sys/uio.h>
90 # include <sys/buf.h>
91 # include <sys/stat.h>
92 # include <sys/file.h>
93 # include <sys/namei.h>
94 # include <sys/uio.h>
95 # include <sys/buf.h>
96 # include <sys/file.h>
97 # include <sys/namei.h>
98 # include <sys/vnode.h>
99 # include <ufs/ffs/fs.h>
100 # include <ufs/ufs/quota.h>
101 # include <ufs/ufs/inode.h>
102 # include <ufs/ufs/extattr.h>
103 # include <ufs/ufs/ufsmount.h>
104 # ifndef MLEN
105 # include <sys/mbuf.h>
106 # include <net/if.h>
107 # endif /* !MLEN */
108 # include <sys/protosw.h>
109 # include <sys/ioctl.h>
111 #elif defined(AFS_LINUX22_ENV)
112 # include <linux/version.h>
113 # ifdef HAVE_LINUX_CONFIG_H
114 # include <linux/config.h>
115 # endif
116 # include <linux/linkage.h>
117 # include <linux/limits.h>
118 # include <linux/wait.h>
119 # include <linux/types.h>
120 # include <linux/vfs.h>
121 # include <linux/net.h>
122 # include <linux/kdev_t.h>
123 # include <linux/ioctl.h>
124 # if defined(AFS_LINUX26_ENV)
125 # include <linux/backing-dev.h>
126 # include <linux/pagemap.h>
127 # include <linux/namei.h>
128 # ifdef STRUCT_INODE_HAS_I_SECURITY
129 # include <linux/security.h>
130 # endif
131 # include <linux/suspend.h>
132 # endif
133 /* Avoid conflicts with coda overloading AFS type namespace. Must precede
134 * inclusion of uaccess.h.
136 # ifndef _LINUX_CODA_FS_I
137 # define _LINUX_CODA_FS_I
138 # define _CODA_HEADER_
139 # define _CFS_HEADER_
140 struct coda_inode_info {
142 # endif
143 # ifndef _LINUX_XFS_FS_I
144 # define _LINUX_XFS_FS_I
145 struct xfs_inode_info {
147 # endif
148 # if defined(HAVE_LINUX_UACCESS_H)
149 # include <linux/uaccess.h>
150 # else
151 # include <asm/uaccess.h>
152 # endif
153 # include <linux/list.h>
154 # include <linux/dcache.h>
155 # include <linux/mount.h>
156 # include <linux/fs.h>
157 # include <linux/quota.h>
158 # include <linux/sched.h>
159 # if defined(HAVE_LINUX_SCHED_SIGNAL_H)
160 # include <linux/sched/signal.h>
161 # endif
162 # include <linux/mm.h>
163 # include <linux/slab.h>
164 # include <linux/proc_fs.h>
165 # include <linux/string.h>
166 # if defined(HAVE_LINUX_SEMAPHORE_H)
167 # include <linux/semaphore.h>
168 # else
169 # include <asm/semaphore.h>
170 # endif
171 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
172 # include <linux/mutex.h>
173 # endif
174 # include <linux/errno.h>
175 # include <linux/completion.h>
176 # if defined(HAVE_LINUX_EXPORTFS_H)
177 # include <linux/exportfs.h>
178 # endif
179 # ifdef AFS_LINUX24_ENV
180 # include <linux/pagemap.h>
181 # endif
183 #else /* AFS_LINUX22_ENV */
184 # if defined(AFS_DARWIN_ENV)
185 # ifndef _MACH_ETAP_H_
186 # define _MACH_ETAP_H_
187 typedef unsigned short etap_event_t;
188 # endif
189 # endif
191 # include "h/errno.h"
192 # include "h/types.h"
193 # include "h/param.h"
195 # ifdef AFS_AUX_ENV
196 # ifdef PAGING
197 # include "h/mmu.h"
198 # include "h/seg.h"
199 # include "h/page.h"
200 # include "h/region.h"
201 # endif /* PAGING */
202 # include "h/sysmacros.h"
203 # include "h/signal.h"
204 # include "h/var.h"
205 # endif /* AFS_AUX_ENV */
207 # include "h/systm.h"
208 # include "h/time.h"
210 # ifdef AFS_FBSD_ENV
211 # include <sys/socket.h>
212 # include <net/if.h>
213 # include <net/if_var.h>
214 # endif
216 # ifdef AFS_AIX_ENV
217 # ifdef AFS_AIX41_ENV
218 # include "sys/statfs.h"
219 # endif
220 # ifdef AFS_AIX51_ENV
221 # include "sys/acl.h"
222 # endif
223 # include "../h/file.h"
224 # include "../h/fullstat.h"
225 # include "../h/vattr.h"
226 # include "../h/var.h"
227 # include "../h/access.h"
228 # endif /* AFS_AIX_ENV */
230 # if defined(AFS_SGI_ENV)
231 # include "values.h"
232 # include "sys/sema.h"
233 # include "sys/cmn_err.h"
234 # ifdef AFS_SGI64_ENV
235 # include <ksys/behavior.h>
236 /* in 6.5.20f, ksys/behavior.h doesn't bother to define BHV_IS_BHVL,
237 * but sys/vnode.h uses it in VNODE_TO_FIRST_BHV. It looks like from
238 * older headers like we want the old behavior, so we fake it. */
239 # if defined(BHV_PREPARE) && !defined(CELL_CAPABLE)
240 # define BHV_IS_BHVL(bhp) (0)
241 # endif
242 # endif /* AFS_SGI64_ENV */
243 # include "fs/efs_inode.h"
244 # include "sys/kmem.h"
245 # include "sys/cred.h"
246 # include "sys/resource.h"
249 * ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG
250 * is on (see afs_osi.h).
251 * In IRIX 6.5 we cannot have DEBUG turned on since certain
252 * system-defined structures have different members with DEBUG on, and
253 * this breaks our ability to interact with the rest of the kernel.
255 * Instead of using ASSERT(), we use our own osi_Assert().
257 # if defined(AFS_SGI65_ENV) && !defined(DEBUG)
258 # define DEBUG
259 # include "sys/debug.h"
260 # undef DEBUG
261 # else
262 # include "sys/debug.h"
263 # endif
265 # include "sys/statvfs.h"
266 # include "sys/sysmacros.h"
267 # include "sys/fs_subr.h"
268 # include "sys/siginfo.h"
269 # include "limits.h"
270 # endif /* AFS_SGI_ENV */
272 # if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
273 # include "h/kernel.h"
274 # endif /* !SUN5 && !SGI */
276 # ifdef AFS_SUN5_ENV
277 # include <sys/cmn_err.h> /* for kernel printf() prototype */
278 # include "h/vfs.h" /* stops SUN5 socketvar.h warnings */
279 # include "h/stropts.h" /* stops SUN5 socketvar.h warnings */
280 # include "h/stream.h" /* stops SUN5 socketvar.h errors */
281 # endif
283 # ifdef AFS_SUN510_ENV
284 # include <sys/cred_impl.h>
285 # include <sys/policy.h>
286 # endif
288 # include "h/socket.h"
289 # include "h/socketvar.h"
290 # include "h/protosw.h"
292 # if defined(AFS_FBSD_ENV)
293 # include "sys/limits.h"
294 # endif
296 # ifdef AFS_HPUX_ENV
297 # include "limits.h"
298 # endif
300 # if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || \
301 defined(AFS_FBSD_ENV) || defined(AFS_NBSD40_ENV)
302 # include "h/dirent.h"
303 # ifdef AFS_SUN5_ENV
304 # include "h/sysmacros.h"
305 # include "h/fs/ufs_fsdir.h"
306 # endif /* AFS_SUN5_ENV */
307 # else
308 # include "h/dir.h"
309 # endif /* SGI || SUN || HPUX */
311 # if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV) && \
312 !defined(AFS_NBSD40_ENV)
313 # include "h/user.h"
314 # endif /* AFS_SGI64_ENV */
315 # define MACH_USER_API 1
316 # if defined(AFS_FBSD_ENV)
317 # include "h/bio.h"
318 # include "h/filedesc.h"
319 # endif
320 # include "h/file.h"
321 # include "h/uio.h"
322 # include "h/buf.h"
323 # include "h/stat.h"
326 /* ----- The following mainly deal with vnodes/inodes stuff ------ */
327 # ifdef AFS_SUN5_ENV
328 # include "h/statvfs.h"
329 # endif /* AFS_SUN5_ENV */
330 # ifdef AFS_HPUX_ENV
331 struct vfspage; /* for vnode.h compiler warnings */
332 # include "h/swap.h" /* for struct swpdbd, for vnode.h compiler warnings */
333 # include "h/dbd.h" /* for union idbd, for vnode.h compiler warnings */
334 # ifdef AFS_HPUX110_ENV
335 # include "h/resource.h"
336 # endif
337 # ifdef AFS_HPUX1123_ENV
338 # include <sys/user.h>
339 # include <sys/cred.h>
340 # endif
341 # endif /* AFS_HPUX_ENV */
342 # if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
343 # if defined(AFS_FBSD_ENV)
344 struct vop_getwritemount_args;
345 # endif
346 # include <sys/uio.h>
347 # include <sys/mount.h>
348 # include <sys/namei.h>
349 # ifdef AFS_DARWIN80_ENV
350 # include <sys/kauth.h>
351 # include <string.h>
352 # endif
353 # include <sys/vnode.h>
354 # include <sys/queue.h>
355 # ifndef AFS_NBSD40_ENV
356 # include <sys/malloc.h>
357 # endif
358 # ifdef AFS_FBSD_ENV
359 MALLOC_DECLARE(M_AFS);
360 # include <ufs/ufs/dinode.h>
361 # include <vm/vm.h>
362 # include <vm/vm_extern.h>
363 # include <vm/pmap.h>
364 # include <vm/vm_map.h>
365 # include <sys/lock.h>
366 # include <sys/user.h>
367 # else
368 # include <sys/ubc.h>
369 # define timeout_fcn_t mach_timeout_fcn_t
370 # include <kern/sched_prim.h>
371 # endif
372 # undef timeout_fcn_t
373 # define _DIR_H_
374 # define doff_t int32_t
375 # ifndef AFS_DARWIN80_ENV
376 # include <ufs/ufs/quota.h>
377 # include <ufs/ufs/inode.h>
378 # include <ufs/ffs/fs.h>
379 # endif
380 # else
381 # ifndef AFS_NBSD40_ENV
382 # include "h/vfs.h"
383 # include "h/vnode.h"
384 # endif
385 # ifdef AFS_SUN5_ENV
386 # include "h/fs/ufs_inode.h"
387 # include "h/fs/ufs_mount.h"
388 # else
389 # if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_NBSD40_ENV)
390 # include "ufs/inode.h"
391 # if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_NBSD40_ENV)
392 # include "ufs/mount.h"
393 # endif /* !AFS_HPUX_ENV */
394 # endif /* !AFS_AIX32_ENV */
395 # endif /* AFS_SUN5_ENV */
396 # endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
398 /* These mainly deal with networking and rpc headers */
399 # include "netinet/in.h"
400 # undef MFREE /* defined at mount.h for AIX */
401 # ifdef AFS_SUN5_ENV
402 # include "h/time.h"
403 # else
404 # if !defined(AFS_HPUX_ENV)
405 # include "h/mbuf.h"
406 # endif
407 # endif /* AFS_SUN5_ENV */
409 # include "rpc/types.h"
410 # include "rx/xdr.h"
412 /* Miscellaneous headers */
413 # include "h/proc.h"
414 # if !defined(AFS_FBSD_ENV)
415 # include "h/ioctl.h"
416 # endif /* AFS_FBSD_ENV */
418 # if defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV)
419 # include "h/proc_iface.h"
420 # include "h/vas.h"
421 # endif
423 # if defined(AFS_HPUX102_ENV)
424 # include "h/unistd.h"
425 # include "h/tty.h"
426 # endif
428 # 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) && !defined(AFS_NBSD40_ENV)
430 # include "h/text.h"
431 # endif
434 # if defined(AFS_AIX_ENV)
435 # include "h/flock.h" /* fcntl.h is a user-level include in aix */
436 # else
437 # include "h/fcntl.h"
438 # endif /* AIX */
440 # if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
441 # include "h/unistd.h"
442 # endif /* SGI || SUN */
444 # ifdef AFS_AIX32_ENV
445 # include "h/vmuser.h"
446 # endif /* AFS_AIX32_ENV */
448 # if defined(AFS_SUN5_ENV)
449 # include <sys/tiuser.h>
450 # include <sys/t_lock.h>
451 # include <sys/mutex.h>
452 # include <sys/vtrace.h>
453 # include <sys/pathname.h>
454 # include <sys/debug.h>
455 # endif
457 #endif /* AFS_LINUX22_ENV */
459 #endif /* __AFS_SYSINCLUDESH__ so idempotent */
461 #endif