fcntl.h 741 B

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