mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
Noux/net: add proper fcntl() to socket_io_channel
This commit is contained in:
parent
a6904b4deb
commit
1c495b79f4
@ -27,6 +27,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
||||
namespace Noux {
|
||||
@ -82,25 +83,15 @@ namespace Noux {
|
||||
|
||||
bool fcntl(Sysio *sysio)
|
||||
{
|
||||
/*
|
||||
* For now this fcntl() only contains stubs to keep programs
|
||||
* happy. lwip-1.3.2 which is currently used does not provide
|
||||
* its own lwip_fcntl(). We could only use lwip_ioctl() to set
|
||||
* the socket O_NONBLOCKING if we get this kind of request.
|
||||
*/
|
||||
switch (sysio->fcntl_in.cmd) {
|
||||
|
||||
case Sysio::FCNTL_CMD_GET_FILE_STATUS_FLAGS:
|
||||
{
|
||||
PWRN("FCNTL_CMD_GET_FILE_STATUS_FLAGS currently only returns 0");
|
||||
sysio->fcntl_out.result = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
case Sysio::FCNTL_CMD_SET_FILE_STATUS_FLAGS:
|
||||
{
|
||||
PWRN("FCNTL_CMD_SET_FILE_STATUS_FLAGS currently only returns 0");
|
||||
sysio->fcntl_out.result = 0;
|
||||
int result = ::fcntl(_socket, sysio->fcntl_in.cmd,
|
||||
sysio->fcntl_in.long_arg);
|
||||
|
||||
sysio->fcntl_out.result = result;
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user