net: sockets: conditionally include zephyr/posix/fcntl.h

Only include `<fcntl.h>` for `CONFIG_ARCH_POSIX`. Otherwise,
include `<zephyr/posix/fcntl.h>`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
This commit is contained in:
Chris Friedt 2023-01-10 21:54:22 -05:00 committed by Marti Bolivar
commit c2a62f4ad7

View file

@ -5,9 +5,6 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
/* libc headers */
#include <fcntl.h>
/* Zephyr headers */ /* Zephyr headers */
#include <zephyr/logging/log.h> #include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(net_sock, CONFIG_NET_SOCKETS_LOG_LEVEL); LOG_MODULE_REGISTER(net_sock, CONFIG_NET_SOCKETS_LOG_LEVEL);
@ -17,6 +14,11 @@ LOG_MODULE_REGISTER(net_sock, CONFIG_NET_SOCKETS_LOG_LEVEL);
#include <zephyr/net/net_pkt.h> #include <zephyr/net/net_pkt.h>
#include <zephyr/net/socket.h> #include <zephyr/net/socket.h>
#include <zephyr/net/socket_types.h> #include <zephyr/net/socket_types.h>
#ifdef CONFIG_ARCH_POSIX
#include <fcntl.h>
#else
#include <zephyr/posix/fcntl.h>
#endif
#include <zephyr/syscall_handler.h> #include <zephyr/syscall_handler.h>
#include <zephyr/sys/fdtable.h> #include <zephyr/sys/fdtable.h>
#include <zephyr/sys/math_extras.h> #include <zephyr/sys/math_extras.h>