Skip to content

Commit bca14be

Browse files
Add auxvec.h values to Linux
These values are universal across architectures, as they are defined primarily by the Linux UAPI. They are also echoed exactly by musl and glibc.
1 parent 506493d commit bca14be

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

libc-test/semver/linux.txt

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ AT_GID
167167
AT_HWCAP
168168
AT_HWCAP2
169169
AT_IGNORE
170+
AT_MINSIGSTKSZ
170171
AT_NOTELF
171172
AT_NO_AUTOMOUNT
172173
AT_NULL

src/unix/linux_like/linux/mod.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ pub type __s16 = ::c_short;
2222
pub type __u32 = ::c_uint;
2323
pub type __s32 = ::c_int;
2424

25+
// elf.h
26+
2527
pub type Elf32_Half = u16;
2628
pub type Elf32_Word = u32;
2729
pub type Elf32_Off = u32;
@@ -1638,7 +1640,8 @@ pub const PF_R: u32 = 1 << 2;
16381640
pub const PF_MASKOS: u32 = 0x0ff00000;
16391641
pub const PF_MASKPROC: u32 = 0xf0000000;
16401642

1641-
// elf.h - Legal values for a_type (entry type).
1643+
// keys to the values in the ELF auxiliary vector, usable with getauxval
1644+
// found at uapi/linux/auxvec.h in the kernel and elf/elf.h in musl and glibc
16421645
pub const AT_NULL: ::c_ulong = 0;
16431646
pub const AT_IGNORE: ::c_ulong = 1;
16441647
pub const AT_EXECFD: ::c_ulong = 2;
@@ -1666,9 +1669,13 @@ pub const AT_HWCAP2: ::c_ulong = 26;
16661669
pub const AT_EXECFN: ::c_ulong = 31;
16671670

16681671
// defined in arch/<arch>/include/uapi/asm/auxvec.h but has the same value
1669-
// wherever it is defined.
1672+
// wherever it is defined, and explicitly stated by glibc and musl
16701673
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
16711674

1675+
pub const AT_MINSIGSTKSZ: ::c_ulong = 51;
1676+
// getauxval AT_* values should be current for all "architecture-neutral" ones as of
1677+
// Linux headers: include/uapi/linux/auxvec.h kernel 6.1
1678+
16721679
pub const GLOB_ERR: ::c_int = 1 << 0;
16731680
pub const GLOB_MARK: ::c_int = 1 << 1;
16741681
pub const GLOB_NOSORT: ::c_int = 1 << 2;

0 commit comments

Comments
 (0)