Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libc-test/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2102,6 +2102,7 @@ fn test_android(t: &Target) {
"linux/if_link.h",
"linux/rtnetlink.h",
"linux/if_tun.h",
"linux/kcmp.h",
"linux/kexec.h",
"linux/magic.h",
"linux/membarrier.h",
Expand Down Expand Up @@ -3995,6 +3996,7 @@ fn test_linux(t: &Target) {
"libgen.h",
"limits.h",
"link.h",
(!l4re, "linux/kcmp.h"),
(!l4re, "linux/sysctl.h"),
"locale.h",
"malloc.h",
Expand Down
9 changes: 9 additions & 0 deletions libc-test/semver/android.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,15 @@ IXANY
IXOFF
IXON
JFFS2_SUPER_MAGIC
KCMP_EPOLL_TFD
KCMP_FILE
KCMP_FILES
KCMP_FS
KCMP_IO
KCMP_SIGHAND
KCMP_SYSVSEM
KCMP_TYPES
KCMP_VM
KEXEC_ARCH_MASK
KEXEC_FILE_NO_INITRAMFS
KEXEC_FILE_ON_CRASH
Expand Down
9 changes: 9 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,15 @@ J1939_PGN_ADDRESS_COMMANDED
J1939_PGN_MAX
J1939_PGN_PDU1_MAX
J1939_PGN_REQUEST
KCMP_EPOLL_TFD
KCMP_FILE
KCMP_FILES
KCMP_FS
KCMP_IO
KCMP_SIGHAND
KCMP_SYSVSEM
KCMP_TYPES
KCMP_VM
KERNEL_VERSION
KEXEC_ARCH_MASK
KEXEC_FILE_NO_INITRAMFS
Expand Down
11 changes: 11 additions & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3433,6 +3433,17 @@ pub const _PATH_DEFPATH: *const c_char = cstr!(
);
pub const _PATH_BSHELL: *const c_char = cstr!("/system/bin/sh");

// linux/kcmp.h
pub const KCMP_FILE: c_int = 0;
pub const KCMP_VM: c_int = 1;
pub const KCMP_FILES: c_int = 2;
pub const KCMP_FS: c_int = 3;
pub const KCMP_SIGHAND: c_int = 4;
pub const KCMP_IO: c_int = 5;
pub const KCMP_SYSVSEM: c_int = 6;
pub const KCMP_EPOLL_TFD: c_int = 7;
pub const KCMP_TYPES: c_int = 8;

// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
// following are only available on newer Linux versions than the versions
// currently used in CI in some configurations, so we define them here.
Expand Down
11 changes: 11 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3351,6 +3351,17 @@ pub const EPIOCGPARAMS: Ioctl = _IOR::<epoll_params>(EPOLL_IOC_TYPE, 0x02);
pub const SI_DETHREAD: c_int = -7;
pub const TRAP_PERF: c_int = 6;

// linux/kcmp.h
pub const KCMP_FILE: c_int = 0;
pub const KCMP_VM: c_int = 1;
pub const KCMP_FILES: c_int = 2;
pub const KCMP_FS: c_int = 3;
pub const KCMP_SIGHAND: c_int = 4;
pub const KCMP_IO: c_int = 5;
pub const KCMP_SYSVSEM: c_int = 6;
pub const KCMP_EPOLL_TFD: c_int = 7;
pub const KCMP_TYPES: c_int = 8;

f! {
pub unsafe fn SO_EE_OFFENDER(ee: *const crate::sock_extended_err) -> *mut crate::sockaddr {
ee.offset(1) as *mut crate::sockaddr
Expand Down
Loading