ARGSUSED*/
| 3811 | |
| 3812 | /*ARGSUSED*/ |
| 3813 | static int |
| 3814 | filt_soread(struct knote *kn, long hint) |
| 3815 | { |
| 3816 | struct socket *so; |
| 3817 | |
| 3818 | so = kn->kn_fp->f_data; |
| 3819 | |
| 3820 | if (SOLISTENING(so)) { |
| 3821 | SOCK_LOCK_ASSERT(so); |
| 3822 | kn->kn_data = so->sol_qlen; |
| 3823 | if (so->so_error) { |
| 3824 | kn->kn_flags |= EV_EOF; |
| 3825 | kn->kn_fflags = so->so_error; |
| 3826 | return (1); |
| 3827 | } |
| 3828 | return (!TAILQ_EMPTY(&so->sol_comp)); |
| 3829 | } |
| 3830 | |
| 3831 | SOCKBUF_LOCK_ASSERT(&so->so_rcv); |
| 3832 | |
| 3833 | kn->kn_data = sbavail(&so->so_rcv) - so->so_rcv.sb_ctl; |
| 3834 | if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { |
| 3835 | kn->kn_flags |= EV_EOF; |
| 3836 | kn->kn_fflags = so->so_error; |
| 3837 | return (1); |
| 3838 | } else if (so->so_error) /* temporary udp error */ |
| 3839 | return (1); |
| 3840 | |
| 3841 | if (kn->kn_sfflags & NOTE_LOWAT) { |
| 3842 | if (kn->kn_data >= kn->kn_sdata) |
| 3843 | return (1); |
| 3844 | } else if (sbavail(&so->so_rcv) >= so->so_rcv.sb_lowat) |
| 3845 | return (1); |
| 3846 | |
| 3847 | /* This hook returning non-zero indicates an event, not error */ |
| 3848 | return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); |
| 3849 | } |
| 3850 | |
| 3851 | static void |
| 3852 | filt_sowdetach(struct knote *kn) |
nothing calls this directly
no test coverage detected