net: sockets: move fcntl back to socket_offload.c

We are reverting the changes in commit
55b3f05932 given build errors are seen
when fcntl.h is included, as it declares fcntl() as a non-static
function. The same function cannot be declared as both static and
non-static.

Instead, we avoid redefining fcntl() in lib/os/fdtable.c specifically
for case of the SimpleLink family, til we have support for the new
socket_op_vtable.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
This commit is contained in:
Vincent Wan 2019-03-05 15:08:36 -08:00 committed by Kumar Gala
commit 3609e261bb
3 changed files with 24 additions and 14 deletions

View file

@ -20,3 +20,19 @@ void socket_offload_register(const struct socket_offload *ops)
socket_ops = ops;
}
#ifdef CONFIG_SOC_FAMILY_TISIMPLELINK
int fcntl(int fd, int cmd, ...)
{
__ASSERT_NO_MSG(socket_ops);
__ASSERT_NO_MSG(socket_ops->fcntl);
va_list args;
int res;
va_start(args, cmd);
res = socket_ops->fcntl(fd, cmd, args);
va_end(args);
return res;
}
#endif