Noux/net: add proper fcntl() to socket_io_channel

This commit is contained in:
Josef Söntgen 2012-08-21 15:27:50 +02:00 committed by Norman Feske
parent a6904b4deb
commit 1c495b79f4
1 changed files with 5 additions and 14 deletions

View File

@ -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: