Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Improve the description of the BPF select() issue.

Indicate what releases of FreeBSD, NetBSD, OpenBSD, and Mac OS X first
fixed select() to handle the timeout on BPF devices.  (DragonFly BSD was
forked from FreeBSD after the fix, so it always had the fix.)

More precisely describe what the problem is.
  • Loading branch information...
commit 424e2c3bd75e81a0121245470e7f7d201a89929d 1 parent f280d06
Guy Harris guyharris authored

Showing 1 changed file with 14 additions and 4 deletions. Show diff stats Hide diff stats

  1. +14 4 pcap_get_selectable_fd.3pcap
18 pcap_get_selectable_fd.3pcap
@@ -56,19 +56,29 @@ or
56 56 (for example, regular network devices on FreeBSD 4.3 and 4.4, and Endace
57 57 DAG devices), so \-1 is returned for those devices.
58 58 .PP
59   -Note that on most versions of most BSDs (including Mac OS X)
  59 +Note that in:
  60 +.IP
  61 +FreeBSD prior to FreeBSD 4.6;
  62 +.IP
  63 +NetBSD prior to NetBSD 3.0;
  64 +.IP
  65 +OpenBSD prior to OpenBSD 2.4;
  66 +.IP
  67 +Mac OS X prior to Mac OS X 10.7;
  68 +.PP
60 69 .B select()
61 70 and
62 71 .B poll()
63 72 do not work correctly on BPF devices;
64 73 .B pcap_get_selectable_fd()
65 74 will return a file descriptor on most of those versions (the exceptions
66   -being FreeBSD 4.3 and 4.4), a simple
  75 +being FreeBSD 4.3 and 4.4), but a simple
67 76 .B select()
68 77 or
69 78 .B poll()
70   -will not return even after the read timeout expires. To work around
71   -this, an application that uses
  79 +will not indicate that the descriptor is readable until a full buffer's
  80 +worth of packets is received, even if the read timeout expires before
  81 +then. To work around this, an application that uses
72 82 .B select()
73 83 or
74 84 .B poll()

0 comments on commit 424e2c3

Please sign in to comment.
Something went wrong with that request. Please try again.