From 1c495b79f48a533fde2efa4921376bcea4f76b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Tue, 21 Aug 2012 15:27:50 +0200 Subject: [PATCH] Noux/net: add proper fcntl() to socket_io_channel --- ports/src/noux/net/socket_io_channel.h | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/ports/src/noux/net/socket_io_channel.h b/ports/src/noux/net/socket_io_channel.h index 618cb8a9c8..a9bf5aef95 100644 --- a/ports/src/noux/net/socket_io_channel.h +++ b/ports/src/noux/net/socket_io_channel.h @@ -27,6 +27,7 @@ #include #include #include +#include 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: