diff options
Diffstat (limited to 'pcap_get_selectable_fd.3pcap')
-rw-r--r-- | pcap_get_selectable_fd.3pcap | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/pcap_get_selectable_fd.3pcap b/pcap_get_selectable_fd.3pcap index c7b31607..7f43db39 100644 --- a/pcap_get_selectable_fd.3pcap +++ b/pcap_get_selectable_fd.3pcap @@ -17,7 +17,7 @@ .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" -.TH PCAP_GET_SELECTABLE_FD 3PCAP "20 January 2018" +.TH PCAP_GET_SELECTABLE_FD 3PCAP "25 July 2018" .SH NAME pcap_get_selectable_fd \- get a file descriptor on which a select() can be done for a live capture @@ -42,7 +42,9 @@ do a .BR kevent() , or other such call to wait for it to be possible to read packets without blocking, if such -a descriptor exists, or \-1, if no such descriptor exists. +a descriptor exists, or +.BR PCAP_ERROR , +if no such descriptor exists. .PP Some network devices opened with .B pcap_create(3PCAP) @@ -51,17 +53,21 @@ and or with .BR pcap_open_live(3PCAP) , do not support those calls (for example, regular network devices on -FreeBSD 4.3 and 4.4, and Endace DAG devices), so \-1 is returned for +FreeBSD 4.3 and 4.4, and Endace DAG devices), so +.B PCAP_ERROR +is returned for those devices. In that case, those calls must be given a timeout less than or equal to the timeout returned by .B pcap_get_required_select_timeout(3PCAP) for the device for which .B pcap_get_selectable_fd() -returned \-1, the device must be put in non-blocking mode with a call to -.BR pcap_setnonblock(3PCAP) , +returned +.BR PCAP_ERROR , +the device must be put in non-blocking mode with a call to +.BR \%pcap_setnonblock(3PCAP) , and an attempt must always be made to read packets from the device when the call returns. If -.B pcap_get_required_select_timeout() +.B \%pcap_get_required_select_timeout() returns .BR NULL , it is not possible to wait for packets to arrive on the device in an @@ -138,7 +144,8 @@ work on that descriptor in Mac OS X 10.6 and later. .B pcap_get_selectable_fd() is not available on Windows. .SH RETURN VALUE -A selectable file descriptor is returned if one exists; otherwise, \-1 +A selectable file descriptor is returned if one exists; otherwise, +.B PCAP_ERROR is returned. .SH SEE ALSO pcap(3PCAP), kqueue(2) |