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