summaryrefslogtreecommitdiff
path: root/libraries/base/include
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-05-20 17:53:58 +0000
committerIan Lynagh <igloo@earth.li>2009-05-20 17:53:58 +0000
commit89f7400b357052b5b8373a6e52146ef474f4ecf6 (patch)
treeec40f3075d54b91677029a5ee5d92af3c2c56f83 /libraries/base/include
parent3050a630d971905d739cf1e8a20910ebf35259b0 (diff)
downloadhaskell-89f7400b357052b5b8373a6e52146ef474f4ecf6.tar.gz
Add wrappers around fcntl
We need to do this as it has a (, ...) type, which we aren't allowed to directly call with the FFI.
Diffstat (limited to 'libraries/base/include')
-rw-r--r--libraries/base/include/HsBase.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libraries/base/include/HsBase.h b/libraries/base/include/HsBase.h
index 9bbbdc8f22..b749c582ca 100644
--- a/libraries/base/include/HsBase.h
+++ b/libraries/base/include/HsBase.h
@@ -765,5 +765,19 @@ INLINE intptr_t __hscore_to_intptr (void *p) { return (intptr_t)p; }
void errorBelch2(const char*s, char *t);
void debugBelch2(const char*s, char *t);
+#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
+
+INLINE int fcntl_read(int fd, int cmd) {
+ fcntl(fd, cmd);
+}
+INLINE int fcntl_write(int fd, int cmd, long arg) {
+ fcntl(fd, cmd, arg);
+}
+INLINE int fcntl_lock(int fd, int cmd, struct flock *lock) {
+ fcntl(fd, cmd, lock);
+}
+
+#endif
+
#endif /* __HSBASE_H__ */