1 /*
2  * Copyright (c) 2021 Synopsys
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_LIB_LIBC_ARCMWDT_INCLUDE_FCNTL_H_
8 #define ZEPHYR_LIB_LIBC_ARCMWDT_INCLUDE_FCNTL_H_
9 
10 #include_next <fcntl.h>
11 
12 #define F_DUPFD 0
13 #define F_GETFL 3
14 #define F_SETFL 4
15 
16 /*
17  * MWDT fcntl.h doesn't provide O_NONBLOCK, however it provides other file IO
18  * definitions. Let's define O_NONBLOCK and check that it doesn't overlap with
19  * any other file IO defines.
20  */
21 #ifndef O_NONBLOCK
22   #define O_NONBLOCK 0x4000
23   #if O_NONBLOCK & (O_RDONLY | O_WRONLY | O_RDWR | O_NDELAY | O_CREAT | O_APPEND | O_TRUNC | O_EXCL)
24     #error "O_NONBLOCK conflicts with other O_*** file IO defines!"
25   #endif
26 #endif
27 
28 #endif /* ZEPHYR_LIB_LIBC_ARCMWDT_INCLUDE_FCNTL_H_ */
29