]> sourceware.org Git - newlib-cygwin.git/blob - winsup/cygserver/bsd_helper.h
Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout option
[newlib-cygwin.git] / winsup / cygserver / bsd_helper.h
1 /* bsd_helper.h: Helps integrating BSD kernel code
2
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
38 void securityinit (void);
39
40 int win_copyin (class thread *, const void *, void *, size_t);
41 int win_copyout (class thread *, const void *, void *, size_t);
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
45 void *get_token_info (HANDLE, TOKEN_INFORMATION_CLASS);
46 int ipcperm (class thread *, struct ipc_perm *, unsigned int);
47 int suser (class thread *);
48 bool adjust_identity_info (struct proc *p);
49
50 struct vmspace *ipc_p_vmspace (struct proc *);
51 int ipcexit_creat_hookthread(class thread *);
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))
57 vm_object_t vm_object_duplicate (class thread *td, vm_object_t object);
58 void vm_object_deallocate (vm_object_t object);
59
60 void tunable_param_init (const char *, bool);
61 void tunable_int_fetch (const char *, int32_t *);
62 void tunable_bool_fetch (const char *, tun_bool_t *);
63
64 #endif /* _BSD_HELPER_H */
This page took 0.048851 seconds and 5 git commands to generate.