Provide select() on top of epoll()
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 6 Jan 2016 16:30:50 +0000 (11:30 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 14 Jan 2016 21:04:46 +0000 (16:04 -0500)
commit3aa8b49a8a45114f812cb195243d05c88c53e966
tree2e42aa2c0540c94d2c0b419fff2bad275f414d9c
parent5777d248d73abe5b466cd272381d7e7fc7b35d8f
Provide select() on top of epoll()

Our version of select will spuriously return, so your applications need
to handle being told an FD is ready even if it isn't.  If your operation
needs to not block, then use O_NONBLOCK.  This is somewhat similar to
Linux, where the man pages says:

Under Linux, select() may report a socket file descriptor as "ready
for reading", while nevertheless a subsequent read blocks.

Except in Akaros, this happens all the time.

For more caveats, see select.c.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tests/select_server.c [new file with mode: 0644]
user/iplib/select.c [new file with mode: 0644]