Skip to content
Merged
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
9 changes: 1 addition & 8 deletions ci/docker/sparc64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
# FIXME(sparc): newer versions of Ubuntu get the following errors
# ```
# /prog: /lib/sparc64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /prog)
# /prog: /lib/sparc64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by /prog)
# ```
# Not sure if this is a problem from rustc, our libc, or Ubuntu so we just
# stick with an old LTS for now.
FROM ubuntu:22.04
FROM ubuntu:24.10

RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
Expand Down
4 changes: 2 additions & 2 deletions ci/linux-s390x.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ mkdir -m 777 /qemu
cd /qemu

curl --retry 5 -LO https://github.com/qemu/qemu/raw/HEAD/pc-bios/s390-ccw.img
curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20230607/images/generic/kernel.debian
curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20230607/images/generic/initrd.debian
curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20241227/images/generic/kernel.debian
curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20241227/images/generic/initrd.debian

mv kernel.debian kernel
mv initrd.debian initrd.gz
Expand Down
8 changes: 4 additions & 4 deletions ci/linux-sparc64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ set -eux
mkdir -m 777 /qemu
cd /qemu

curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/snapshots/2022-12-09/debian-11.0.0-sparc64-NETINST-1.iso
7z e debian-11.0.0-sparc64-NETINST-1.iso install/initrd.gz
7z e debian-11.0.0-sparc64-NETINST-1.iso install/vmlinux
curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/snapshots/2024-12-24/debian-12.0.0-sparc64-NETINST-1.iso
7z e debian-12.0.0-sparc64-NETINST-1.iso install/initrd.gz
7z e debian-12.0.0-sparc64-NETINST-1.iso install/vmlinux
mv vmlinux kernel
rm debian-11.0.0-sparc64-NETINST-1.iso
rm debian-12.0.0-sparc64-NETINST-1.iso

mkdir init
cd init
Expand Down
1 change: 0 additions & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ test_flags="--skip check_style"
case "$target" in
# Only run `libc-test`
# FIXME(android): unit tests fail to start on Android
# FIXME(s390x): unit tests fail to locate glibc
*android*) cmd="$cmd --manifest-path libc-test/Cargo.toml" ;;
*s390x*) cmd="$cmd --manifest-path libc-test/Cargo.toml" ;;
# For all other platforms, test everything in the workspace
Expand Down
35 changes: 34 additions & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4135,6 +4135,10 @@ fn test_linux(target: &str) {
// FIXME(linux): Requires >= 6.9 kernel headers.
"epoll_params" => true,

// FIXME(linux): Requires >= 6.12 kernel headers.
"dmabuf_cmsg" |
"dmabuf_token" => true,

_ => false,
}
});
Expand Down Expand Up @@ -4237,6 +4241,26 @@ fn test_linux(target: &str) {
{
return true;
}
// FIXME(musl): Not in musl yet
if name == "SO_NETNS_COOKIE"
|| name == "SO_BUF_LOCK"
|| name == "SO_RESERVE_MEM"
|| name == "SO_TXREHASH"
|| name == "SO_RCVMARK"
|| name == "SO_PASSPIDFD"
|| name == "SO_PEERPIDFD"
|| name == "SO_DEVMEM_LINEAR"
|| name == "SO_DEVMEM_DMABUF"
|| name == "SO_DEVMEM_DONTNEED"
{
return true;
}
// FIXME(musl): Not in musl yet
if name == "SCM_DEVMEM_LINEAR"
|| name == "SCM_DEVMEM_DMABUF"
{
return true;
}
}
match name {
// These constants are not available if gnu headers have been included
Expand All @@ -4255,7 +4279,9 @@ fn test_linux(target: &str) {
| "F_SEAL_SEAL"
| "F_SEAL_SHRINK"
| "F_SEAL_GROW"
| "F_SEAL_WRITE" => true,
| "F_SEAL_WRITE"
| "F_SEAL_FUTURE_WRITE"
| "F_SEAL_EXEC" => true,
// The `ARPHRD_CAN` is tested in the `linux_if_arp.rs` tests
// because including `linux/if_arp.h` causes some conflicts:
"ARPHRD_CAN" => true,
Expand Down Expand Up @@ -4534,6 +4560,13 @@ fn test_linux(target: &str) {
// FIXME(linux): Requires >= 6.12 kernel headers.
"SOF_TIMESTAMPING_OPT_RX_FILTER" => true,

// FIXME(linux): Requires >= 6.12 kernel headers.
"SO_DEVMEM_LINEAR"
| "SO_DEVMEM_DMABUF"
| "SO_DEVMEM_DONTNEED"
| "SCM_DEVMEM_LINEAR"
| "SCM_DEVMEM_DMABUF" => true,

_ => false,
}
});
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/android.txt
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ F_OFD_SETLK
F_OFD_SETLKW
F_OK
F_RDLCK
F_SEAL_EXEC
F_SEAL_GROW
F_SEAL_SEAL
F_SEAL_SHRINK
Expand Down
13 changes: 13 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ F_OFD_GETLK
F_OFD_SETLK
F_OFD_SETLKW
F_RDLCK
F_SEAL_EXEC
F_SEAL_FUTURE_WRITE
F_SEAL_GROW
F_SEAL_SEAL
Expand Down Expand Up @@ -2647,6 +2648,8 @@ SCHED_OTHER
SCHED_RESET_ON_FORK
SCHED_RR
SCM_CREDENTIALS
SCM_DEVMEM_DMABUF
SCM_DEVMEM_LINEAR
SCM_J1939_DEST_ADDR
SCM_J1939_DEST_NAME
SCM_J1939_ERRQUEUE
Expand Down Expand Up @@ -2953,8 +2956,12 @@ SOL_X25
SOL_XDP
SOMAXCONN
SO_BINDTODEVICE
SO_BUF_LOCK
SO_BUSY_POLL
SO_BUSY_POLL_BUDGET
SO_DEVMEM_DMABUF
SO_DEVMEM_DONTNEED
SO_DEVMEM_LINEAR
SO_DOMAIN
SO_EE_OFFENDER
SO_EE_ORIGIN_ICMP
Expand All @@ -2968,20 +2975,26 @@ SO_J1939_FILTER
SO_J1939_PROMISC
SO_J1939_SEND_PRIO
SO_MARK
SO_NETNS_COOKIE
SO_ORIGINAL_DST
SO_PASSCRED
SO_PASSPIDFD
SO_PASSSEC
SO_PEEK_OFF
SO_PEERCRED
SO_PEERPIDFD
SO_PEERSEC
SO_PREFER_BUSY_POLL
SO_RCVBUFFORCE
SO_RCVMARK
SO_RESERVE_MEM
SO_REUSEPORT
SO_RXQ_OVFL
SO_SNDBUFFORCE
SO_TIMESTAMP
SO_TIMESTAMPING
SO_TIMESTAMPNS
SO_TXREHASH
SPLICE_F_GIFT
SPLICE_F_MORE
SPLICE_F_MOVE
Expand Down
21 changes: 21 additions & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,12 @@ s! {
pub ctl_id: u32,
pub ctl_name: [c_char; MAX_KCTL_NAME],
}

// sys/proc_info.h
pub struct proc_fdinfo {
pub proc_fd: i32,
pub proc_fdtype: u32,
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -5139,6 +5145,21 @@ pub const PROC_PIDTASKINFO: c_int = 4;
pub const PROC_PIDTHREADINFO: c_int = 5;
pub const PROC_PIDVNODEPATHINFO: c_int = 9;
pub const PROC_PIDPATHINFO_MAXSIZE: c_int = 4096;

pub const PROC_PIDLISTFDS: c_int = 1;
pub const PROC_PIDLISTFD_SIZE: c_int = mem::size_of::<proc_fdinfo>() as c_int;
pub const PROX_FDTYPE_ATALK: c_int = 0;
pub const PROX_FDTYPE_VNODE: c_int = 1;
pub const PROX_FDTYPE_SOCKET: c_int = 2;
pub const PROX_FDTYPE_PSHM: c_int = 3;
pub const PROX_FDTYPE_PSEM: c_int = 4;
pub const PROX_FDTYPE_KQUEUE: c_int = 5;
pub const PROX_FDTYPE_PIPE: c_int = 6;
pub const PROX_FDTYPE_FSEVENTS: c_int = 7;
pub const PROX_FDTYPE_NETPOLICY: c_int = 9;
pub const PROX_FDTYPE_CHANNEL: c_int = 10;
pub const PROX_FDTYPE_NEXUS: c_int = 11;

pub const PROC_CSM_ALL: c_uint = 0x0001;
pub const PROC_CSM_NOSMT: c_uint = 0x0002;
pub const PROC_CSM_TECS: c_uint = 0x0004;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,7 @@ pub const F_TLOCK: c_int = 2;
pub const F_ULOCK: c_int = 0;

pub const F_SEAL_FUTURE_WRITE: c_int = 0x0010;
pub const F_SEAL_EXEC: c_int = 0x0020;

pub const IFF_LOWER_UP: c_int = 0x10000;
pub const IFF_DORMANT: c_int = 0x20000;
Expand Down
13 changes: 13 additions & 0 deletions src/unix/linux_like/linux/arch/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ cfg_if! {
}
pub const SO_PREFER_BUSY_POLL: c_int = 69;
pub const SO_BUSY_POLL_BUDGET: c_int = 70;
pub const SO_NETNS_COOKIE: c_int = 71;
pub const SO_BUF_LOCK: c_int = 72;
pub const SO_RESERVE_MEM: c_int = 73;
pub const SO_TXREHASH: c_int = 74;
pub const SO_RCVMARK: c_int = 75;
pub const SO_PASSPIDFD: c_int = 76;
pub const SO_PEERPIDFD: c_int = 77;
pub const SO_DEVMEM_LINEAR: c_int = 78;
pub const SO_DEVMEM_DMABUF: c_int = 79;
pub const SO_DEVMEM_DONTNEED: c_int = 80;

cfg_if! {
if #[cfg(any(
Expand All @@ -169,6 +179,9 @@ cfg_if! {
pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS;
pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING;

pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;

// Ioctl Constants

pub const TCGETS: Ioctl = 0x5401;
Expand Down
13 changes: 13 additions & 0 deletions src/unix/linux_like/linux/arch/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ cfg_if! {
// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68;
pub const SO_PREFER_BUSY_POLL: c_int = 69;
pub const SO_BUSY_POLL_BUDGET: c_int = 70;
pub const SO_NETNS_COOKIE: c_int = 71;
pub const SO_BUF_LOCK: c_int = 72;
pub const SO_RESERVE_MEM: c_int = 73;
pub const SO_TXREHASH: c_int = 74;
pub const SO_RCVMARK: c_int = 75;
pub const SO_PASSPIDFD: c_int = 76;
pub const SO_PEERPIDFD: c_int = 77;
pub const SO_DEVMEM_LINEAR: c_int = 78;
pub const SO_DEVMEM_DMABUF: c_int = 79;
pub const SO_DEVMEM_DONTNEED: c_int = 80;

pub const FICLONE: c_ulong = 0x80049409;
pub const FICLONERANGE: c_ulong = 0x8020940D;
Expand All @@ -129,6 +139,9 @@ pub const FICLONERANGE: c_ulong = 0x8020940D;
pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS;
pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING;

pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;

// Ioctl Constants

pub const TCGETS: Ioctl = 0x540d;
Expand Down
13 changes: 13 additions & 0 deletions src/unix/linux_like/linux/arch/powerpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ const SO_SNDTIMEO_NEW: c_int = 67;
// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68;
pub const SO_PREFER_BUSY_POLL: c_int = 69;
pub const SO_BUSY_POLL_BUDGET: c_int = 70;
pub const SO_NETNS_COOKIE: c_int = 71;
pub const SO_BUF_LOCK: c_int = 72;
pub const SO_RESERVE_MEM: c_int = 73;
pub const SO_TXREHASH: c_int = 74;
pub const SO_RCVMARK: c_int = 75;
pub const SO_PASSPIDFD: c_int = 76;
pub const SO_PEERPIDFD: c_int = 77;
pub const SO_DEVMEM_LINEAR: c_int = 78;
pub const SO_DEVMEM_DMABUF: c_int = 79;
pub const SO_DEVMEM_DONTNEED: c_int = 80;

pub const FICLONE: c_ulong = 0x80049409;
pub const FICLONERANGE: c_ulong = 0x8020940D;
Expand All @@ -111,6 +121,9 @@ pub const FICLONERANGE: c_ulong = 0x8020940D;
pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS;
pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING;

pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;

// Ioctl Constants

cfg_if! {
Expand Down
13 changes: 13 additions & 0 deletions src/unix/linux_like/linux/arch/sparc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,25 @@ pub const SO_TIMESTAMPING: c_int = 0x0023;
// pub const SO_DETACH_REUSEPORT_BPF: c_int = 0x0047;
pub const SO_PREFER_BUSY_POLL: c_int = 0x0048;
pub const SO_BUSY_POLL_BUDGET: c_int = 0x0049;
pub const SO_NETNS_COOKIE: c_int = 0x0050;
pub const SO_BUF_LOCK: c_int = 0x0051;
pub const SO_RESERVE_MEM: c_int = 0x0052;
pub const SO_TXREHASH: c_int = 0x0053;
pub const SO_RCVMARK: c_int = 0x0054;
pub const SO_PASSPIDFD: c_int = 0x0055;
pub const SO_PEERPIDFD: c_int = 0x0056;
pub const SO_DEVMEM_LINEAR: c_int = 0x0057;
pub const SO_DEVMEM_DMABUF: c_int = 0x0058;
pub const SO_DEVMEM_DONTNEED: c_int = 0x0059;

// Defined in unix/linux_like/mod.rs
// pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP;
pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS;
pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING;

pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;

// Ioctl Constants

pub const TCGETS: Ioctl = 0x40245408;
Expand Down
6 changes: 4 additions & 2 deletions src/unix/linux_like/linux/gnu/b64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ s! {
target_arch = "mips64r6",
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "sparc64"
target_arch = "sparc64",
target_arch = "s390x",
)))]
__reserved: crate::__syscall_ulong_t,
pub sem_ctime: crate::time_t,
Expand All @@ -88,7 +89,8 @@ s! {
target_arch = "mips64r6",
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "sparc64"
target_arch = "sparc64",
target_arch = "s390x",
)))]
__reserved2: crate::__syscall_ulong_t,
pub sem_nsems: crate::__syscall_ulong_t,
Expand Down
16 changes: 16 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,21 @@ s! {
pub propagation: crate::__u64,
pub userns_fd: crate::__u64,
}

// linux/uio.h

pub struct dmabuf_cmsg {
pub frag_offset: crate::__u64,
pub frag_size: crate::__u32,
pub frag_token: crate::__u32,
pub dmabuf_id: crate::__u32,
pub flags: crate::__u32,
}

pub struct dmabuf_token {
pub token_start: crate::__u32,
pub token_count: crate::__u32,
}
}

cfg_if! {
Expand Down Expand Up @@ -2770,6 +2785,7 @@ pub const F_TLOCK: c_int = 2;
pub const F_ULOCK: c_int = 0;

pub const F_SEAL_FUTURE_WRITE: c_int = 0x0010;
pub const F_SEAL_EXEC: c_int = 0x0020;

pub const IFF_LOWER_UP: c_int = 0x10000;
pub const IFF_DORMANT: c_int = 0x20000;
Expand Down
Loading