1 /* 2 * Copyright (c) 2018 Linaro Limited 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_POSIX_FCNTL_H_ 8 #define ZEPHYR_POSIX_FCNTL_H_ 9 10 #ifdef CONFIG_PICOLIBC 11 #define O_CREAT 0x0040 12 #define O_TRUNC 0x0200 13 #define O_APPEND 0x0400 14 #else 15 #define O_CREAT 0x0200 16 #define O_TRUNC 0x0400 17 #define O_APPEND 0x0008 18 #endif 19 20 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) 21 22 #define O_RDONLY 00 23 #define O_WRONLY 01 24 #define O_RDWR 02 25 26 #define O_EXCL 0x0800 27 #define O_NONBLOCK 0x4000 28 29 #define F_DUPFD 0 30 #define F_GETFL 3 31 #define F_SETFL 4 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 int open(const char *name, int flags, ...); 38 int fcntl(int fildes, int cmd, ...); 39 40 #ifdef __cplusplus 41 } 42 #endif 43 44 #endif /* ZEPHYR_POSIX_FCNTL_H_ */ 45