ARC: MWDT: workaround missing file IO related defines
ARC MWDT libc misses some file IO related defines, let's add them in ARC MWDT libc compatibility layer. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This commit is contained in:
parent
5d2be3d085
commit
64ff64a48f
1 changed files with 28 additions and 0 deletions
28
lib/libc/arcmwdt/include/fcntl.h
Normal file
28
lib/libc/arcmwdt/include/fcntl.h
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2021 Synopsys
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ZEPHYR_LIB_LIBC_ARCMWDT_INCLUDE_FCNTL_H_
|
||||||
|
#define ZEPHYR_LIB_LIBC_ARCMWDT_INCLUDE_FCNTL_H_
|
||||||
|
|
||||||
|
#include_next <fcntl.h>
|
||||||
|
|
||||||
|
#define F_DUPFD 0
|
||||||
|
#define F_GETFL 3
|
||||||
|
#define F_SETFL 4
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MWDT fcntl.h doesn't provide O_NONBLOCK, however it provides other file IO
|
||||||
|
* definitions. Let's define O_NONBLOCK and check that it doesn't overlap with
|
||||||
|
* any other file IO defines.
|
||||||
|
*/
|
||||||
|
#ifndef O_NONBLOCK
|
||||||
|
#define O_NONBLOCK 0x4000
|
||||||
|
#if O_NONBLOCK & (O_RDONLY | O_WRONLY | O_RDWR | O_NDELAY | O_CREAT | O_APPEND | O_TRUNC | O_EXCL)
|
||||||
|
#error "O_NONBLOCK conflicts with other O_*** file IO defines!"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* ZEPHYR_LIB_LIBC_ARCMWDT_INCLUDE_FCNTL_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue