1 .\" Copyright (c) 1994, 1996, 1997
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that: (1) source code distributions
6 .\" retain the above copyright notice and this paragraph in its entirety, (2)
7 .\" distributions including binary code include the above copyright notice and
8 .\" this paragraph in its entirety in the documentation or other materials
9 .\" provided with the distribution, and (3) all advertising materials mentioning
10 .\" features or use of this software display the following acknowledgement:
11 .\" ``This product includes software developed by the University of California,
12 .\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
13 .\" the University nor the names of its contributors may be used to endorse
14 .\" or promote products derived from this software without specific prior
15 .\" written permission.
16 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 .TH PCAP_GET_REQUIRED_SELECT_TIMEOUT 3PCAP "25 July 2018"
22 pcap_get_required_select_timeout \- get a file descriptor on which a
23 select() can be done for a live capture
27 #include <pcap/pcap.h>
31 struct timeval *pcap_get_required_select_timeout(pcap_t *p);
35 .B pcap_get_required_select_timeout()
36 returns, on UNIX, a pointer to a
38 containing a value that must be used as the minimum timeout in
45 .BR pcap_get_selectable_fd (3PCAP)
49 The timeout that should be used in those calls must be no larger than
50 the smallest of all timeouts returned by
51 .B \%pcap_get_required_select_timeout()
52 for devices from which packets will be captured.
55 .B pcap_get_selectable_fd()
58 must be put in non-blocking mode with
59 .BR pcap_setnonblock (3PCAP),
60 and an attempt must always be made to read packets from the device
69 Note that a device on which a read can be done without blocking may,
70 on some platforms, not have any packets to read if the packet buffer
71 timeout has expired. A call to
72 .BR pcap_dispatch (3PCAP)
74 .BR pcap_next_ex (3PCAP)
75 will return 0 in this case, but will not block.
77 .B pcap_get_required_select_timeout()
78 is not available on Windows.
82 is returned if the timeout is required; otherwise
85 .SH BACKWARD COMPATIBILITY
86 This function became available in libpcap release 1.9.0. In previous
93 cannot be used on any capture source for which
94 .B pcap_get_selectable_fd
98 .BR pcap_get_selectable_fd (3PCAP),