Build: check for gencat
[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
54 #elif defined(AFS_NBSD40_ENV)
55 # ifdef AFS_NBSD50_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>
110
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.
135  */
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 {
141 };
142 # endif
143 # ifndef _LINUX_XFS_FS_I
144 #  define _LINUX_XFS_FS_I
145 struct xfs_inode_info {
146 };
147 # endif
148 # include <asm/uaccess.h>
149 # include <linux/list.h>
150 # include <linux/dcache.h>
151 # include <linux/mount.h>
152 # include <linux/fs.h>
153 # include <linux/quota.h>
154 # include <linux/sched.h>
155 # include <linux/mm.h>
156 # include <linux/slab.h>
157 # include <linux/string.h>
158 # if defined(HAVE_LINUX_SEMAPHORE_H)
159 #  include <linux/semaphore.h>
160 # else
161 #  include <asm/semaphore.h>
162 # endif
163 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
164 #  include <linux/mutex.h>
165 # endif
166 # include <linux/errno.h>
167 # ifdef HAVE_LINUX_COMPLETION_H
168 #  include <linux/completion.h>
169 # endif
170 # if defined(HAVE_LINUX_EXPORTFS_H)
171 #  include <linux/exportfs.h>
172 # endif
173 # ifdef AFS_LINUX24_ENV
174 #  include <linux/pagemap.h>
175 # endif
176
177 #else /* AFS_LINUX22_ENV */
178 # if defined(AFS_DARWIN_ENV)
179 #  ifndef _MACH_ETAP_H_
180 #   define _MACH_ETAP_H_
181 typedef unsigned short etap_event_t;
182 #  endif
183 # endif
184
185 # include "h/errno.h"
186 # include "h/types.h"
187 # include "h/param.h"
188
189 # ifdef AFS_AUX_ENV
190 #  ifdef        PAGING
191 #   include "h/mmu.h"
192 #   include "h/seg.h"
193 #   include "h/page.h"
194 #   include "h/region.h"
195 #  endif /* PAGING */
196 #  include "h/sysmacros.h"
197 #  include "h/signal.h"
198 #  include "h/var.h"
199 # endif /* AFS_AUX_ENV */
200
201 # include "h/systm.h"
202 # include "h/time.h"
203
204 # ifdef AFS_AIX_ENV
205 #  ifdef AFS_AIX41_ENV
206 #   include "sys/statfs.h"
207 #  endif
208 #  ifdef AFS_AIX51_ENV
209 #   include "sys/acl.h"
210 #  endif
211 #  include "../h/file.h"
212 #  include "../h/fullstat.h"
213 #  include "../h/vattr.h"
214 #  include "../h/var.h"
215 #  include "../h/access.h"
216 # endif /* AFS_AIX_ENV */
217
218 # if defined(AFS_SGI_ENV)
219 #  include "values.h"
220 #  include "sys/sema.h"
221 #  include "sys/cmn_err.h"
222 #  ifdef AFS_SGI64_ENV
223 #   include <ksys/behavior.h>
224 /* in 6.5.20f, ksys/behavior.h doesn't bother to define BHV_IS_BHVL,
225  * but sys/vnode.h uses it in VNODE_TO_FIRST_BHV. It looks like from
226  * older headers like we want the old behavior, so we fake it. */
227 #   if defined(BHV_PREPARE) && !defined(CELL_CAPABLE)
228 #    define BHV_IS_BHVL(bhp) (0)
229 #   endif
230 #  endif /* AFS_SGI64_ENV */
231 #  include "fs/efs_inode.h"
232 #  include "sys/kmem.h"
233 #  include "sys/cred.h"
234 #  include "sys/resource.h"
235
236 /*
237  * ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG
238  * is on (see afs_osi.h).
239  * In IRIX 6.5 we cannot have DEBUG turned on since certain
240  * system-defined structures have different members with DEBUG on, and
241  * this breaks our ability to interact with the rest of the kernel.
242  *
243  * Instead of using ASSERT(), we use our own osi_Assert().
244  */
245 #  if defined(AFS_SGI65_ENV) && !defined(DEBUG)
246 #   define DEBUG
247 #   include "sys/debug.h"
248 #   undef DEBUG
249 #  else
250 #   include "sys/debug.h"
251 #  endif
252
253 #  include "sys/statvfs.h"
254 #  include "sys/sysmacros.h"
255 #  include "sys/fs_subr.h"
256 #  include "sys/siginfo.h"
257 #  include "limits.h"
258 # endif /* AFS_SGI_ENV */
259
260 # if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV)
261 #  include "h/kernel.h"
262 # endif /* !SUN5 && !SGI */
263
264 # ifdef AFS_SUN5_ENV
265 #  include <sys/cmn_err.h>      /* for kernel printf() prototype */
266 #  include "h/vfs.h"            /* stops SUN5 socketvar.h warnings */
267 #  include "h/stropts.h"                /* stops SUN5 socketvar.h warnings */
268 #  include "h/stream.h"         /* stops SUN5 socketvar.h errors */
269 # endif
270
271 # ifdef AFS_SUN510_ENV
272 #  include <sys/cred_impl.h>
273 #  include <sys/policy.h>
274 # endif
275
276 # include "h/socket.h"
277 # include "h/socketvar.h"
278 # include "h/protosw.h"
279
280 # if defined(AFS_FBSD_ENV)
281 #  include "limits.h"
282 # endif
283
284 # ifdef AFS_HPUX_ENV
285 #  include "limits.h"
286 # endif
287
288 # if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || \
289   defined(AFS_FBSD_ENV) || defined(AFS_NBSD40_ENV)
290 #  include "h/dirent.h"
291 #  ifdef        AFS_SUN5_ENV
292 #   include "h/sysmacros.h"
293 #   include "h/fs/ufs_fsdir.h"
294 #  endif /* AFS_SUN5_ENV */
295 # else
296 #  include "h/dir.h"
297 # endif /* SGI || SUN || HPUX */
298
299 # if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN80_ENV) && \
300   !defined(AFS_NBSD40_ENV)
301 #  include "h/user.h"
302 # endif /* AFS_SGI64_ENV */
303 # define        MACH_USER_API   1
304 # if defined(AFS_FBSD_ENV)
305 #  include "h/bio.h"
306 #  include "h/filedesc.h"
307 # endif
308 # include "h/file.h"
309 # include "h/uio.h"
310 # include "h/buf.h"
311 # include "h/stat.h"
312
313
314 /* ----- The following mainly deal with vnodes/inodes stuff ------ */
315 # ifdef AFS_SUN5_ENV
316 #  include "h/statvfs.h"
317 # endif /* AFS_SUN5_ENV */
318 # ifdef AFS_HPUX_ENV
319 struct vfspage;         /* for vnode.h compiler warnings */
320 #  include "h/swap.h"   /* for struct swpdbd, for vnode.h compiler warnings */
321 #  include "h/dbd.h"    /* for union idbd, for vnode.h compiler warnings */
322 #  ifdef AFS_HPUX110_ENV
323 #   include "h/resource.h"
324 #  endif
325 #  ifdef AFS_HPUX1123_ENV
326 #   include <sys/user.h>
327 #   include <sys/cred.h>
328 #  endif
329 # endif /* AFS_HPUX_ENV */
330 # if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
331 #  if defined(AFS_FBSD_ENV)
332 struct vop_getwritemount_args;
333 #  endif
334 #  include <sys/uio.h>
335 #  include <sys/mount.h>
336 #  include <sys/namei.h>
337 #  ifdef AFS_DARWIN80_ENV
338 #   include <sys/kauth.h>
339 #   include <string.h>
340 #  endif
341 #  include <sys/vnode.h>
342 #  include <sys/queue.h>
343 #  ifndef AFS_NBSD40_ENV
344 #   include <sys/malloc.h>
345 #  endif
346 #  ifdef AFS_FBSD_ENV
347 MALLOC_DECLARE(M_AFS);
348 #   include <ufs/ufs/dinode.h>
349 #   include <vm/vm.h>
350 #   include <vm/vm_extern.h>
351 #   include <vm/pmap.h>
352 #   include <vm/vm_map.h>
353 #   include <sys/lock.h>
354 #   include <sys/user.h>
355 #  else
356 #   include <sys/ubc.h>
357 #   define timeout_fcn_t mach_timeout_fcn_t
358 #   include <kern/sched_prim.h>
359 #  endif
360 #  undef timeout_fcn_t
361 #  define _DIR_H_
362 #  define doff_t          int32_t
363 #  ifndef AFS_DARWIN80_ENV
364 #   include <ufs/ufs/quota.h>
365 #   include <ufs/ufs/inode.h>
366 #   include <ufs/ffs/fs.h>
367 #  endif
368 # else
369 #  ifndef AFS_NBSD40_ENV
370 #   include "h/vfs.h"
371 #   include "h/vnode.h"
372 #  endif
373 #  ifdef        AFS_SUN5_ENV
374 #   include "h/fs/ufs_inode.h"
375 #   include "h/fs/ufs_mount.h"
376 #  else
377 #   if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_NBSD40_ENV)
378 #    include "ufs/inode.h"
379 #    if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_NBSD40_ENV)
380 #     include "ufs/mount.h"
381 #    endif /* !AFS_HPUX_ENV */
382 #   endif /* !AFS_AIX32_ENV */
383 #  endif /* AFS_SUN5_ENV */
384 # endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
385
386 /* These mainly deal with networking and rpc headers */
387 # include "netinet/in.h"
388 # undef MFREE                   /* defined at mount.h for AIX */
389 # ifdef AFS_SUN5_ENV
390 #  include "h/time.h"
391 # else
392 #  if !defined(AFS_HPUX_ENV)
393 #   include "h/mbuf.h"
394 #  endif
395 # endif /* AFS_SUN5_ENV */
396
397 # include "rpc/types.h"
398 # include "rx/xdr.h"
399
400 /* Miscellaneous headers */
401 # include "h/proc.h"
402 # if !defined(AFS_FBSD_ENV)
403 #  include "h/ioctl.h"
404 # endif /* AFS_FBSD_ENV */
405
406 # if    defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV)
407 #  include "h/proc_iface.h"
408 #  include "h/vas.h"
409 # endif
410
411 # if    defined(AFS_HPUX102_ENV)
412 #  include "h/unistd.h"
413 #  include "h/tty.h"
414 # endif
415
416 # 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)
417
418 #  include "h/text.h"
419 # endif
420
421
422 # if    defined(AFS_AIX_ENV)
423 #  include "h/flock.h"          /* fcntl.h is a user-level include in aix */
424 # else
425 #  include "h/fcntl.h"
426 # endif /* AIX */
427
428 # if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
429 #  include "h/unistd.h"
430 # endif /* SGI || SUN */
431
432 # ifdef AFS_AIX32_ENV
433 #  include "h/vmuser.h"
434 # endif /* AFS_AIX32_ENV */
435
436 # if    defined(AFS_SUN5_ENV)
437 #  include <sys/tiuser.h>
438 #  include <sys/t_lock.h>
439 #  include <sys/mutex.h>
440 #  include <sys/vtrace.h>
441 #  include <sys/pathname.h>
442 #  include <sys/debug.h>
443 # endif
444
445 #endif /* AFS_LINUX22_ENV */
446
447 #endif /* __AFS_SYSINCLUDESH__  so idempotent */
448
449 #endif