linux/linux

Linux declarations for epoll and timerfd support used by polling, timer, and event-loop helpers.


Constants

Constant example

"linux/linux" use
"control" use

{} () {} [
  EPOLL_CTL_ADD printStack _:;
  EPOLLIN printStack _:;
  TFD_NONBLOCK printStack _:;
] "main" exportFunction

Expected Output During Compilation

1
1n32
2048

Schemas

Schema example

"linux/linux" use
"control" use

{} () {} [
  epoll_event fieldCount printStack _:;
  epoll_event 1 fieldName printStack _:;
] "main" exportFunction

Expected Output During Compilation

7
"data"

epoll and timer model


Arguments and results


Imported functions


Signature examples

Printing imported names during compilation shows exact imported signatures for representative declarations.

"linux/linux" use
"control" use

{} Int32 {} [
  @epoll_wait printStack _:;
  @timerfd_settime printStack _:;
  0
] "main" exportFunction

Expected Output During Compilation

{epfd: Int32; events: Natx; maxevents: Int32; timeout: Int32;} Int32 {convention: "";} codeRef
{fd: Int32; flags: Int32; new_value: {it_interval: {tv_sec: Intx; tv_nsec: Intx;}; it_value: {tv_sec: Intx; tv_nsec: Intx;};} Cref; old_value: {it_interval: {tv_sec: Intx; tv_nsec: Intx;}; it_value: {tv_sec: Intx; tv_nsec: Intx;};} Ref;} Int32 {convention: "";} codeRef

Examples

epoll descriptor creation

"linux/linux" use
"linux/posix" use
"String" use
"control" use

{} Int32 {} [
  epfd: 0 epoll_create1;
  epClose: epfd close;
  ("created=" epfd 0 < ~ LF
   "close=" epClose 0 = LF) printList
  0
] "main" exportFunction

Expected Output

created=TRUE
close=TRUE

Timer descriptor creation

"linux/linux" use
"linux/posix" use
"String" use
"control" use

{} Int32 {} [
  fd: CLOCK_MONOTONIC TFD_NONBLOCK timerfd_create;
  closeResult: fd close;
  ("created=" fd 0 < ~ LF
   "close=" closeResult 0 = LF) printList
  0
] "main" exportFunction

Expected Output

created=TRUE
close=TRUE

See also