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