Skip to content

Commit

Permalink
Merge pull request #4082 from tgross35/backport-fennel
Browse files Browse the repository at this point in the history
[0.2] Backports
  • Loading branch information
tgross35 authored Nov 17, 2024
2 parents 643aff5 + 7c7d9c4 commit 9b870d4
Show file tree
Hide file tree
Showing 15 changed files with 98 additions and 28 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ lio_listio
mallinfo
mallinfo2
malloc_info
malloc_stats
malloc_trim
malloc_usable_size
mallopt
Expand Down
12 changes: 12 additions & 0 deletions libc-test/semver/redox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,19 @@ EUSERS
EXFULL
FIONREAD
IMAXBEL
IPPROTO_ICMP
IPPROTO_IDP
IPPROTO_IGMP
IPPROTO_IP
IPPROTO_IPV6
IPPROTO_MAX
IPPROTO_PUP
IPPROTO_TCP
IPPROTO_UDP
IPV6_ADD_MEMBERSHIP
IPV6_DROP_MEMBERSHIP
IP_RECVTOS
IP_TOS
IUCLC
IUTF8
MADV_DONTNEED
Expand Down Expand Up @@ -129,6 +140,7 @@ SIGPWR
SIGSTKFLT
SOCK_CLOEXEC
SOCK_NONBLOCK
SOCK_RAW
SO_BSDCOMPAT
SO_DOMAIN
SO_NO_CHECK
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ accept
access
aligned_free
aligned_malloc
aligned_realloc
atexit
atof
atoi
Expand Down
3 changes: 2 additions & 1 deletion src/unix/linux_like/linux/gnu/b32/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ s! {

pub f_namelen: ::__fsword_t,
pub f_frsize: ::__fsword_t,
f_spare: [::__fsword_t; 5],
pub f_flags: ::__fsword_t,
f_spare: [::__fsword_t; 4],
}

pub struct flock {
Expand Down
3 changes: 2 additions & 1 deletion src/unix/linux_like/linux/gnu/b32/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ s! {
pub f_fsid: ::fsid_t,

pub f_namelen: ::c_long,
f_spare: [::c_long; 6],
pub f_flags: ::c_long,
f_spare: [::c_long; 5],
}

pub struct statfs64 {
Expand Down
3 changes: 2 additions & 1 deletion src/unix/linux_like/linux/gnu/b32/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ s! {

pub f_namelen: ::__fsword_t,
pub f_frsize: ::__fsword_t,
f_spare: [::__fsword_t; 5],
pub f_flags: ::__fsword_t,
f_spare: [::__fsword_t; 4],
}

pub struct flock {
Expand Down
3 changes: 2 additions & 1 deletion src/unix/linux_like/linux/gnu/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ s! {

pub f_namelen: ::__fsword_t,
pub f_frsize: ::__fsword_t,
f_spare: [::__fsword_t; 5],
pub f_flags: ::__fsword_t,
f_spare: [::__fsword_t; 4],
}

pub struct flock {
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,7 @@ extern "C" {
pub fn pthread_sigqueue(thread: ::pthread_t, sig: ::c_int, value: ::sigval) -> ::c_int;
pub fn mallinfo() -> ::mallinfo;
pub fn mallinfo2() -> ::mallinfo2;
pub fn malloc_stats();
pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int;
pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
pub fn getpwent_r(
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,8 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
pub const SYS_statx: ::c_long = 291;
pub const SYS_io_pgetevents: ::c_long = 292;
pub const SYS_rseq: ::c_long = 293;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
Expand Down
16 changes: 16 additions & 0 deletions src/unix/linux_like/linux/musl/b64/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,22 @@ pub const SYS_preadv2: ::c_long = 380;
pub const SYS_pwritev2: ::c_long = 381;
pub const SYS_kexec_file_load: ::c_long = 382;
pub const SYS_statx: ::c_long = 383;
pub const SYS_pkey_alloc: ::c_long = 384;
pub const SYS_pkey_free: ::c_long = 385;
pub const SYS_pkey_mprotect: ::c_long = 386;
pub const SYS_rseq: ::c_long = 387;
pub const SYS_io_pgetevents: ::c_long = 388;
pub const SYS_semtimedop: ::c_long = 392;
pub const SYS_semget: ::c_long = 393;
pub const SYS_semctl: ::c_long = 394;
pub const SYS_shmget: ::c_long = 395;
pub const SYS_shmctl: ::c_long = 396;
pub const SYS_shmat: ::c_long = 397;
pub const SYS_shmdt: ::c_long = 398;
pub const SYS_msgget: ::c_long = 399;
pub const SYS_msgsnd: ::c_long = 400;
pub const SYS_msgrcv: ::c_long = 401;
pub const SYS_msgctl: ::c_long = 402;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
pub const SYS_statx: ::c_long = 291;
pub const SYS_io_pgetevents: ::c_long = 292;
pub const SYS_rseq: ::c_long = 293;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
Expand Down
67 changes: 43 additions & 24 deletions src/unix/linux_like/linux/musl/b64/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ pub const SYS_sysfs: ::c_long = 135;
pub const SYS_personality: ::c_long = 136;
pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */
pub const SYS_getdents: ::c_long = 141;
pub const SYS_select: ::c_long = 142;
pub const SYS_flock: ::c_long = 143;
pub const SYS_msync: ::c_long = 144;
pub const SYS_readv: ::c_long = 145;
Expand Down Expand Up @@ -517,6 +518,26 @@ pub const SYS_sendfile: ::c_long = 187;
pub const SYS_getpmsg: ::c_long = 188;
pub const SYS_putpmsg: ::c_long = 189;
pub const SYS_vfork: ::c_long = 190;
pub const SYS_getrlimit: ::c_long = 191;
pub const SYS_lchown: ::c_long = 198;
pub const SYS_getuid: ::c_long = 199;
pub const SYS_getgid: ::c_long = 200;
pub const SYS_geteuid: ::c_long = 201;
pub const SYS_getegid: ::c_long = 202;
pub const SYS_setreuid: ::c_long = 203;
pub const SYS_setregid: ::c_long = 204;
pub const SYS_getgroups: ::c_long = 205;
pub const SYS_setgroups: ::c_long = 206;
pub const SYS_fchown: ::c_long = 207;
pub const SYS_setresuid: ::c_long = 208;
pub const SYS_getresuid: ::c_long = 209;
pub const SYS_setresgid: ::c_long = 210;
pub const SYS_getresgid: ::c_long = 211;
pub const SYS_chown: ::c_long = 212;
pub const SYS_setuid: ::c_long = 213;
pub const SYS_setgid: ::c_long = 214;
pub const SYS_setfsuid: ::c_long = 215;
pub const SYS_setfsgid: ::c_long = 216;
pub const SYS_pivot_root: ::c_long = 217;
pub const SYS_mincore: ::c_long = 218;
pub const SYS_madvise: ::c_long = 219;
Expand Down Expand Up @@ -588,6 +609,7 @@ pub const SYS_mkdirat: ::c_long = 289;
pub const SYS_mknodat: ::c_long = 290;
pub const SYS_fchownat: ::c_long = 291;
pub const SYS_futimesat: ::c_long = 292;
pub const SYS_newfstatat: ::c_long = 293;
pub const SYS_unlinkat: ::c_long = 294;
pub const SYS_renameat: ::c_long = 295;
pub const SYS_linkat: ::c_long = 296;
Expand Down Expand Up @@ -672,29 +694,26 @@ pub const SYS_mlock2: ::c_long = 374;
pub const SYS_copy_file_range: ::c_long = 375;
pub const SYS_preadv2: ::c_long = 376;
pub const SYS_pwritev2: ::c_long = 377;
pub const SYS_lchown: ::c_long = 198;
pub const SYS_setuid: ::c_long = 213;
pub const SYS_getuid: ::c_long = 199;
pub const SYS_setgid: ::c_long = 214;
pub const SYS_getgid: ::c_long = 200;
pub const SYS_geteuid: ::c_long = 201;
pub const SYS_setreuid: ::c_long = 203;
pub const SYS_setregid: ::c_long = 204;
pub const SYS_getrlimit: ::c_long = 191;
pub const SYS_getgroups: ::c_long = 205;
pub const SYS_fchown: ::c_long = 207;
pub const SYS_setresuid: ::c_long = 208;
pub const SYS_setresgid: ::c_long = 210;
pub const SYS_getresgid: ::c_long = 211;
pub const SYS_select: ::c_long = 142;
pub const SYS_getegid: ::c_long = 202;
pub const SYS_setgroups: ::c_long = 206;
pub const SYS_getresuid: ::c_long = 209;
pub const SYS_chown: ::c_long = 212;
pub const SYS_setfsuid: ::c_long = 215;
pub const SYS_setfsgid: ::c_long = 216;
pub const SYS_newfstatat: ::c_long = 293;
pub const SYS_s390_guarded_storage: ::c_long = 378;
pub const SYS_statx: ::c_long = 379;
pub const SYS_s390_sthyi: ::c_long = 380;
pub const SYS_kexec_file_load: ::c_long = 381;
pub const SYS_io_pgetevents: ::c_long = 382;
pub const SYS_rseq: ::c_long = 383;
pub const SYS_pkey_mprotect: ::c_long = 384;
pub const SYS_pkey_alloc: ::c_long = 385;
pub const SYS_pkey_free: ::c_long = 386;
pub const SYS_semtimedop: ::c_long = 392;
pub const SYS_semget: ::c_long = 393;
pub const SYS_semctl: ::c_long = 394;
pub const SYS_shmget: ::c_long = 395;
pub const SYS_shmctl: ::c_long = 396;
pub const SYS_shmat: ::c_long = 397;
pub const SYS_shmdt: ::c_long = 398;
pub const SYS_msgget: ::c_long = 399;
pub const SYS_msgsnd: ::c_long = 400;
pub const SYS_msgrcv: ::c_long = 401;
pub const SYS_msgctl: ::c_long = 402;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
Expand All @@ -714,12 +733,12 @@ pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
pub const SYS_quotactl_fd: ::c_long = 443;
pub const SYS_landlock_create_ruleset: ::c_long = 444;
pub const SYS_landlock_add_rule: ::c_long = 445;
pub const SYS_landlock_restrict_self: ::c_long = 446;
pub const SYS_memfd_secret: ::c_long = 447;
pub const SYS_process_mrelease: ::c_long = 448;
pub const SYS_futex_waitv: ::c_long = 449;
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
pub const SYS_mseal: ::c_long = 462;
pub const SYS_cachestat: ::c_long = 451;
pub const SYS_fchmodat2: ::c_long = 452;
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@ pub const SYS_pkey_mprotect: ::c_long = 329;
pub const SYS_pkey_alloc: ::c_long = 330;
pub const SYS_pkey_free: ::c_long = 331;
pub const SYS_statx: ::c_long = 332;
pub const SYS_io_pgetevents: ::c_long = 333;
pub const SYS_rseq: ::c_long = 334;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
Expand Down
7 changes: 7 additions & 0 deletions src/unix/redox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,13 @@ pub const IP_MULTICAST_TTL: ::c_int = 33;
pub const IP_MULTICAST_LOOP: ::c_int = 34;
pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
pub const IP_TOS: ::c_int = 1;
pub const IP_RECVTOS: ::c_int = 2;
pub const IPPROTO_IGMP: ::c_int = 2;
pub const IPPROTO_PUP: ::c_int = 12;
pub const IPPROTO_IDP: ::c_int = 22;
pub const IPPROTO_RAW: ::c_int = 255;
pub const IPPROTO_MAX: ::c_int = 255;
// }

// netinet/tcp.h
Expand Down Expand Up @@ -810,6 +816,7 @@ pub const SO_PROTOCOL: ::c_int = 38;
pub const SO_DOMAIN: ::c_int = 39;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_RAW: ::c_int = 3;
pub const SOCK_NONBLOCK: ::c_int = 0o4_000;
pub const SOCK_CLOEXEC: ::c_int = 0o2_000_000;
pub const SOCK_SEQPACKET: ::c_int = 5;
Expand Down
3 changes: 3 additions & 0 deletions src/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@ extern "C" {
pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void;
#[link_name = "_aligned_free"]
pub fn aligned_free(ptr: *mut ::c_void);
#[link_name = "_aligned_realloc"]
pub fn aligned_realloc(memblock: *mut ::c_void, size: size_t, alignment: size_t)
-> *mut c_void;
#[link_name = "_putenv"]
pub fn putenv(envstring: *const ::c_char) -> ::c_int;
#[link_name = "_wputenv"]
Expand Down

0 comments on commit 9b870d4

Please sign in to comment.