From f0045dacf963698c21cd1b6023af94d5f280412e Mon Sep 17 00:00:00 2001 From: Nathaniel Date: Fri, 16 Aug 2024 14:59:45 -0400 Subject: [PATCH] TEEOS: Fix octal notation for O_* constants (cherry picked from commit 724b1b47a432fc9448068c2163bfeda422ff41b5) --- src/teeos/mod.rs | 36 +++++++++---------- src/unix/linux_like/linux/uclibc/mod.rs | 6 ++-- .../linux_like/linux/uclibc/x86_64/mod.rs | 14 ++++---- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/teeos/mod.rs b/src/teeos/mod.rs index 25e06ffaa3b10..4f1fef110dd93 100644 --- a/src/teeos/mod.rs +++ b/src/teeos/mod.rs @@ -177,41 +177,41 @@ pub struct div_t { } // fcntl -pub const O_CREAT: u32 = 0100; +pub const O_CREAT: u32 = 0o100; -pub const O_EXCL: u32 = 0200; +pub const O_EXCL: u32 = 0o200; -pub const O_NOCTTY: u32 = 0400; +pub const O_NOCTTY: u32 = 0o400; -pub const O_TRUNC: u32 = 01000; +pub const O_TRUNC: u32 = 0o1000; -pub const O_APPEND: u32 = 02000; +pub const O_APPEND: u32 = 0o2000; -pub const O_NONBLOCK: u32 = 04000; +pub const O_NONBLOCK: u32 = 0o4000; -pub const O_DSYNC: u32 = 010000; +pub const O_DSYNC: u32 = 0o10000; -pub const O_SYNC: u32 = 04010000; +pub const O_SYNC: u32 = 0o4010000; -pub const O_RSYNC: u32 = 04010000; +pub const O_RSYNC: u32 = 0o4010000; -pub const O_DIRECTORY: u32 = 0200000; +pub const O_DIRECTORY: u32 = 0o200000; -pub const O_NOFOLLOW: u32 = 0400000; +pub const O_NOFOLLOW: u32 = 0o400000; -pub const O_CLOEXEC: u32 = 02000000; +pub const O_CLOEXEC: u32 = 0o2000000; -pub const O_ASYNC: u32 = 020000; +pub const O_ASYNC: u32 = 0o20000; -pub const O_DIRECT: u32 = 040000; +pub const O_DIRECT: u32 = 0o40000; -pub const O_LARGEFILE: u32 = 0100000; +pub const O_LARGEFILE: u32 = 0o100000; -pub const O_NOATIME: u32 = 01000000; +pub const O_NOATIME: u32 = 0o1000000; -pub const O_PATH: u32 = 010000000; +pub const O_PATH: u32 = 0o10000000; -pub const O_TMPFILE: u32 = 020200000; +pub const O_TMPFILE: u32 = 0o20200000; pub const O_NDELAY: u32 = O_NONBLOCK; diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs index 637b5285a2c03..b8d10cb94595f 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -303,7 +303,7 @@ pub const BUFSIZ: ::c_int = 4096; pub const EDEADLOCK: ::c_int = EDEADLK; pub const EXTA: ::c_uint = B19200; pub const EXTB: ::c_uint = B38400; -pub const EXTPROC: ::tcflag_t = 0200000; +pub const EXTPROC: ::tcflag_t = 0o200000; pub const FOPEN_MAX: ::c_int = 16; pub const F_GETOWN: ::c_int = 9; pub const F_OFD_GETLK: ::c_int = 36; @@ -330,7 +330,7 @@ pub const MAP_HUGE_1GB: ::c_int = 30 << MAP_HUGE_SHIFT; pub const MAP_HUGE_2GB: ::c_int = 31 << MAP_HUGE_SHIFT; pub const MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT; pub const MINSIGSTKSZ: ::c_int = 2048; -pub const MSG_COPY: ::c_int = 040000; +pub const MSG_COPY: ::c_int = 0o40000; pub const NI_MAXHOST: ::socklen_t = 1025; pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; pub const PACKET_MR_UNICAST: ::c_int = 3; @@ -343,7 +343,7 @@ pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209; pub const PTRACE_SETSIGMASK: ::c_uint = 0x420b; pub const RTLD_NOLOAD: ::c_int = 0x00004; pub const RUSAGE_THREAD: ::c_int = 1; -pub const SHM_EXEC: ::c_int = 0100000; +pub const SHM_EXEC: ::c_int = 0o100000; pub const SIGPOLL: ::c_int = SIGIO; pub const SOCK_DCCP: ::c_int = 6; pub const SOCK_PACKET: ::c_int = 10; diff --git a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs index 390119e3b5091..c504202f6d984 100644 --- a/src/unix/linux_like/linux/uclibc/x86_64/mod.rs +++ b/src/unix/linux_like/linux/uclibc/x86_64/mod.rs @@ -311,15 +311,15 @@ pub const EHOSTUNREACH: ::c_int = 113; // No route to host pub const EDQUOT: ::c_int = 122; // Quota exceeded pub const EOPNOTSUPP: ::c_int = 0x5f; pub const ENODATA: ::c_int = 0x3d; -pub const O_APPEND: ::c_int = 02000; -pub const O_ACCMODE: ::c_int = 0003; +pub const O_APPEND: ::c_int = 0o2000; +pub const O_ACCMODE: ::c_int = 0o003; pub const O_CLOEXEC: ::c_int = 0x80000; pub const O_CREAT: ::c_int = 0100; -pub const O_DIRECTORY: ::c_int = 0200000; -pub const O_EXCL: ::c_int = 0200; +pub const O_DIRECTORY: ::c_int = 0o200000; +pub const O_EXCL: ::c_int = 0o200; pub const O_NOFOLLOW: ::c_int = 0x20000; -pub const O_NONBLOCK: ::c_int = 04000; -pub const O_TRUNC: ::c_int = 01000; +pub const O_NONBLOCK: ::c_int = 0o4000; +pub const O_TRUNC: ::c_int = 0o1000; pub const NCCS: usize = 32; pub const SIG_SETMASK: ::c_int = 2; // Set the set of blocked signals pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; @@ -332,7 +332,7 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; -pub const PIDFD_NONBLOCK: ::c_int = 04000; +pub const PIDFD_NONBLOCK: ::c_int = 0o4000; cfg_if! { if #[cfg(target_os = "l4re")] {