1 /* bsd_helper.h: Helps integrating BSD kernel code
3 Copyright 2003 Red Hat, Inc.
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
13 #include <sys/types.h>
14 #include <sys/syslog.h>
22 #define TUNABLE_INT_FETCH(a,b) tunable_int_fetch((a),(b))
23 #define TUNABLE_BOOL_FETCH(a,b) tunable_bool_fetch((a),(b))
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)
28 #define jail_sysvipc_allowed true
29 #define jailed(a) false
31 extern const char *__progname;
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;
38 extern SECURITY_ATTRIBUTES sec_all_nih;
40 void securityinit (void);
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))
47 void *get_token_info (HANDLE, TOKEN_INFORMATION_CLASS);
48 int ipcperm (struct thread *, struct ipc_perm *, unsigned int);
49 int suser (struct thread *);
50 bool adjust_identity_info (struct proc *p);
52 struct vmspace *ipc_p_vmspace (struct proc *);
53 int ipcexit_creat_hookthread(struct thread *);
57 vm_object_t _vm_pager_allocate (int, int);
58 #define vm_pager_allocate(a,b,s,c,d) _vm_pager_allocate((s),(mode))
59 vm_object_t vm_object_duplicate (struct thread *td, vm_object_t object);
60 void vm_object_deallocate (vm_object_t object);
62 void tunable_param_init (const char *, bool);
63 void tunable_int_fetch (const char *, long *);
64 void tunable_bool_fetch (const char *, tun_bool_t *);
66 #endif /* _BSD_HELPER_H */