示例#1
0
void
runtime_netpollinit(void)
{
	kq = runtime_kqueue();
	if(kq < 0) {
		runtime_printf("netpollinit: kqueue failed with %d\n", -kq);
		runtime_throw("netpollinit: kqueue failed");
	}
	runtime_closeonexec(kq);
}
示例#2
0
void
runtime_netpollinit(void)
{
	epfd = runtime_epollcreate1(EPOLL_CLOEXEC);
	if(epfd >= 0)
		return;
	epfd = runtime_epollcreate(1024);
	if(epfd >= 0) {
		runtime_closeonexec(epfd);
		return;
	}
	runtime_printf("netpollinit: failed to create descriptor (%d)\n", -epfd);
	runtime_throw("netpollinit: failed to create descriptor");
}