Next: posix fd select select, Up: posix fd select [Index]
At low level, the POSIX function select()
keeps track of file
descriptors organised in sets, represented by instances of the C
language type fd_set
; we can think of such data structures as
arrays of integers, holding FD_SETSIZE
bits, in which each bit
represents a file descriptor: 1
for inclusion, 0
for
exclusion.
Return an exact integer representing the number of bytes needed to hold
count instances of the C language type fd_set
. The
optional count must be a positive fixnum; when not given: it
defaults to 1
.
Build and return a new bytevector capable of holding count
instances of the C language type fd_set
defined in
sys/types.h; every allocated fd_set
is initialised with
FD_ZERO()
. The optional count must be a positive fixnum;
when not given: allocate enough room for a single instance of
fd_set
.
Use malloc()
to allocate a memory block capable of holding
count instances of the C language type fd_set
defined in
sys/types.h; every allocated fd_set
is initialised with
FD_ZERO()
.
The optional count must be a positive fixnum; when not given:
allocate enough room for a single instance of fd_set
.
If successful: return a pointer object referencing the memory block;
else return #f
.
Use malloc()
to allocate a memory block capable of holding
count instances of the C language type fd_set
defined in
sys/types.h; every allocated fd_set
is initialised with
FD_ZERO()
.
The optional count must be a positive fixnum; when not given:
allocate enough room for a single instance of fd_set
.
If successful: return an instance of memory-block
referencing the
memory block; else return #f
.
Reset to empty the given file descriptor set; return unspecified values; (libc)FD_ZERO.
fdsets must be a bytevector, pointer object or memory-block
instance holding or referencing one or more instances of the C language
type fd_set
.
idx must be a non–negative fixnum representing the index of the
selected fd_set
in fdsets; when not given: it defaults to
zero.
Add the file descriptor fd to the given set; return unspecified values; (libc)FD_SET.
fdsets must be a bytevector, pointer object or memory-block
instance holding or referencing one or more instances of the C language
type fd_set
.
The optional idx must be a non–negative fixnum representing the
index of the selected fd_set
in fdsets; when not given: it
defaults to zero.
Remove the file descriptor fd from the given set; return unspecified values; (libc)FD_CLR.
fdsets must be a bytevector, pointer object or memory-block
instance holding or referencing one or more instances of the C language
type fd_set
.
The optional idx must be a non–negative fixnum representing the
index of the selected fd_set
in fdsets; when not given: it
defaults to zero.
Return a boolean specifying if the file descriptor fd is contained in the given set; return unspecified values; (libc)FD_ISSET.
fdsets must be a bytevector, pointer object or memory-block
instance holding or referencing one or more instances of the C language
type fd_set
.
The optional idx must be a non–negative fixnum representing the
index of the selected fd_set
in fdsets; when not given: it
defaults to zero.
Return a list of fixnums representing the file descriptors set in the
selected fd_set
structure. This function is for debugging
purposes.
fdsets must be a bytevector, pointer object or memory-block
instance holding or referencing one or more instances of the C language
type fd_set
.
The optional idx must be a non–negative fixnum representing the
index of the selected fd_set
in fdsets; when not given: it
defaults to zero.
Next: posix fd select select, Up: posix fd select [Index]