pcap_get_required_select_timeout.3pcap - Linux manual page

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | SEE ALSO | COLOPHON

PCAP_GET_REQUIRED_SELECT_TIMEOUT(3PCAP)AP_GET_REQUIRED_SELECT_TIMEOUT(3PCAP)

NAME         top

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

SYNOPSIS         top

       #include <pcap/pcap.h>

       struct timeval *pcap_get_required_select_timeout(pcap_t *p);

DESCRIPTION         top

       pcap_get_required_select_timeout() returns, on UNIX, a pointer to a
       struct timeval containing a value that must be used as the minimum
       timeout in select(), poll(), epoll_wait(), and kevent() calls if
       pcap_get_selectable_fd() returns -1.

       The timeout that should be used in those calls must be no larger than
       the smallest of all timeouts returned by
       pcap_get_required_select_timeout() for devices from which packets
       will be captured.

       The device for which pcap_get_selectable_fd() returned -1 must be put
       in non-blocking mode with pcap_setnonblock(), and an attempt must
       always be made to read packets from the device when the select(),
       poll(), epoll_wait(), or kevent() call returns.

       Note that a device on which a read can be done without blocking may,
       on some platforms, not have any packets to read if the packet buffer
       timeout has expired.  A call to pcap_dispatch() or pcap_next_ex()
       will return 0 in this case, but will not block.

       pcap_get_required_select_timeout() is not available on Windows.

RETURN VALUE         top

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

SEE ALSO         top

       pcap(3PCAP), pcap_get_selectable_fd(3PCAP), select(2), poll(2),
       epoll_wait(2), kqueue(2)

COLOPHON         top

       This page is part of the libpcap (packet capture library) project.
       Information about the project can be found at 
       ⟨http://www.tcpdump.org/⟩.  If you have a bug report for this manual
       page, see ⟨http://www.tcpdump.org/#patches⟩.  This page was obtained
       from the project's upstream Git repository
       ⟨https://github.com/the-tcpdump-group/libpcap.git⟩ on 2018-02-02.
       (At that time, the date of the most recent commit that was found in
       the repository was 2018-01-31.)  If you discover any rendering prob‐
       lems in this HTML version of the page, or you believe there is a bet‐
       ter or more up-to-date source for the page, or you have corrections
       or improvements to the information in this COLOPHON (which is not
       part of the original manual page), send a mail to man-pages@man7.org

                               19 JanuPaCrAyP_2G0E1T8_REQUIRED_SELECT_TIMEOUT(3PCAP)