summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnWiegley <>2018-05-19 06:32:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-05-19 06:32:00 (GMT)
commit52d0c8207c8802452a9f3ec2d76c37141a5d2372 (patch)
treed96dbacd07f693a181fbe520ac511b050d9fc59c
parentd22db73dac17a3050f8afcd3eb3fef60928e7aa4 (diff)
version 1.2.7HEAD1.2.7master
-rw-r--r--.hg_archival.txt2
-rw-r--r--.hgtags3
-rw-r--r--bindings-posix.cabal20
-rw-r--r--src/Bindings/Posix/Mqueue.hsc30
-rw-r--r--src/Bindings/Posix/Signal.hsc2
-rw-r--r--src/Bindings/Posix/Sys/Types.hsc8
-rw-r--r--src/Bindings/Posix/Time.hsc11
7 files changed, 64 insertions, 12 deletions
diff --git a/.hg_archival.txt b/.hg_archival.txt
deleted file mode 100644
index e2aff3a..0000000
--- a/.hg_archival.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-repo: c1d900fe279ed394e13fbfd3c5d65142fc21d6e9
-node: 3ab42787c4ec1e8fbd617ef55233b3d47c6258b3
diff --git a/.hgtags b/.hgtags
deleted file mode 100644
index d509c66..0000000
--- a/.hgtags
+++ /dev/null
@@ -1,3 +0,0 @@
-e869165f6d328791ed6913c6cdfa1b64708fc171 0.0.2
-ffac32b2f31620096c144b276006c5c0d2748379 1.0
-d7dd4dbdf8b4fa64a1de71d562799ad6ba70d64a 1.0.1
diff --git a/bindings-posix.cabal b/bindings-posix.cabal
index c8c087a..7b529ee 100644
--- a/bindings-posix.cabal
+++ b/bindings-posix.cabal
@@ -1,18 +1,20 @@
cabal-version: >= 1.8
name: bindings-posix
synopsis:
- Low level bindings to posix.
+ Project bindings-* raw interface to Posix
description:
Low level bindings to Posix standard library, part
of the @bindings-*@ project. See:
.
- <http://bitbucket.org/mauricio/bindings-dsl>
-version: 1.2.6
+ <https://github.com/jwiegley/bindings-dsl>
+ .
+ <http://pubs.opengroup.org/onlinepubs/9699919799/idx/headers.html>
+version: 1.2.7
license: BSD3
license-file: LICENSE
-maintainer: MaurĂ­cio C. Antunes <mauricio.antunes@gmail.com>
+maintainer: John Wiegley <johnw@newartisans.com>
author: MaurĂ­cio C. Antunes
-bug-reports: http://bitbucket.org/mauricio/bindings-dsl/issues
+bug-reports: https://github.com/jwiegley/bindings-dsl/issues
build-type: Simple
category: FFI
library
@@ -41,11 +43,15 @@ library
src/Bindings/Posix/Time.c
cc-options:
"-D_ISOC99_SOURCE"
- "-D_POSIX_C_SOURCE=200112L"
+ "-D_POSIX_C_SOURCE=200809L"
"-D_XOPEN_SOURCE=600"
extra-libraries: pthread
+ if !os(osx)
+ exposed-modules:
+ Bindings.Posix.Mqueue
+ extra-libraries: rt
source-repository head
type: git
- location: https://bitbucket.org/mauricio/bindings-dsl
+ location: git://github.com/jwiegley/bindings-dsl
branch: master
subdir: bindings-posix
diff --git a/src/Bindings/Posix/Mqueue.hsc b/src/Bindings/Posix/Mqueue.hsc
new file mode 100644
index 0000000..8d5ec19
--- /dev/null
+++ b/src/Bindings/Posix/Mqueue.hsc
@@ -0,0 +1,30 @@
+#include <bindings.dsl.h>
+#include <mqueue.h>
+
+-- | <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html>
+
+module Bindings.Posix.Mqueue where
+#strict_import
+import Bindings.Posix.Signal
+import Bindings.Posix.Sys.Types
+import Bindings.Posix.Time
+
+#integral_t mqd_t
+
+#starttype struct mq_attr
+#field mq_flags, CLong
+#field mq_maxmsg, CLong
+#field mq_msgsize, CLong
+#field mq_curmsgs, CLong
+#stoptype
+
+#ccall mq_close, <mqd_t> -> IO CInt
+#ccall mq_getattr, <mqd_t> -> Ptr <mq_attr> -> IO CInt
+#ccall mq_notify, <mqd_t> -> Ptr <sigevent> -> IO CInt
+#ccall mq_open, Ptr CChar -> CInt -> <mode_t> -> Ptr <mq_attr> -> IO <mqd_t>
+#ccall mq_receive, <mqd_t> -> Ptr CChar -> <size_t> -> Ptr CUInt -> IO <ssize_t>
+#ccall mq_send, <mqd_t> -> Ptr <mq_attr> -> <size_t> -> CUInt -> IO CInt
+#ccall mq_setattr, <mqd_t> -> Ptr <mq_attr> -> Ptr <mq_attr> -> IO CInt
+#ccall mq_timedreceive, <mqd_t> -> Ptr CChar -> <size_t> -> Ptr CUInt -> Ptr <timespec> -> IO <ssize_t>
+#ccall mq_timedsend, <mqd_t> -> Ptr CChar -> <size_t> -> CUInt -> Ptr <timespec> -> IO CInt
+#ccall mq_unlink, Ptr CChar -> IO CInt
diff --git a/src/Bindings/Posix/Signal.hsc b/src/Bindings/Posix/Signal.hsc
index a7eba38..fc42dab 100644
--- a/src/Bindings/Posix/Signal.hsc
+++ b/src/Bindings/Posix/Signal.hsc
@@ -27,8 +27,10 @@ import Bindings.Posix.Sys.Types
#field sival_ptr , Ptr ()
#stoptype
+#ifndef __MACH__
#num SIGRTMIN
#num SIGRTMAX
+#endif
#num SIGABRT
#num SIGALRM
diff --git a/src/Bindings/Posix/Sys/Types.hsc b/src/Bindings/Posix/Sys/Types.hsc
index fc41054..59483ae 100644
--- a/src/Bindings/Posix/Sys/Types.hsc
+++ b/src/Bindings/Posix/Sys/Types.hsc
@@ -8,7 +8,9 @@ module Bindings.Posix.Sys.Types where
#integral_t blkcnt_t
#integral_t blksize_t
+#ifndef __MACH__
#integral_t clockid_t
+#endif
#integral_t dev_t
#integral_t gid_t
#integral_t id_t
@@ -21,11 +23,13 @@ module Bindings.Posix.Sys.Types where
#starttype pthread_attr_t
#stoptype
+#ifndef __MACH__
#starttype pthread_barrier_t
#stoptype
#starttype pthread_barrierattr_t
#stoptype
+#endif
#starttype pthread_cond_t
#stoptype
@@ -51,8 +55,10 @@ module Bindings.Posix.Sys.Types where
#starttype pthread_rwlockattr_t
#stoptype
+#ifndef __MACH__
#starttype pthread_spinlock_t
#stoptype
+#endif
#integral_t pthread_t
@@ -60,6 +66,8 @@ module Bindings.Posix.Sys.Types where
#integral_t ssize_t
#integral_t suseconds_t
#integral_t time_t
+#ifndef __MACH__
#integral_t timer_t
+#endif
#integral_t uid_t
diff --git a/src/Bindings/Posix/Time.hsc b/src/Bindings/Posix/Time.hsc
index 0ff8ae2..f4c1a1e 100644
--- a/src/Bindings/Posix/Time.hsc
+++ b/src/Bindings/Posix/Time.hsc
@@ -26,21 +26,28 @@ import Bindings.Posix.Signal
#field tv_nsec , CLong
#stoptype
+#ifndef __MACH__
#starttype struct itimerspec
#field it_interval , <timespec>
#field it_value , <timespec>
#stoptype
+#endif
#num CLOCKS_PER_SEC
+#ifndef __MACH__
#num CLOCK_REALTIME
#num TIMER_ABSTIME
+#endif
#cinline getdate_err , IO CInt
+#ifndef __MACH__
#ccall clock_getres , <clockid_t> -> Ptr <timespec> -> IO CInt
#ccall clock_gettime , <clockid_t> -> Ptr <timespec> -> IO CInt
#ccall clock_nanosleep , <clockid_t> -> CInt -> Ptr <timespec> -> Ptr <timespec> -> IO CInt
#ccall clock_settime , <clockid_t> -> Ptr <timespec> -> IO CInt
+#endif
+
#ccall difftime , <time_t> -> <time_t> -> IO CDouble
#ccall getdate , CString -> IO (Ptr <tm>)
#ccall gmtime , Ptr <time_t> -> IO (Ptr <tm>)
@@ -54,11 +61,15 @@ import Bindings.Posix.Signal
-- #ccall strftime_l , CString -> CSize -> CString -> Ptr <tm> -> <locale_t> -> IO CSize
#ccall strptime , CString -> CString -> Ptr <tm> -> IO CString
#ccall time , Ptr <time_t> -> IO <time_t>
+
+#ifndef __MACH__
#ccall timer_create , <clockid_t> -> Ptr <sigevent> -> Ptr <timer_t> -> IO CInt
#ccall timer_delete , <timer_t> -> IO CInt
#ccall timer_getoverrun , <timer_t> -> IO CInt
#ccall timer_gettime , <timer_t> -> Ptr <itimerspec> -> IO CInt
#ccall timer_settime , <timer_t> -> CInt -> Ptr <itimerspec> -> Ptr <itimerspec> -> IO CInt
+#endif
+
#ccall tzset , IO ()
#globalvar daylight , CInt