1 #include <bindings.dsl.h>
2 #include <apr_thread_proc.h>
4 module Bindings.APR.Thread.Proc where
7 import Bindings.APR.ErrNo
8 import Bindings.APR.File.Types
9 import Bindings.APR.Pools
10 import System.Posix.Types
12 #integral_t apr_cmdtype_e
19 #integral_t apr_wait_how_e
23 #integral_t apr_exit_why_e
26 #num APR_PROC_SIGNAL_CORE
28 #cinline APR_PROC_CHECK_EXIT , Ptr <apr_exit_why_e> -> IO CInt
29 #cinline APR_PROC_CHECK_SIGNALED , Ptr <apr_exit_why_e> -> IO CInt
30 #cinline APR_PROC_CHECK_CORE_DUMP, Ptr <apr_exit_why_e> -> IO CInt
34 #num APR_FULL_NONBLOCK
47 #num APR_OC_REASON_DEATH
48 #num APR_OC_REASON_UNWRITABLE
49 #num APR_OC_REASON_RESTART
50 #num APR_OC_REASON_UNREGISTER
51 #num APR_OC_REASON_LOST
52 #num APR_OC_REASON_RUNNING
54 #starttype struct apr_proc_t
56 # field in , Ptr <apr_file_t>
57 # field out, Ptr <apr_file_t>
58 # field err, Ptr <apr_file_t>
59 # if APR_HAS_PROC_INVOKED
60 # field invoked, Ptr CCHar
64 #callback apr_child_errfn_t, Ptr <apr_pool_t> -> <apr_status_t> -> Ptr CChar -> IO ()
66 #opaque_t apr_thread_t
67 #opaque_t apr_threadattr_t
68 #opaque_t apr_procattr_t
69 #opaque_t apr_thread_once_t
70 #opaque_t apr_threadkey_t
71 #opaque_t apr_other_child_rec_t
73 #callback apr_thread_start_t, Ptr <apr_thread_t> -> Ptr () -> IO (Ptr ())
75 #integral_t apr_kill_conditions_e
78 #num APR_KILL_AFTER_TIMEOUT
80 #num APR_KILL_ONLY_ONCE
84 # ccall apr_threadattr_create , Ptr (Ptr <apr_threadattr_t>) -> Ptr <apr_pool_t> -> IO <apr_status_t>
85 # ccall apr_threadattr_detach_set , Ptr <apr_threadattr_t> -> <apr_int32_t> -> IO <apr_status_t>
86 # ccall apr_threadattr_detach_get , Ptr <apr_threadattr_t> -> IO <apr_status_t>
87 # ccall apr_threadattr_stacksize_set, Ptr <apr_threadattr_t> -> <apr_size_t> -> IO <apr_status_t>
88 # ccall apr_threadattr_guardsize_set, Ptr <apr_threadattr_t> -> <apr_size_t> -> IO <apr_status_t>
90 # ccall apr_thread_create , Ptr (Ptr <apr_thread_t>) -> Ptr <apr_threadattr_t> -> <apr_thread_start_t> -> Ptr () -> Ptr <apr_pool_t> -> IO <apr_status_t>
91 # ccall apr_thread_exit , Ptr <apr_thread_t> -> <apr_status_t> -> IO <apr_status_t>
92 # ccall apr_thread_join , Ptr <apr_status_t> -> Ptr <apr_thread_t> -> IO <apr_status_t>
93 # ccall apr_thread_yield , IO ()
95 # ccall apr_thread_once_init, Ptr (Ptr <apr_thread_once_t>) -> Ptr <apr_pool_t> -> IO <apr_status_t>
96 # ccall apr_thread_once , Ptr <apr_thread_once_t> -> FunPtr (IO ()) -> IO <apr_status_t>
98 # ccall apr_thread_detach , Ptr <apr_thread_t> -> IO <apr_status_t>
99 # ccall apr_thread_data_get , Ptr (Ptr ()) -> Ptr CChar -> Ptr <apr_thread_t> -> IO <apr_status_t>
100 # ccall apr_thread_data_set , Ptr () -> Ptr CChar -> FunPtr (Ptr () -> IO <apr_status_t>) -> Ptr <apr_thread_t> -> IO <apr_status_t>
102 # ccall apr_threadkey_private_create, Ptr (Ptr <apr_threadkey_t>) -> FunPtr (Ptr () -> IO ()) -> Ptr <apr_pool_t> -> IO <apr_status_t>
103 # ccall apr_threadkey_private_get , Ptr (Ptr ()) -> Ptr <apr_threadkey_t> -> IO <apr_status_t>
104 # ccall apr_threadkey_private_set , Ptr () -> Ptr <apr_threadkey_t> -> IO <apr_status_t>
105 # ccall apr_threadkey_private_delete, Ptr <apr_threadkey_t> -> Ptr <apr_status_t>
107 # ccall apr_threadkey_data_get, Ptr (Ptr ()) -> Ptr CChar -> Ptr <apr_threadkey_t> -> IO <apr_status_t>
108 # ccall apr_threadkey_data_set, Ptr () -> Ptr CChar -> FunPtr (Ptr () -> IO <apr_status_t>) -> Ptr <apr_threadkey_t> -> IO <apr_status_t>
112 #ccall apr_procattr_create , Ptr (Ptr <apr_procattr_t>) -> Ptr <apr_pool_t> -> IO <apr_status_t>
113 #ccall apr_procattr_io_set , Ptr <apr_procattr_t> -> <apr_int32_t> -> <apr_int32_t> -> <apr_int32_t> -> IO <apr_status_t>
114 #ccall apr_procattr_child_in_set , Ptr <apr_procattr_t> -> Ptr <apr_file_t> -> Ptr <apr_file_t> -> IO <apr_status_t>
115 #ccall apr_procattr_child_out_set, Ptr <apr_procattr_t> -> Ptr <apr_file_t> -> Ptr <apr_file_t> -> IO <apr_status_t>
116 #ccall apr_procattr_child_err_set, Ptr <apr_procattr_t> -> Ptr <apr_file_t> -> Ptr <apr_file_t> -> IO <apr_status_t>
117 #ccall apr_procattr_dir_set , Ptr <apr_procattr_t> -> Ptr CChar -> IO <apr_status_t>
118 #ccall apr_procattr_cmdtype_set , Ptr <apr_procattr_t> -> <apr_cmdtype_e> -> IO <apr_status_t>
119 #ccall apr_procattr_detach_set , Ptr <apr_procattr_t> -> <apr_int32_t> -> IO <apr_status_t>
121 #if APR_HAVE_STRUCT_RLIMIT
123 -- # ccall apr_procattr_limit_set , Ptr <apr_procattr_t> -> <apr_int32_t> -> Ptr <rlimit> -> IO <apr_status_t>
126 #ccall apr_procattr_child_errfn_set, Ptr <apr_procattr_t> -> <apr_child_errfn_t> -> IO <apr_status_t>
127 #ccall apr_procattr_error_check_set, Ptr <apr_procattr_t> -> <apr_int32_t> -> IO <apr_status_t>
128 #ccall apr_procattr_addrspace_set , Ptr <apr_procattr_t> -> <apr_int32_t> -> IO <apr_status_t>
129 #ccall apr_procattr_user_set , Ptr <apr_procattr_t> -> Ptr CChar -> Ptr CChar -> IO <apr_status_t>
130 #ccall apr_procattr_group_set , Ptr <apr_procattr_t> -> Ptr CChar -> Ptr <apr_status_t>
133 # ccall apr_proc_fork, Ptr <apr_proc_t> -> Ptr <apr_pool_t> -> IO <apr_status_t>
136 #ccall apr_proc_create , Ptr <apr_proc_t> -> Ptr CChar -> Ptr (Ptr CChar) -> Ptr (Ptr CChar) -> Ptr <apr_procattr_t> -> Ptr <apr_pool_t> -> IO <apr_status_t>
137 #ccall apr_proc_wait , Ptr <apr_proc_t> -> Ptr CInt -> Ptr <apr_exit_why_e> -> <apr_wait_how_e> -> IO <apr_status_t>
138 #ccall apr_proc_wait_all_procs, Ptr <apr_proc_t> -> Ptr CInt -> Ptr <apr_exit_why_e> -> <apr_wait_how_e> -> Ptr <apr_pool_t> -> IO <apr_status_t>
140 #num APR_PROC_DETACH_FOREGROUND
141 #num APR_PROC_DETACH_DAEMONIZE
143 #ccall apr_proc_detach , CInt -> IO <apr_status_t>
144 #ccall apr_proc_other_child_register , Ptr <apr_proc_t> -> FunPtr (CInt -> Ptr () -> CInt -> IO ()) -> Ptr () -> Ptr <apr_file_t> -> Ptr <apr_pool_t> -> IO ()
145 #ccall apr_proc_other_child_unregister , Ptr () -> IO ()
146 #ccall apr_proc_other_child_alert , Ptr <apr_proc_t> -> CInt -> CInt -> IO <apr_status_t>
147 #ccall apr_proc_other_child_refresh , Ptr <apr_other_child_rec_t> -> CInt -> IO ()
148 #ccall apr_proc_other_child_refresh_all, CInt -> IO ()
149 #ccall apr_proc_kill , Ptr <apr_proc_t> -> CInt -> IO <apr_status_t>
150 #ccall apr_pool_note_subprocess , Ptr <apr_pool_t> -> Ptr <apr_pool_t> -> <apr_kill_conditions_e> -> IO ()
154 # if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2)
155 # ccall apr_setup_signal_thread, IO <apr_status_t>
156 # ccall apr_signal_thread , FunPtr (CInt -> IO CInt) -> IO <apr_status_t>
159 # ccall apr_thread_pool_get, Ptr <apr_thread_t> -> IO (Ptr <apr_pool_t>)