Current section

Files

Jump to
alcove edoc select-6.edoc
Raw

edoc/select-6.edoc

@doc select(2): poll a list of file descriptor for events
select/6 will block until an event occurs on a file descriptor, a timeout
is reached or interrupted by a signal.
The Timeout value may be:
• an empty list ([]): causes select to block indefinitely (no timeout)
• an alcove_timeval record
An alcove_timeval record contains these fields:
• sec : number of seconds to wait
• usec : number of microseconds to wait
== Examples ==
```
1> {ok, Drv} = alcove_drv:start().
{ok,<0.177.0>}
2> {ok, FD} = alcove:open(Drv, [], "/dev/null", [o_rdwr], 0).
{ok,6}
3> alcove:select(Drv, [], [FD], [FD], [FD], []).
{ok,[6],[6],[]}
4> rr(alcove).
[alcove_jail,alcove_pid,alcove_rlimit,alcove_timeval]
5> alcove:select(Drv, [], [FD], [FD], [FD], #alcove_timeval{sec = 1, usec = 1}).
{ok,[6],[6],[]}
'''