File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ module System.IO.FD (waitForReadFD, waitForWriteFD) where
22
33import Primitives
44
5- waitForReadFD :: Int -> IO ()
5+ waitForReadFD :: Int -> IO Int
66waitForReadFD = primWaitReadFD
77
8- waitForWriteFD :: Int -> IO ()
8+ waitForWriteFD :: Int -> IO Int
99waitForWriteFD = primWaitWriteFD
Original file line number Diff line number Diff line change @@ -2264,10 +2264,8 @@ struct {
22642264 { "binbs1" , T_BINBS1 },
22652265 { "unint1" , T_UNINT1 },
22662266 { "undbl1" , T_UNDBL1 },
2267- #if MHS_IO_POLL
22682267 { "IO.waitrdfd" , T_IO_WAITRDFD },
22692268 { "IO.waitwrfd" , T_IO_WAITWRFD },
2270- #endif
22712269#if WANT_INT64
22722270 { "I+" , T_ADD64 , T_ADD64 },
22732271 { "I-" , T_SUB64 , T_SUBR64 },
@@ -6091,9 +6089,9 @@ evali(NODEPTR an)
60916089 POP (2 );
60926090 GOPAIR (mkInt (mt -> mt_state ));
60936091 }
6094- #if MHS_IO_POLL
60956092 case T_IO_WAITRDFD :
60966093 case T_IO_WAITWRFD : {
6094+ #if MHS_IO_POLL
60976095 CHKARG2NP ; /* x = the filedescriptor, y = RealWorld; no pop yet */
60986096
60996097 /* io_thread_ready sets mt_fd=IO_POLL_EVENT_HAS_HAPPENED when waking the thread.
@@ -6104,7 +6102,7 @@ evali(NODEPTR an)
61046102 if (runq .mq_head -> mt_fd == IO_POLL_EVENT_HAS_HAPPENED ) {
61056103 runq .mq_head -> mt_fd = IO_POLL_WAITING_FOR_NONE ;
61066104 POP (2 );
6107- GOPAIRUNIT ;
6105+ GOPAIR ( mkInt ( 1 )) ;
61086106 }
61096107
61106108 POP (2 );
@@ -6121,8 +6119,12 @@ evali(NODEPTR an)
61216119 io_register (fd , events , mt );
61226120
61236121 resched (mt , ts_wait_io );
6124- }
6122+ #else
6123+ CHKARG2NP ;
6124+ POP (2 );
6125+ GOPAIR (mkInt (-1 ));
61256126#endif
6127+ }
61266128 case T_IO_GETMASKINGSTATE :
61276129 CHKARG1 ; /* x = ST */
61286130 GOPAIR (mkInt (runq .mq_head -> mt_mask ));
You can’t perform that action at this time.
0 commit comments