1PCAP_GET_REQUIRED_SELECT_TIMEOUT(3PCAP)PCAP_GET_REQUIRED_SELECT_TIMEOUT(3PCAP)
2
3
4

NAME

6       pcap_get_required_select_timeout  -  get  a  file descriptor on which a
7       select() can be done for a live capture
8

SYNOPSIS

10       #include <pcap/pcap.h>
11
12       struct timeval *pcap_get_required_select_timeout(pcap_t *p);
13

DESCRIPTION

15       pcap_get_required_select_timeout() returns, on UNIX,  a  pointer  to  a
16       struct  timeval  containing  a  value  that must be used as the minimum
17       timeout in  select(),  poll(),  epoll_wait(),  and  kevent()  calls  if
18       pcap_get_selectable_fd() returns -1.
19
20       The  timeout  that should be used in those calls must be no larger than
21       the smallest of all timeouts returned by pcap_get_required_select_time‐
22       out() for devices from which packets will be captured.
23
24       The  device  for which pcap_get_selectable_fd() returned -1 must be put
25       in non-blocking mode  with  pcap_setnonblock(),  and  an  attempt  must
26       always  be  made  to  read  packets  from the device when the select(),
27       poll(), epoll_wait(), or kevent() call returns.
28
29       Note that a device on which a read can be done without blocking may, on
30       some platforms, not have any packets to read if the packet buffer time‐
31       out has expired.  A call  to  pcap_dispatch()  or  pcap_next_ex()  will
32       return 0 in this case, but will not block.
33
34       pcap_get_required_select_timeout() is not available on Windows.
35

RETURN VALUE

37       A  pointer  to a struct timeval is returned if the timeout is required;
38       otherwise NULL is returned.
39

SEE ALSO

41       pcap(3PCAP),   pcap_get_selectable_fd(3PCAP),    select(2),    poll(2),
42       epoll_wait(2), kqueue(2)
43
44
45
46                                20 JanuaPrCyAP2_0G1E8T_REQUIRED_SELECT_TIMEOUT(3PCAP)
Impressum