diff --git a/libports/src/lib/libc_lwip/plugin.cc b/libports/src/lib/libc_lwip/plugin.cc index 91e123f0d2..d923bb339c 100644 --- a/libports/src/lib/libc_lwip/plugin.cc +++ b/libports/src/lib/libc_lwip/plugin.cc @@ -180,6 +180,7 @@ struct Plugin : Libc::Plugin int connect(Libc::File_descriptor *sockfdo, const struct sockaddr *addr, socklen_t addrlen); + int fcntl(Libc::File_descriptor *sockfdo, int cmd, long val); void freeaddrinfo(struct ::addrinfo *res); int getaddrinfo(const char *node, const char *service, const struct ::addrinfo *hints, @@ -312,6 +313,25 @@ int Plugin::connect(Libc::File_descriptor *sockfdo, } +int Plugin::fcntl(Libc::File_descriptor *sockfdo, int cmd, long val) +{ + int s = get_lwip_fd(sockfdo); + int result = -1; + + switch (cmd) { + case F_GETFL: + case F_SETFL: + result = lwip_fcntl(s, cmd, val); + break; + default: + PERR("unsupported fcntl() request"); + break; + } + + return result; +} + + void Plugin::freeaddrinfo(struct ::addrinfo *res) { struct ::addrinfo *next;