eonce->cb = callback; eonce->arg = arg;
event_once(int fd, short events,    void (*callback)(int, short, void *), void *arg, struct timeval *tv){	struct event_once *eonce;	struct timeval etv;	/* We cannot support signals that just fire once */	if (events & EV_SIGNAL)		return (-1);	if ((eonce = calloc(1, sizeof(struct event_once))) == NULL)		return (-1);	if (events == EV_TIMEOUT) {		if (tv == NULL) {			timerclear(&etv);			tv = &etv;		}		eonce->cb = callback;		eonce->arg = arg;		evtimer_set(&eonce->ev, event_once_cb, eonce);	} else if (events & (EV_READ|EV_WRITE)) {		events &= EV_READ|EV_WRITE;		event_set(&eonce->ev, fd, events, event_once_cb, eonce);	} else {		/* Bad event combination */		return (-1);	}	event_add(&eonce->ev, tv);	return (0);}