summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauricioAntunes <>2011-07-11 00:00:51 (GMT)
committerLuite Stegeman <luite@luite.com>2011-07-11 00:00:51 (GMT)
commitb36a4e3f28e7f7fe27795fd9ce2c3d4bcc961753 (patch)
tree1d99d736fbc5f4878616496170560f943a11aeca
parent61e0da003f6f572cc39f0ff16585d54338f16947 (diff)
version 1.2.31.2.3
-rw-r--r--bindings-posix.cabal8
-rw-r--r--src/Bindings/Posix.hs17
-rw-r--r--src/Bindings/Posix/Fcntl.hsc44
-rw-r--r--src/Bindings/Posix/Sys.hs12
-rw-r--r--src/Bindings/Posix/Sys/Mman.hsc23
5 files changed, 100 insertions, 4 deletions
diff --git a/bindings-posix.cabal b/bindings-posix.cabal
index e926913..9f8a499 100644
--- a/bindings-posix.cabal
+++ b/bindings-posix.cabal
@@ -2,7 +2,7 @@ cabal-version: >= 1.2.3
name: bindings-posix
synopsis:
Low level bindings to posix.
-version: 1.2.2
+version: 1.2.3
license: BSD3
license-file: LICENSE
maintainer: MaurĂ­cio C. Antunes <mauricio.antunes@gmail.com>
@@ -16,13 +16,15 @@ library
ForeignFunctionInterface
build-depends:
base >= 3 && < 5,
- bindings-DSL >= 1.0.7 && < 1.1
+ bindings-DSL >= 1.0.12 && < 1.1
exposed-modules:
Bindings.Posix
Bindings.Posix.Errno
+ Bindings.Posix.Fcntl
Bindings.Posix.Locale
Bindings.Posix.Signal
Bindings.Posix.Sys
+ Bindings.Posix.Sys.Mman
Bindings.Posix.Sys.Select
Bindings.Posix.Sys.Types
Bindings.Posix.Sys.Utsname
@@ -33,3 +35,5 @@ library
"-D_POSIX_C_SOURCE=200112L"
"-D_XOPEN_SOURCE=600"
c-sources: src/inlines.c
+ extra-libraries: pthread
+
diff --git a/src/Bindings/Posix.hs b/src/Bindings/Posix.hs
index b09d189..143f79c 100644
--- a/src/Bindings/Posix.hs
+++ b/src/Bindings/Posix.hs
@@ -1 +1,16 @@
-module Bindings.Posix (module Bindings.Posix.Errno,module Bindings.Posix.Locale,module Bindings.Posix.Signal,module Bindings.Posix.Sys,module Bindings.Posix.Time,module Bindings.Posix.Unistd) where {import Bindings.Posix.Errno;import Bindings.Posix.Locale;import Bindings.Posix.Signal;import Bindings.Posix.Sys;import Bindings.Posix.Time;import Bindings.Posix.Unistd}
+module Bindings.Posix (
+ module Bindings.Posix.Errno,
+ module Bindings.Posix.Fcntl,
+ module Bindings.Posix.Locale,
+ module Bindings.Posix.Signal,
+ module Bindings.Posix.Sys,
+ module Bindings.Posix.Time,
+ module Bindings.Posix.Unistd)
+ where
+import Bindings.Posix.Errno
+import Bindings.Posix.Fcntl
+import Bindings.Posix.Locale
+import Bindings.Posix.Signal
+import Bindings.Posix.Sys
+import Bindings.Posix.Time
+import Bindings.Posix.Unistd
diff --git a/src/Bindings/Posix/Fcntl.hsc b/src/Bindings/Posix/Fcntl.hsc
new file mode 100644
index 0000000..ae964a4
--- /dev/null
+++ b/src/Bindings/Posix/Fcntl.hsc
@@ -0,0 +1,44 @@
+#include <bindings.dsl.h>
+#include <fcntl.h>
+
+-- | <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html>
+
+module Bindings.Posix.Fcntl where
+#strict_import
+import Bindings.Posix.Sys.Types
+
+#num F_DUPFD
+#num F_GETFD
+#num F_SETFD
+#num F_GETFL
+#num F_SETFL
+#num F_GETLK
+#num F_SETLK
+#num F_SETLKW
+#num F_GETOWN
+#num F_SETOWN
+#num FD_CLOEXEC
+#num F_RDLCK
+#num F_UNLCK
+#num F_WRLCK
+#num O_CREAT
+#num O_EXCL
+#num O_NOCTTY
+#num O_TRUNC
+#num O_APPEND
+#num O_NONBLOCK
+#num O_SYNC
+#num O_ACCMODE
+#num O_RDONLY
+#num O_RDWR
+#num O_WRONLY
+
+#starttype struct flock
+#field l_type , CShort
+#field l_whence , CShort
+#field l_start , <off_t>
+#field l_len , <off_t>
+#field l_pid , <pid_t>
+#stoptype
+
+#ccall creat , CString -> <mode_t> -> IO CInt
diff --git a/src/Bindings/Posix/Sys.hs b/src/Bindings/Posix/Sys.hs
index 46d9a8e..20e19d9 100644
--- a/src/Bindings/Posix/Sys.hs
+++ b/src/Bindings/Posix/Sys.hs
@@ -1 +1,11 @@
-module Bindings.Posix.Sys (module Bindings.Posix.Sys.Select,module Bindings.Posix.Sys.Types,module Bindings.Posix.Sys.Utsname) where {import Bindings.Posix.Sys.Select;import Bindings.Posix.Sys.Types;import Bindings.Posix.Sys.Utsname}
+module Bindings.Posix.Sys (
+ module Bindings.Posix.Sys.Mman,
+ module Bindings.Posix.Sys.Select,
+ module Bindings.Posix.Sys.Types,
+ module Bindings.Posix.Sys.Utsname
+ ) where
+import Bindings.Posix.Sys.Mman
+import Bindings.Posix.Sys.Select
+import Bindings.Posix.Sys.Types
+import Bindings.Posix.Sys.Utsname
+
diff --git a/src/Bindings/Posix/Sys/Mman.hsc b/src/Bindings/Posix/Sys/Mman.hsc
new file mode 100644
index 0000000..ed172b3
--- /dev/null
+++ b/src/Bindings/Posix/Sys/Mman.hsc
@@ -0,0 +1,23 @@
+#include <bindings.dsl.h>
+#include <sys/mman.h>
+
+-- | <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_mman.h.html>
+
+module Bindings.Posix.Sys.Mman where
+#strict_import
+import Bindings.Posix.Sys.Types
+
+#num PROT_EXEC
+#num PROT_NONE
+#num PROT_READ
+#num PROT_WRITE
+#num MAP_FIXED
+#num MAP_PRIVATE
+#num MAP_SHARED
+
+#pointer MAP_FAILED
+
+#ccall mmap , Ptr () -> CSize -> CInt -> CInt-> CInt-> <off_t> -> IO (Ptr ())
+#ccall mprotect , Ptr () -> CSize -> IO CInt
+#ccall munmap , Ptr () -> CSize -> IO CInt
+