summaryrefslogtreecommitdiff
path: root/src/unix/linux_like
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-01-20 02:26:41 +0000
committerbors <bors@rust-lang.org>2022-01-20 02:26:41 +0000
commitcf597c2d6f60ea85178fd5851c9d7ba223bf1e17 (patch)
treee199e77f558256a6c6768ad94f28829ec34a6d1a /src/unix/linux_like
parentf617891e4056da317168d2b46721c9bb7d495a23 (diff)
parent0fcf5b32c5abe9d69bcb8166457e2ae24addfc8c (diff)
downloadrust-libc-cf597c2d6f60ea85178fd5851c9d7ba223bf1e17.tar.gz
Auto merge of #2636 - skrap:master, r=Amanieu0.2.113
uclibc: fix O_TMPFILE value, hide some unused fields to fix libc-test This was a bit of a yak-shave. First, O_TMPFILE was wrong because 020000000 is decimal, not octal. :facepalm: This was, of course, causing all sorts of things to be horrible. That led me to switch to a newer toolchain which actually defined O_TMPFILE, so that the libc tests pass on `armv7-unknown-linux-uclibceabihf`. That revealed that certain field names had changed since the last time I ran the libc tests on this architecture, which revealed that some struct fields (e.g. `__unused`) were being marked as `pub` where all other architectures left them as private. So, this patch might seem somewhat sprawling, but without all of these changes it's not possible to run libc-test! To test: * get https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--bleeding-edge-2021.11-1.tar.bz2 * unpack somewhere, and call that `$TOOLCHAIN` ``` cd libc-test PATH=$TOOLCHAIN/bin:$PATH \ CC_armv7_unknown_linux_uclibc=armv7-buildroot-linux-uclibc-gcc \ CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_LINKER=armv7-buildroot-linux-uclibc-gcc \ CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_RUNNER="qemu-arm -L $TOOLCHAIN/arm-buildroot-linux-uclibcgnueabihf/sysroot/" \ cargo +nightly test --target armv7-unknown-linux-uclibceabihf -Zbuild-std=core,std ```
Diffstat (limited to 'src/unix/linux_like')
-rw-r--r--src/unix/linux_like/linux/uclibc/arm/mod.rs38
-rw-r--r--src/unix/linux_like/linux/uclibc/mod.rs2
2 files changed, 20 insertions, 20 deletions
diff --git a/src/unix/linux_like/linux/uclibc/arm/mod.rs b/src/unix/linux_like/linux/uclibc/arm/mod.rs
index dc84b0c054..c1008a48f6 100644
--- a/src/unix/linux_like/linux/uclibc/arm/mod.rs
+++ b/src/unix/linux_like/linux/uclibc/arm/mod.rs
@@ -44,14 +44,14 @@ s! {
pub struct stat {
pub st_dev: ::c_ulonglong,
- pub __pad1: ::c_ushort,
+ __pad1: ::c_ushort,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::c_ulonglong,
- pub __pad2: ::c_ushort,
+ __pad2: ::c_ushort,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
@@ -61,8 +61,8 @@ s! {
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
- pub __unused4: ::c_ulong,
- pub __unused5: ::c_ulong,
+ __unused4: ::c_ulong,
+ __unused5: ::c_ulong,
}
pub struct stat64
@@ -202,44 +202,44 @@ s! {
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::c_ushort,
- pub __pad1: ::c_ushort,
+ __pad1: ::c_ushort,
pub __seq: ::c_ushort,
- pub __pad2: ::c_ushort,
- pub __unused1: ::c_ulong,
- pub __unused2: ::c_ulong,
+ __pad2: ::c_ushort,
+ __unused1: ::c_ulong,
+ __unused2: ::c_ulong,
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
pub msg_stime: ::time_t,
- pub __unused1: ::c_ulong,
+ __unused1: ::c_ulong,
pub msg_rtime: ::time_t,
- pub __unused2: ::c_ulong,
+ __unused2: ::c_ulong,
pub msg_ctime: ::time_t,
- pub __unused3: ::c_ulong,
- pub __msg_cbytes: ::c_ulong,
+ __unused3: ::c_ulong,
+ __msg_cbytes: ::c_ulong,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
- pub __unused4: ::c_ulong,
- pub __unused5: ::c_ulong,
+ __unused4: ::c_ulong,
+ __unused5: ::c_ulong,
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_atime: ::time_t,
- pub __unused1: ::c_ulong,
+ __unused1: ::c_ulong,
pub shm_dtime: ::time_t,
- pub __unused2: ::c_ulong,
+ __unused2: ::c_ulong,
pub shm_ctime: ::time_t,
- pub __unused3: ::c_ulong,
+ __unused3: ::c_ulong,
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
- pub __unused4: ::c_ulong,
- pub __unused5: ::c_ulong,
+ __unused4: ::c_ulong,
+ __unused5: ::c_ulong,
}
}
diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs
index e25a6bfb48..8f23826f29 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 MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT;
pub const MINSIGSTKSZ: ::c_int = 2048;
pub const MSG_COPY: ::c_int = 040000;
pub const NI_MAXHOST: ::socklen_t = 1025;
-pub const O_TMPFILE: ::c_int = 020000000 | O_DIRECTORY;
+pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const PACKET_MR_UNICAST: ::c_int = 3;
pub const PF_NFC: ::c_int = 39;
pub const PF_VSOCK: ::c_int = 40;