0 | module System.Linux.Epoll
 1 |
 2 | import System.Linux.Epoll.Prim as P
 3 |
 4 | import System.Posix.Signal
 5 | import System.Posix.Timer
 6 |
 7 | import public Data.C.Ptr
 8 | import public System.Linux.Epoll.Flags
 9 | import public System.Linux.Epoll.Struct
10 | import public System.Posix.File
11 |
12 | %default total
13 |
14 | ||| Opens a new `epoll` file descriptor.
15 | export %inline
16 | epollCreate : Has Errno es => EIO1 f => EpollFlags -> f es Epollfd
17 | epollCreate fs = elift1 (P.epollCreate fs)
18 |
19 | export %inline
20 | epollCtl :
21 |      {auto ifd : FileDesc g}
22 |   -> {auto has : Has Errno es}
23 |   -> {auto eio : EIO1 f}
24 |   -> Epollfd
25 |   -> EpollOp
26 |   -> (fd : g)
27 |   -> PollEvent
28 |   -> f es ()
29 | epollCtl efd op fd ev = elift1 (P.epollCtl efd op fd ev)
30 |
31 | export %inline
32 | epollWait :
33 |      {n : _}
34 |   -> {auto has : Has Errno es}
35 |   -> {auto eio : EIO1 f}
36 |   -> Epollfd
37 |   -> CArrayIO n SEpollEvent
38 |   -> Int32
39 |   -> f es (k ** CArrayIO k SEpollEvent)
40 | epollWait efd arr timeout = elift1 (P.epollWait efd arr timeout)
41 |
42 | export %inline
43 | epollWaitVals :
44 |      {n : _}
45 |   -> {auto has : Has Errno es}
46 |   -> {auto eio : EIO1 f}
47 |   -> Epollfd
48 |   -> CArrayIO n SEpollEvent
49 |   -> Int32
50 |   -> f es (List PollPair)
51 | epollWaitVals efd arr timeout = elift1 (P.epollWaitVals efd arr timeout)
52 |
53 | export %inline
54 | epollPwait2 :
55 |      {n : _}
56 |   -> {auto has : Has Errno es}
57 |   -> {auto eio : EIO1 f}
58 |   -> Epollfd
59 |   -> CArrayIO n SEpollEvent
60 |   -> Clock Duration
61 |   -> List Signal
62 |   -> f es (k ** CArrayIO k SEpollEvent)
63 | epollPwait2 efd arr timeout ss = elift1 (P.epollPwait2 efd arr timeout ss)
64 |
65 | export %inline
66 | epollPwait2Vals :
67 |      {n : _}
68 |   -> {auto has : Has Errno es}
69 |   -> {auto eio : EIO1 f}
70 |   -> Epollfd
71 |   -> CArrayIO n SEpollEvent
72 |   -> Clock Duration
73 |   -> List Signal
74 |   -> f es (List PollPair)
75 | epollPwait2Vals efd arr timeout ss = elift1 (P.epollPwait2Vals efd arr timeout ss)
76 |