FreeBSD/sys/net/bpf.c
/*
 * Support for kevent() system call.  Register EVFILT_READ filters and
 * reject all others.
 */
Support for kevent() system call.  Register EVFILT_READ filters and
reject all others.
Support for kevent () system call . Register EVFILT_READ filters and reject all others .
int
bpfkqfilter(struct cdev *dev, struct knote *kn)
{
	struct bpf_d *d;
	if (devfs_get_cdevpriv((void **)&d) != 0 ||
	    kn->kn_filter != EVFILT_READ)
		return (1);
	BPFD_LOCK(d);
	BPF_PID_REFRESH_CUR(d);
	kn->kn_fop = &bpfread_filtops;
	kn->kn_hook = d;
	knlist_add(&d->bd_sel.si_note, kn, 1);
	BPFD_UNLOCK(d);
	return (0);
}
int bpfkqfilter ( struct cdev * dev , struct knote * kn ) { struct bpf_d * d ; if ( devfs_get_cdevpriv ( ( void * * ) & d ) != 0 || kn -> kn_filter != EVFILT_READ ) return ( 1 ) ; BPFD_LOCK ( d ) ; BPF_PID_REFRESH_CUR ( d ) ; kn -> kn_fop = & bpfread_filtops ; kn -> kn_hook = d ; knlist_add ( & d -> bd_sel . si_note , kn , 1 ) ; BPFD_UNLOCK ( d ) ; return ( 0 ) ; }
Support for kevent() system call.
Support for kevent () system call .
/*
	 * Refresh PID associated with this descriptor.
	 */