return accept_nonblock(getRuntime().getCurrentContext());
}
@JRubyMethod
public IRubyObject accept_nonblock(ThreadContext context) {
LibCSocket.sockaddr_un from = LibCSocket.sockaddr_un.newInstance();
IntByReference fromlen = new IntByReference(LibCSocket.sockaddr_un.LENGTH);
int flags = INSTANCE.fcntl(fd, RubyUNIXSocket.F_GETFL ,0);
INSTANCE.fcntl(fd, RubyUNIXSocket.F_SETFL, flags | RubyUNIXSocket.O_NONBLOCK);
int fd2 = INSTANCE.accept(fd, from, new IntByReference(LibCSocket.sockaddr_un.LENGTH));
if(fd2 < 0) {
rb_sys_fail(context.getRuntime(), null);
}
Ruby runtime = context.getRuntime();