Skip to content

Commit d60c968

Browse files
committed
[libc] 优化fcntl.h定义
1 parent f944ea7 commit d60c968

File tree

1 file changed

+4
-9
lines changed
  • components/libc/compilers/common

1 file changed

+4
-9
lines changed

components/libc/compilers/common/fcntl.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@
1212

1313
#include <sys/types.h>
1414

15-
#if defined(_WIN32)
16-
#define O_ACCMODE (_O_RDONLY | _O_WRONLY | _O_RDWR)
17-
#endif
18-
19-
#define O_RDONLY 00
20-
#define O_WRONLY 01
21-
#define O_RDWR 02
15+
#define O_RDONLY 0x0000 /* open for reading only */
16+
#define O_WRONLY 0x0001 /* open for writing only */
17+
#define O_RDWR 0x0002 /* open for reading and writing */
18+
#define O_ACCMODE 0x0003 /* mask for above modes */
2219

2320
#define O_CREAT 0100
2421
#define O_EXCL 0200
@@ -43,8 +40,6 @@
4340
#define O_SEARCH O_PATH
4441
#define O_EXEC O_PATH
4542

46-
#define O_ACCMODE (03|O_SEARCH)
47-
4843
#define F_DUPFD 0
4944
#define F_GETFD 1
5045
#define F_SETFD 2

0 commit comments

Comments
 (0)