1 /* 2 * Copyright (c) 2006-2018, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 */ 9 #ifndef __STAT_H__ 10 #define __STAT_H__ 11 12 #include <rtthread.h> 13 14 #ifdef RT_USING_DFS 15 #include <dfs_posix.h> 16 #else 17 #define _FREAD 0x0001 /* read enabled */ 18 #define _FWRITE 0x0002 /* write enabled */ 19 #define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */ 20 #define _FMARK 0x0010 /* internal; mark during gc() */ 21 #define _FDEFER 0x0020 /* internal; defer for next gc pass */ 22 #define _FASYNC 0x0040 /* signal pgrp when data ready */ 23 #define _FSHLOCK 0x0080 /* BSD flock() shared lock present */ 24 #define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */ 25 #define _FCREAT 0x0200 /* open with file create */ 26 #define _FTRUNC 0x0400 /* open with truncation */ 27 #define _FEXCL 0x0800 /* error on open if file exists */ 28 #define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */ 29 #define _FSYNC 0x2000 /* do all writes synchronously */ 30 #define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ 31 #define _FNDELAY _FNONBLOCK /* non blocking I/O (4.2 style) */ 32 #define _FNOCTTY 0x8000 /* don't assign a ctty on this open */ 33 34 #define O_RDONLY 0 /* +1 == FREAD */ 35 #define O_WRONLY 1 /* +1 == FWRITE */ 36 #define O_RDWR 2 /* +1 == FREAD|FWRITE */ 37 #define O_APPEND _FAPPEND 38 #define O_CREAT _FCREAT 39 #define O_TRUNC _FTRUNC 40 #define O_EXCL _FEXCL 41 #define O_SYNC _FSYNC 42 #endif 43 44 #endif 45