summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauricioAntunes <>2009-10-01 17:45:10 (GMT)
committerLuite Stegeman <luite@luite.com>2009-10-01 17:45:10 (GMT)
commit1233c6c3548d164ce7d9ba28c4278ea9dcae7cde (patch)
tree8a6c5a4f86f8c3d3355b696b6e9f4a788a5552a3
parent1179bed1f8cbd4af2df75d45b288c2ee24ab45c3 (diff)
version 1.11.1
-rw-r--r--bindings-posix.cabal4
-rw-r--r--src/Bindings/Posix/Signal.hsc144
-rw-r--r--src/Bindings/Posix/Sys/Types.hsc3
3 files changed, 147 insertions, 4 deletions
diff --git a/bindings-posix.cabal b/bindings-posix.cabal
index 54c51cd..b0f8e0c 100644
--- a/bindings-posix.cabal
+++ b/bindings-posix.cabal
@@ -3,7 +3,7 @@ name: bindings-posix
homepage: http://bitbucket.org/mauricio/bindings-posix
synopsis:
Low level bindings to posix.
-version: 1.0.1
+version: 1.1
license: BSD3
license-file: LICENSE
maintainer: MaurĂ­cio C. Antunes <mauricio.antunes@gmail.com>
@@ -19,7 +19,7 @@ library
base >= 3 && < 5,
bindings-common >= 1 && < 2
exposed-modules:
- -- Time e Signal incompletos!
+ -- Time incompleto!
Bindings.Posix
Bindings.Posix.Errno
Bindings.Posix.Signal
diff --git a/src/Bindings/Posix/Signal.hsc b/src/Bindings/Posix/Signal.hsc
index 4741f9c..26baecf 100644
--- a/src/Bindings/Posix/Signal.hsc
+++ b/src/Bindings/Posix/Signal.hsc
@@ -6,7 +6,151 @@
module Bindings.Posix.Signal where
import Foreign
import Foreign.C
+import Bindings.Posix.Sys.Types
+import Bindings.Posix.Time
#starttype sigset_t
#stoptype
+#starttype struct sigevent
+#field sigev_notify , CInt
+#field sigev_signo , CInt
+#field sigev_value , <sigval>
+#field sigev_notify_function , FunPtr (<sigval> -> IO ())
+#field sigev_notify_attributes , Ptr <pthread_attr_t>
+#stoptype
+
+#num SIGEV_NONE
+#num SIGEV_SIGNAL
+#num SIGEV_THREAD
+
+#starttype union sigval
+#field sival_int , CInt
+#field sival_ptr , Ptr ()
+#stoptype
+
+#num SIGRTMIN
+#num SIGRTMAX
+
+#num SIGABRT
+#num SIGALRM
+#num SIGBUS
+#num SIGCHLD
+#num SIGCONT
+#num SIGFPE
+#num SIGHUP
+#num SIGILL
+#num SIGINT
+#num SIGKILL
+#num SIGPIPE
+#num SIGQUIT
+#num SIGSEGV
+#num SIGSTOP
+#num SIGTERM
+#num SIGTSTP
+#num SIGTTIN
+#num SIGTTOU
+#num SIGUSR1
+#num SIGUSR2
+#num SIGURG
+
+#starttype struct sigaction
+#field sa_handler , FunPtr (CInt -> IO ())
+#field sa_mask , <sigset_t>
+#field sa_flags , CInt
+#field sa_sigaction , FunPtr (CInt -> Ptr <siginfo_t> -> Ptr () -> IO ())
+#stoptype
+
+#num SIG_BLOCK
+#num SIG_UNBLOCK
+#num SIG_SETMASK
+#num SA_NOCLDSTOP
+#num SA_RESETHAND
+#num SA_RESTART
+#num SA_SIGINFO
+#num SA_NOCLDWAIT
+#num SA_NODEFER
+
+#starttype mcontext_t
+#stoptype
+
+#starttype ucontext_t
+#field uc_link , Ptr <ucontext_t>
+#field uc_sigmask , <sigset_t>
+#field uc_stack , <stack_t>
+#field uc_mcontext , <mcontext_t>
+#stoptype
+
+#starttype stack_t
+#field ss_sp , Ptr ()
+#field ss_size , CSize
+#field ss_flags , CInt
+#stoptype
+
+#starttype siginfo_t
+#field si_signo , CInt
+#field si_code , CInt
+#field si_pid , <pid_t>
+#field si_uid , <uid_t>
+#field si_addr , Ptr ()
+#field si_status , CInt
+#field si_value , <sigval>
+#stoptype
+
+#num ILL_ILLOPC
+#num ILL_ILLOPN
+#num ILL_ILLADR
+#num ILL_ILLTRP
+#num ILL_PRVOPC
+#num ILL_PRVREG
+#num ILL_COPROC
+#num ILL_BADSTK
+#num FPE_INTDIV
+#num FPE_INTOVF
+#num FPE_FLTDIV
+#num FPE_FLTOVF
+#num FPE_FLTUND
+#num FPE_FLTRES
+#num FPE_FLTINV
+#num FPE_FLTSUB
+#num SEGV_MAPERR
+#num SEGV_ACCERR
+#num BUS_ADRALN
+#num BUS_ADRERR
+#num BUS_OBJERR
+#num CLD_EXITED
+#num CLD_KILLED
+#num CLD_DUMPED
+#num CLD_TRAPPED
+#num CLD_STOPPED
+#num CLD_CONTINUED
+#num SI_USER
+#num SI_QUEUE
+#num SI_TIMER
+#num SI_ASYNCIO
+#num SI_MESGQ
+
+#ccall kill , <pid_t> -> CInt -> IO CInt
+-- ccall psiginfo , Ptr <siginfo_t> -> CString -> IO ()
+#ccall psignal , CInt -> CString -> IO ()
+#ccall pthread_kill , <pthread_t> -> CInt -> IO CInt
+#ccall pthread_sigmask , CInt -> Ptr <sigset_t> -> \
+ Ptr <sigset_t> -> IO CInt
+#ccall sigaction , CInt -> Ptr <sigaction> -> \
+ Ptr <sigaction> -> IO CInt
+#ccall sigaddset , Ptr <sigset_t> -> CInt -> IO CInt
+#ccall sigdelset , Ptr <sigset_t> -> CInt -> IO CInt
+#ccall sigemptyset , Ptr <sigset_t> -> IO CInt
+#ccall sigfillset , Ptr <sigset_t> -> IO CInt
+#ccall sigismember , Ptr <sigset_t> -> CInt -> IO CInt
+#ccall sigpending , Ptr <sigset_t> -> IO CInt
+#ccall sigprocmask , CInt -> Ptr <sigset_t> -> \
+ Ptr <sigset_t> -> IO CInt
+-- ccall sigqueue , <pid_t> -> CInt -> <sigval> -> IO CInt
+#ccall sigsuspend , Ptr <sigset_t> -> IO CInt
+#ccall sigtimedwait , Ptr <sigset_t> -> \
+ Ptr <siginfo_t> -> Ptr <timespec> -> IO CInt
+#ccall sigwait , Ptr <sigset_t> -> Ptr CInt -> IO CInt
+#ccall sigwaitinfo , Ptr <sigset_t> -> Ptr <siginfo_t> -> \
+ IO CInt
+
diff --git a/src/Bindings/Posix/Sys/Types.hsc b/src/Bindings/Posix/Sys/Types.hsc
index 4d66bc0..55b2832 100644
--- a/src/Bindings/Posix/Sys/Types.hsc
+++ b/src/Bindings/Posix/Sys/Types.hsc
@@ -55,8 +55,7 @@ import Foreign.C
#starttype pthread_spinlock_t
#stoptype
-#starttype pthread_t
-#stoptype
+#integral_t pthread_t
#integral_t size_t
#integral_t ssize_t