diff options
author | bors <bors@rust-lang.org> | 2022-12-11 02:31:05 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2022-12-11 02:31:05 +0000 |
commit | 6a5c07f70603c7d28464a92964fc02c81d0c1e31 (patch) | |
tree | ce02d1c6d9b6a50555e582be34bbedec694ef76a | |
parent | 8ccb82892fa6d2ea6630ae19de419e61cebf7974 (diff) | |
parent | ce9ab41088a38ce82c7eddd69f39aa69fe745674 (diff) | |
download | rust-libc-6a5c07f70603c7d28464a92964fc02c81d0c1e31.tar.gz |
Auto merge of #3027 - Phantomical:auxval, r=JohnTitor
linux: Add AT_SYSINFO_EHDR constant
When passed to [`getauxval(3)`][2] this is used to retrieve the base address of the vdso mapped into the current process. It is defined the architecture specific `auxvec.h` headers but [it is defined to the same value in all of them][1] so I've put it in `src/unix/linux_like/linux/mod.rs` instead of in the arch submodule.
[1]: https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/torvalds/linux%24+%23define+AT_SYSINFO_EHDR&patternType=standard&sm=1
[2]: https://man7.org/linux/man-pages/man3/getauxval.3.html
-rw-r--r-- | libc-test/semver/linux.txt | 1 | ||||
-rw-r--r-- | src/unix/linux_like/linux/mod.rs | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index a40a31caf9..087b1fc10c 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -181,6 +181,7 @@ AT_SECURE AT_SYMLINK_FOLLOW AT_SYMLINK_NOFOLLOW AT_UID +AT_SYSINFO_EHDR B1000000 B1152000 B1500000 diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 947aca87bc..743927e517 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1583,6 +1583,10 @@ pub const AT_HWCAP2: ::c_ulong = 26; pub const AT_EXECFN: ::c_ulong = 31; +// defined in arch/<arch>/include/uapi/asm/auxvec.h but has the same value +// wherever it is defined. +pub const AT_SYSINFO_EHDR: ::c_ulong = 33; + pub const GLOB_ERR: ::c_int = 1 << 0; pub const GLOB_MARK: ::c_int = 1 << 1; pub const GLOB_NOSORT: ::c_int = 1 << 2; |