| 2161 | } |
| 2162 | |
| 2163 | static int |
| 2164 | filt_bpfread(struct knote *kn, long hint) |
| 2165 | { |
| 2166 | struct bpf_d *d = (struct bpf_d *)kn->kn_hook; |
| 2167 | int ready; |
| 2168 | |
| 2169 | BPFD_LOCK_ASSERT(d); |
| 2170 | ready = bpf_ready(d); |
| 2171 | if (ready) { |
| 2172 | kn->kn_data = d->bd_slen; |
| 2173 | /* |
| 2174 | * Ignore the hold buffer if it is being copied to user space. |
| 2175 | */ |
| 2176 | if (!d->bd_hbuf_in_use && d->bd_hbuf) |
| 2177 | kn->kn_data += d->bd_hlen; |
| 2178 | } else if (d->bd_rtout > 0 && d->bd_state == BPF_IDLE) { |
| 2179 | callout_reset(&d->bd_callout, d->bd_rtout, |
| 2180 | bpf_timed_out, d); |
| 2181 | d->bd_state = BPF_WAITING; |
| 2182 | } |
| 2183 | |
| 2184 | return (ready); |
| 2185 | } |
| 2186 | |
| 2187 | #define BPF_TSTAMP_NONE 0 |
| 2188 | #define BPF_TSTAMP_FAST 1 |
nothing calls this directly
no test coverage detected