P_poll 3porty | 2011-04-14 | libporty manual |
---|
P_poll
#include <libporty/net/network.h>int P_poll (struct P_pollfd * fds , nfds_t nfds , int timeout );
Link with -lporty_net
Portable interface to poll(2) with mathcing API.On systems where poll(2) is available, libporty will use it directly through macros. Where poll(2) is not available but select(2) is, libporty falls back using a select() based implementation. On systems implementing neither poll or select, P_poll fails.
struct P_pollfd matches struct pollfd. Field events and revents in P_pollfd should be initialized with P_ prefixed constants: P_POLLIN, P_POLLPRI, P_POLLOUT, P_POLLERR, P_POLLHUP, P_POLLNVAL.
Returns number of file descriptors changed or 0 on timeout or -1 on error.
P_poll 3porty | 2011-04-14 | libporty manual |
---|