src/sys/private/syscall/linux/epoll

Source   Edit  

Wrappers for Linux-specific epoll.

The epoll_ and EPOLL prefixes are removed.

Types

CtlOp = distinct cint
Type used for epoll_ctl operations. Source   Edit  
Data {.bycopy, union.} = object
  fd*: cint
  u32*: uint32
  u64*: uint64
Source   Edit  
Ev = distinct uint32
Type used for epoll events. Source   Edit  
Event {.bycopy, packed.} = object
  events*: Ev
  data*: Data
Source   Edit  
FD = distinct handles.FD
Type used for Epoll FDs Source   Edit  

Consts

CtlAdd = 1'i32
Source   Edit  
CtlDel = 2'i32
Source   Edit  
CtlMod = 3'i32
Source   Edit  
EvErr = 8'u
Source   Edit  
EvET = 2147483648'u
Source   Edit  
EvExclusive = 268435456'u
Source   Edit  
EvHup = 16'u
Source   Edit  
EvIn = 1'u
Source   Edit  
EvMsg = 1024'u
Source   Edit  
EvNVal = 32'u
Source   Edit  
EvOneshot = 1073741824'u
Source   Edit  
EvOut = 4'u
Source   Edit  
EvPri = 2'u
Source   Edit  
EvRdBand = 128'u
Source   Edit  
EvRdHup = 8192'u
Source   Edit  
EvRdNorm = 64'u
Source   Edit  
EvWakeUp = 536870912'u
Source   Edit  
EvWrBand = 512'u
Source   Edit  
EvWrNorm = 256'u
Source   Edit  

Procs

func `and`(a, b: Ev): Ev {.borrow, ...raises: [], tags: [], forbids: [].}
Bitwise AND operator for Ev Source   Edit  
proc close(epfd: FD) {.borrow, ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc create(flags: cint): FD {.cdecl, importc: "epoll_create1", ...raises: [],
                               tags: [], forbids: [].}
Source   Edit  
proc create(size: cint): FD {.cdecl, importc: "epoll_create", ...raises: [],
                              tags: [], forbids: [].}
Source   Edit  
proc ctl(epfd: FD; op: CtlOp; fd: handles.FD; event: ptr Event): cint {.cdecl,
    importc: "epoll_ctl", ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc ctl(epfd: FD; op: CtlOp; fd: handles.FD; event: var Event): cint {.cdecl,
    importc: "epoll_ctl", ...raises: [], tags: [], forbids: [].}
Source   Edit  
func has(a, b: Ev): bool {.inline, ...raises: [], tags: [], forbids: [].}
Check if b is in a Source   Edit  
func `not`(x: Ev): Ev {.borrow, ...raises: [], tags: [], forbids: [].}
Bitwise NOT operator for Ev Source   Edit  
func `or`(a, b: Ev): Ev {.borrow, ...raises: [], tags: [], forbids: [].}
Bitwise OR operator for Ev Source   Edit  
proc wait(epfd: FD; events: ptr UncheckedArray[Event]; maxevents: cint;
          timeout: cint): cint {.cdecl, importc: "epoll_wait", ...raises: [],
                                 tags: [], forbids: [].}
Source   Edit  
proc wait(epfd: FD; events: var openArray[Event]; timeout: cint): cint {.inline,
    ...raises: [], tags: [], forbids: [].}
Source   Edit  

Converters

converter toFD(epfd: FD): handles.FD {....raises: [], tags: [], forbids: [].}
All epoll fds are valid fds, not the other way around though Source   Edit