Hack to fix sockets's non-blocking mode. Map BeOS's B_SET[_NON]BLOCKING_IO opcodes
to POSIX open flags and BSDish FIONBIO opcode... git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7742 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -452,13 +452,17 @@ static status_t net_stack_control(void *cookie, uint32 op, void *data, size_t le
|
||||
case NET_STACK_GETPEERNAME:
|
||||
return core->socket_getpeername(nsc->socket, args->u.sockaddr.addr, &args->u.sockaddr.addrlen);
|
||||
|
||||
case B_SET_BLOCKING_IO:
|
||||
case B_SET_BLOCKING_IO: {
|
||||
int off = false;
|
||||
nsc->open_flags &= ~O_NONBLOCK;
|
||||
return B_OK;
|
||||
return core->socket_ioctl(nsc->socket, FIONBIO, &off);
|
||||
}
|
||||
|
||||
case B_SET_NONBLOCKING_IO:
|
||||
case B_SET_NONBLOCKING_IO: {
|
||||
int on = true;
|
||||
nsc->open_flags |= O_NONBLOCK;
|
||||
return B_OK;
|
||||
return core->socket_ioctl(nsc->socket, FIONBIO, &on);
|
||||
}
|
||||
|
||||
case NET_STACK_SELECT:
|
||||
/* if we get this opcode, we are using the r5 kernel select() call,
|
||||
|
||||
Reference in New Issue
Block a user