@@ -38,41 +38,41 @@ bitflags! {
3838 pub struct FileMode : u32 {
3939 /* File access modes for `open' and `fcntl'. */
4040 /// Open Read-only
41- const O_RDONLY = 0 ;
41+ const O_RDONLY = 0o0 ;
4242 /// Open Write-only
43- const O_WRONLY = 1 ;
43+ const O_WRONLY = 0o1 ;
4444 /// Open read/write
45- const O_RDWR = 2 ;
45+ const O_RDWR = 0o2 ;
4646 /// Mask for file access modes
47- const O_ACCMODE = 00000003 ;
47+ const O_ACCMODE = 0o00000003 ;
4848
4949 /* Bits OR'd into the second argument to open. */
5050 /// Create file if it does not exist
51- const O_CREAT = 00000100 ;
51+ const O_CREAT = 0o00000100 ;
5252 /// Fail if file already exists
53- const O_EXCL = 00000200 ;
53+ const O_EXCL = 0o00000200 ;
5454 /// Do not assign controlling terminal
55- const O_NOCTTY = 00000400 ;
55+ const O_NOCTTY = 0o00000400 ;
5656 /// 文件存在且是普通文件,并以O_RDWR或O_WRONLY打开,则它会被清空
57- const O_TRUNC = 00001000 ;
57+ const O_TRUNC = 0o00001000 ;
5858 /// 文件指针会被移动到文件末尾
59- const O_APPEND = 00002000 ;
59+ const O_APPEND = 0o00002000 ;
6060 /// 非阻塞式IO模式
61- const O_NONBLOCK = 00004000 ;
61+ const O_NONBLOCK = 0o00004000 ;
6262 /// used to be O_SYNC, see below
63- const O_DSYNC = 00010000 ;
63+ const O_DSYNC = 0o00010000 ;
6464 /// fcntl, for BSD compatibility
65- const FASYNC = 00020000 ;
65+ const FASYNC = 0o00020000 ;
6666 /* direct disk access hint */
67- const O_DIRECT = 00040000 ;
68- const O_LARGEFILE = 00100000 ;
67+ const O_DIRECT = 0o00040000 ;
68+ const O_LARGEFILE = 0o00100000 ;
6969 /// 打开的必须是一个目录
70- const O_DIRECTORY = 00200000 ;
70+ const O_DIRECTORY = 0o00200000 ;
7171 /// Do not follow symbolic links
72- const O_NOFOLLOW = 00400000 ;
73- const O_NOATIME = 01000000 ;
72+ const O_NOFOLLOW = 0o00400000 ;
73+ const O_NOATIME = 0o01000000 ;
7474 /// set close_on_exec
75- const O_CLOEXEC = 02000000 ;
75+ const O_CLOEXEC = 0o02000000 ;
7676 }
7777}
7878
0 commit comments