Skip to content

Commit c2a62f4

Browse files
Chris Friedtmbolivar-nordic
authored andcommitted
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 <[email protected]>
1 parent ab6102f commit c2a62f4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

subsys/net/lib/sockets/sockets.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
* SPDX-License-Identifier: Apache-2.0
66
*/
77

8-
/* libc headers */
9-
#include <fcntl.h>
10-
118
/* Zephyr headers */
129
#include <zephyr/logging/log.h>
1310
LOG_MODULE_REGISTER(net_sock, CONFIG_NET_SOCKETS_LOG_LEVEL);
@@ -17,6 +14,11 @@ LOG_MODULE_REGISTER(net_sock, CONFIG_NET_SOCKETS_LOG_LEVEL);
1714
#include <zephyr/net/net_pkt.h>
1815
#include <zephyr/net/socket.h>
1916
#include <zephyr/net/socket_types.h>
17+
#ifdef CONFIG_ARCH_POSIX
18+
#include <fcntl.h>
19+
#else
20+
#include <zephyr/posix/fcntl.h>
21+
#endif
2022
#include <zephyr/syscall_handler.h>
2123
#include <zephyr/sys/fdtable.h>
2224
#include <zephyr/sys/math_extras.h>

0 commit comments

Comments
 (0)