include: net: Move fcntl implementation into socket_offload.h
This is done to conform with how the rest of the socket APIs are implemented during socket offload. Otherwise link error would result due to the symbol being redefined in lib/os/fdtable.c. Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
This commit is contained in:
parent
e0b369a63c
commit
55b3f05932
|
@ -158,7 +158,20 @@ static inline void freeaddrinfo(struct addrinfo *res)
|
|||
return socket_ops->freeaddrinfo(res);
|
||||
}
|
||||
|
||||
int fcntl(int fd, int cmd, ...);
|
||||
static inline 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;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -20,17 +20,3 @@ void socket_offload_register(const struct socket_offload *ops)
|
|||
socket_ops = ops;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue