<s>
is	O
a	O
system	B-Operating_System
call	I-Operating_System
and	O
application	B-Application
programming	I-Application
interface	I-Application
(	O
API	B-Application
)	O
in	O
Unix-like	B-Operating_System
and	O
POSIX-compliant	O
operating	O
systems	O
for	O
examining	O
the	O
status	O
of	O
file	B-Application
descriptors	I-Application
of	O
open	O
input/output	O
channels	O
.	O
</s>
<s>
The	O
select	O
system	B-Operating_System
call	I-Operating_System
is	O
similar	O
to	O
the	O
facility	O
introduced	O
in	O
UNIX	O
System	O
V	O
and	O
later	O
operating	O
systems	O
.	O
</s>
<s>
However	O
,	O
with	O
the	O
c10k	B-Protocol
problem	I-Protocol
,	O
both	O
select	O
and	O
poll	B-Language
have	O
been	O
superseded	O
by	O
the	O
likes	O
of	O
kqueue	B-Application
,	O
epoll	B-Application
,	O
/dev/poll	O
and	O
I/O	B-Library
completion	I-Library
ports	I-Library
.	O
</s>
<s>
One	O
common	O
use	O
of	O
select	O
outside	O
of	O
its	O
stated	O
use	O
of	O
waiting	O
on	O
filehandles	B-Application
is	O
to	O
implement	O
a	O
portable	O
sub-second	O
sleep	B-Operating_System
.	O
</s>
<s>
This	O
can	O
be	O
achieved	O
by	O
passing	O
NULL	O
for	O
all	O
three	O
fd_set	O
arguments	O
,	O
and	O
the	O
duration	O
of	O
the	O
desired	O
sleep	B-Operating_System
as	O
the	O
timeout	O
argument	O
.	O
</s>
<s>
In	O
the	O
C	B-Language
programming	I-Language
language	I-Language
,	O
the	O
select	O
system	B-Operating_System
call	I-Operating_System
is	O
declared	O
in	O
the	O
header	O
file	O
sys/select.h	O
or	O
unistd.h	B-Language
,	O
and	O
has	O
the	O
following	O
syntax	O
:	O
</s>
<s>
argument	O
description	O
This	O
is	O
an	O
integer	O
one	O
more	O
than	O
the	O
maximum	O
of	O
any	O
file	B-Application
descriptor	I-Application
in	O
any	O
of	O
the	O
sets	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
while	O
adding	O
file	B-Application
descriptors	I-Application
to	O
each	O
of	O
the	O
sets	O
,	O
you	O
must	O
calculate	O
the	O
maximum	O
integer	O
value	O
of	O
all	O
of	O
them	O
,	O
then	O
increment	O
this	O
value	O
by	O
one	O
,	O
and	O
then	O
pass	O
this	O
as	O
nfds	O
.	O
</s>
<s>
type	O
holding	O
the	O
file	B-Application
descriptors	I-Application
to	O
be	O
checked	O
for	O
being	O
ready	O
to	O
read	O
,	O
and	O
on	O
output	O
indicates	O
which	O
file	B-Application
descriptors	I-Application
are	O
ready	O
to	O
read	O
.	O
</s>
<s>
type	O
holding	O
the	O
file	B-Application
descriptors	I-Application
to	O
be	O
checked	O
for	O
being	O
ready	O
to	O
write	O
,	O
and	O
on	O
output	O
indicates	O
which	O
file	B-Application
descriptors	I-Application
are	O
ready	O
to	O
write	O
.	O
</s>
<s>
type	O
holding	O
the	O
file	B-Application
descriptors	I-Application
to	O
be	O
checked	O
for	O
error	O
conditions	O
pending	O
,	O
and	O
on	O
output	O
indicates	O
which	O
file	B-Application
descriptors	I-Application
have	O
error	O
conditions	O
pending	O
.	O
</s>
<s>
The	O
sets	O
of	O
file	B-Application
descriptor	I-Application
used	O
in	O
select	O
are	O
finite	O
in	O
size	O
,	O
depending	O
on	O
the	O
operating	O
system	O
.	O
</s>
<s>
The	O
newer	O
system	B-Operating_System
call	I-Operating_System
provides	O
a	O
more	O
flexible	O
solution	O
.	O
</s>
