mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 16:35:28 +00:00
Noux: add is_nonblocking() method
Certain programs tend to set their sockets non-blocking. As previously descriptors in Noux were only blocking we now introduce a method to mark the used Io_channel as non-blocking.
This commit is contained in:
parent
343266b06e
commit
95f71a5f71
@ -70,6 +70,11 @@ namespace Noux {
|
||||
virtual bool check_unblock(bool rd, bool wr, bool ex) const {
|
||||
return false; }
|
||||
|
||||
/**
|
||||
* Return true if the channel is set to non-blocking mode
|
||||
*/
|
||||
virtual bool is_nonblocking() { return false; }
|
||||
|
||||
/**
|
||||
* Register blocker for getting waked up on an I/O channel event
|
||||
*
|
||||
|
@ -140,8 +140,9 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc)
|
||||
|
||||
Shared_pointer<Io_channel> io = _lookup_channel(_sysio->write_in.fd);
|
||||
|
||||
if (!io->check_unblock(false, true, false))
|
||||
_block_for_io_channel(io);
|
||||
if (!io->is_nonblocking())
|
||||
if (!io->check_unblock(false, true, false))
|
||||
_block_for_io_channel(io);
|
||||
|
||||
/*
|
||||
* 'io->write' is expected to update 'write_out.count'
|
||||
@ -156,8 +157,9 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc)
|
||||
{
|
||||
Shared_pointer<Io_channel> io = _lookup_channel(_sysio->read_in.fd);
|
||||
|
||||
while (!io->check_unblock(true, false, false))
|
||||
_block_for_io_channel(io);
|
||||
if (!io->is_nonblocking())
|
||||
while (!io->check_unblock(true, false, false))
|
||||
_block_for_io_channel(io);
|
||||
|
||||
io->read(_sysio);
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user