Exemplo n.º 1
0
/* ARGSUSED */
static int
fifo_poll(void *v)
{
    struct vop_poll_args /* {
		struct vnode	*a_vp;
		int		a_events;
		struct lwp	*a_l;
	} */ *ap = v;
    struct socket	*so;
    int		revents;

    revents = 0;
    if (ap->a_events & (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND)) {
        so = ap->a_vp->v_fifoinfo->fi_readsock;
        if (so)
            revents |= sopoll(so, ap->a_events);
    }
    if (ap->a_events & (POLLOUT | POLLWRNORM | POLLWRBAND)) {
        so = ap->a_vp->v_fifoinfo->fi_writesock;
        if (so)
            revents |= sopoll(so, ap->a_events);
    }

    return (revents);
}
Exemplo n.º 2
0
static int
soo_poll(struct file *fp, int events, struct ucred *active_cred,
    struct thread *td)
{
	struct socket *so = fp->f_data;
#ifdef MAC
	int error;

	error = mac_socket_check_poll(active_cred, so);
	if (error)
		return (error);
#endif
	return (sopoll(so, events, fp->f_cred, td));
}
int
soo_poll(file_t *fp, int events)
{

	return sopoll(fp->f_data, events);
}