]>
Commit | Line | Data |
---|---|---|
282113ba CV |
1 | /* bsd_helper.h: Helps integrating BSD kernel code |
2 | ||
3 | Copyright 2003 Red Hat, Inc. | |
4 | ||
5 | This file is part of Cygwin. | |
6 | ||
7 | This software is a copyrighted work licensed under the terms of the | |
8 | Cygwin license. Please consult the file "CYGWIN_LICENSE" for | |
9 | details. */ | |
10 | #ifndef _BSD_HELPER_H | |
11 | #define _BSD_HELPER_H | |
12 | ||
13 | #include <sys/types.h> | |
14 | #include <sys/syslog.h> | |
15 | ||
16 | enum tun_bool_t { | |
17 | TUN_UNDEF = 0, | |
18 | TUN_FALSE = 1, | |
19 | TUN_TRUE = 2 | |
20 | }; | |
21 | ||
22 | #define TUNABLE_INT_FETCH(a,b) tunable_int_fetch((a),(b)) | |
23 | #define TUNABLE_BOOL_FETCH(a,b) tunable_bool_fetch((a),(b)) | |
24 | ||
25 | #define sys_malloc(a,b,c) (malloc(a)?:(panic("malloc failed in %s, line %d"),(void*)NULL)) | |
26 | #define sys_free(a,b) free(a) | |
27 | ||
28 | #define jail_sysvipc_allowed true | |
29 | #define jailed(a) false | |
30 | ||
31 | extern const char *__progname; | |
32 | ||
33 | /* Global vars, determining whether the IPC stuff should be started or not. */ | |
34 | extern tun_bool_t support_sharedmem; | |
35 | extern tun_bool_t support_msgqueues; | |
36 | extern tun_bool_t support_semaphores; | |
37 | ||
38 | extern SECURITY_ATTRIBUTES sec_all_nih; | |
39 | ||
2d015bd6 CV |
40 | void securityinit (void); |
41 | ||
282113ba CV |
42 | int win_copyin (struct thread *, const void *, void *, size_t); |
43 | int win_copyout (struct thread *, const void *, void *, size_t); | |
44 | #define copyin(a,b,c) win_copyin((td),(a),(b),(c)) | |
45 | #define copyout(a,b,c) win_copyout((td),(a),(b),(c)) | |
46 | ||
47 | int ipcperm (struct thread *, struct ipc_perm *, unsigned int); | |
48 | int suser (struct thread *); | |
49 | bool adjust_identity_info (struct proc *p); | |
50 | ||
51 | struct vmspace *ipc_p_vmspace (struct proc *); | |
52 | int ipcexit_creat_hookthread(struct thread *); | |
53 | void ipcinit (void); | |
54 | int ipcunload (void); | |
55 | ||
56 | vm_object_t _vm_pager_allocate (int, int); | |
57 | #define vm_pager_allocate(a,b,s,c,d) _vm_pager_allocate((s),(mode)) | |
58 | vm_object_t vm_object_duplicate (struct thread *td, vm_object_t object); | |
59 | void vm_object_deallocate (vm_object_t object); | |
60 | ||
61 | void tunable_param_init (const char *, bool); | |
62 | void tunable_int_fetch (const char *, long *); | |
63 | void tunable_bool_fetch (const char *, tun_bool_t *); | |
64 | ||
65 | #endif /* _BSD_HELPER_H */ |