aboutsummaryrefslogtreecommitdiff
path: root/standalone/android/haskell-patches/unix_2.6.0.1_0001-remove-stuff-not-available-on-Android.patch
blob: ff1da944cf33b7f92d6d6ad8e603e63bfbdb4506 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
From abca378462337ca0eb13a7e4d3073cb96a50d36c Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Thu, 28 Feb 2013 23:37:23 -0400
Subject: [PATCH] remove stuff not available on Android

---
 System/Posix/Resource.hsc        |    4 ++++
 System/Posix/Terminal/Common.hsc |   29 +++--------------------------
 2 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/System/Posix/Resource.hsc b/System/Posix/Resource.hsc
index 6651998..2615b1e 100644
--- a/System/Posix/Resource.hsc
+++ b/System/Posix/Resource.hsc
@@ -101,7 +101,9 @@ packResource ResourceTotalMemory   = (#const RLIMIT_AS)
 #endif
 
 unpackRLimit :: CRLim -> ResourceLimit
+#if 0
 unpackRLimit (#const RLIM_INFINITY)  = ResourceLimitInfinity
+#endif
 #ifdef RLIM_SAVED_MAX
 unpackRLimit (#const RLIM_SAVED_MAX) = ResourceLimitUnknown
 unpackRLimit (#const RLIM_SAVED_CUR) = ResourceLimitUnknown
@@ -109,7 +111,9 @@ unpackRLimit (#const RLIM_SAVED_CUR) = ResourceLimitUnknown
 unpackRLimit other = ResourceLimit (fromIntegral other)
 
 packRLimit :: ResourceLimit -> Bool -> CRLim
+#if 0
 packRLimit ResourceLimitInfinity _     = (#const RLIM_INFINITY)
+#endif
 #ifdef RLIM_SAVED_MAX
 packRLimit ResourceLimitUnknown  True  = (#const RLIM_SAVED_CUR)
 packRLimit ResourceLimitUnknown  False = (#const RLIM_SAVED_MAX)
diff --git a/System/Posix/Terminal/Common.hsc b/System/Posix/Terminal/Common.hsc
index 3a6254d..32a22f2 100644
--- a/System/Posix/Terminal/Common.hsc
+++ b/System/Posix/Terminal/Common.hsc
@@ -419,11 +419,7 @@ foreign import ccall unsafe "tcsendbreak"
 -- | @drainOutput fd@ calls @tcdrain@ to block until all output
 --   written to @Fd@ @fd@ has been transmitted.
 drainOutput :: Fd -> IO ()
-drainOutput (Fd fd) = throwErrnoIfMinus1_ "drainOutput" (c_tcdrain fd)
-
-foreign import ccall unsafe "tcdrain"
-  c_tcdrain :: CInt -> IO CInt
-
+drainOutput (Fd fd) = error "drainOutput not implemented"
 
 data QueueSelector
   = InputQueue		-- TCIFLUSH
@@ -434,16 +430,7 @@ data QueueSelector
 --   pending input and\/or output for @Fd@ @fd@,
 --   as indicated by the @QueueSelector@ @queues@.
 discardData :: Fd -> QueueSelector -> IO ()
-discardData (Fd fd) queue =
-  throwErrnoIfMinus1_ "discardData" (c_tcflush fd (queue2Int queue))
-  where
-    queue2Int :: QueueSelector -> CInt
-    queue2Int InputQueue  = (#const TCIFLUSH)
-    queue2Int OutputQueue = (#const TCOFLUSH)
-    queue2Int BothQueues  = (#const TCIOFLUSH)
-
-foreign import ccall unsafe "tcflush"
-  c_tcflush :: CInt -> CInt -> IO CInt
+discardData (Fd fd) queue = error "discardData not implemented"
 
 data FlowAction
   = SuspendOutput	-- ^ TCOOFF
@@ -455,17 +442,7 @@ data FlowAction
 --   flow of data on @Fd@ @fd@, as indicated by
 --   @action@.
 controlFlow :: Fd -> FlowAction -> IO ()
-controlFlow (Fd fd) action =
-  throwErrnoIfMinus1_ "controlFlow" (c_tcflow fd (action2Int action))
-  where
-    action2Int :: FlowAction -> CInt
-    action2Int SuspendOutput = (#const TCOOFF)
-    action2Int RestartOutput = (#const TCOON)
-    action2Int TransmitStop  = (#const TCIOFF)
-    action2Int TransmitStart = (#const TCION)
-
-foreign import ccall unsafe "tcflow"
-  c_tcflow :: CInt -> CInt -> IO CInt
+controlFlow (Fd fd) action = error "controlFlow not implemented"
 
 -- | @getTerminalProcessGroupID fd@ calls @tcgetpgrp@ to
 --   obtain the @ProcessGroupID@ of the foreground process group 
-- 
1.7.10.4