GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PCAP_GET_REQUIRED_SELECT_TIMEOUT(3) FreeBSD Library Functions Manual PCAP_GET_REQUIRED_SELECT_TIMEOUT(3)

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

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

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(2), poll(2), epoll_wait(2), and kevent() calls if pcap_get_selectable_fd(3) returns PCAP_ERROR.

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 PCAP_ERROR must be put in non-blocking mode with pcap_setnonblock(3), 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(3) or pcap_next_ex(3) will return 0 in this case, but will not block.

pcap_get_required_select_timeout() is not available on Windows.

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

This function became available in libpcap release 1.9.0. In previous releases, select(), poll(), epoll_wait(), and kevent() cannot be used on any capture source for which pcap_get_selectable_fd returns -1.

pcap(3), pcap_get_selectable_fd(3), select(2), poll(2), epoll_wait(2), kqueue(2)
25 July 2018

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.