>From 5dc47529bb1110227817325aa487c4f9b7f35774 Mon Sep 17 00:00:00 2001
From: Nathan <nathan.huesken@posteo.de>
Date: Tue, 29 Jan 2013 23:25:38 +0100
Subject: [PATCH] Wrap mkfifo, tcsetattr and tcgetattr on android because they
 are inline and cause linker failer

---
 System/Posix/Internals.hs |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/System/Posix/Internals.hs b/System/Posix/Internals.hs
index 1633a3e..d5bc0c9 100644
--- a/System/Posix/Internals.hs
+++ b/System/Posix/Internals.hs
@@ -488,8 +488,13 @@ foreign import ccall unsafe "HsBase.h fork"
 foreign import ccall unsafe "HsBase.h link"
    c_link :: CString -> CString -> IO CInt
 
+#ifndef linux_android_HOST_OS 
 foreign import ccall unsafe "HsBase.h mkfifo"
    c_mkfifo :: CString -> CMode -> IO CInt
+#else
+foreign import capi unsafe "HsBase.h mkfifo"
+   c_mkfifo :: CString -> CMode -> IO CInt
+#endif
 
 foreign import ccall unsafe "HsBase.h pipe"
    c_pipe :: Ptr CInt -> IO CInt
@@ -503,11 +508,19 @@ foreign import capi unsafe "signal.h sigaddset"
 foreign import capi unsafe "signal.h sigprocmask"
    c_sigprocmask :: CInt -> Ptr CSigset -> Ptr CSigset -> IO CInt
 
+#ifndef linux_android_HOST_OS 
 foreign import ccall unsafe "HsBase.h tcgetattr"
    c_tcgetattr :: CInt -> Ptr CTermios -> IO CInt
 
 foreign import ccall unsafe "HsBase.h tcsetattr"
    c_tcsetattr :: CInt -> CInt -> Ptr CTermios -> IO CInt
+#else
+foreign import capi unsafe "HsBase.h tcgetattr"
+   c_tcgetattr :: CInt -> Ptr CTermios -> IO CInt
+
+foreign import capi unsafe "HsBase.h tcsetattr"
+   c_tcsetattr :: CInt -> CInt -> Ptr CTermios -> IO CInt
+#endif
 
 foreign import capi unsafe "HsBase.h utime"
    c_utime :: CString -> Ptr CUtimbuf -> IO CInt
-- 
1.7.10.4

