Skip to content

Commit

Permalink
Merge pull request #3840 from nathaniel-bennett/teeos-fix
Browse files Browse the repository at this point in the history
TEEOS: Fix octal notation for O_* constants
  • Loading branch information
tgross35 authored Aug 16, 2024
2 parents 509d9b3 + 724b1b4 commit 6eddffb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
36 changes: 18 additions & 18 deletions src/teeos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions src/unix/linux_like/linux/uclibc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions src/unix/linux_like/linux/uclibc/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,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;
Expand All @@ -320,7 +320,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")] {
Expand Down

0 comments on commit 6eddffb

Please sign in to comment.