Skip to content

Commit 4d8960d

Browse files
committed
Auto merge of #3007 - xen0n:fix-loong, r=JohnTitor
Fix the loongarch64 kernel ABI The initial loongarch64 support code went in too early, even before the upstream kernel ABI has finalized, and was not adjusted since then. No one with enough knowledge of LoongArch was involved in the initial review, so we have been shipping broken LoongArch support, but luckily the rustc port is not merged yet so no real damage has been done. Fix the following discrepancies: - There is no longer {g,s}etrlimit, only prlimit64. - There is no longer fstat and newfstatat, only statx. - MINSIGSTKSZ and SIGSTKSZ now have different values. - The binary sysctl syscall was removed from Linux long before the existence of upstream Linux/LoongArch port (5.5 vs 5.19) so even a wrapper does not make sense. There might be more but these are the most obvious. cc `@xry111` `@zhaixiaojuan`
2 parents b22356e + 0abe537 commit 4d8960d

File tree

1 file changed

+2
-17
lines changed
  • src/unix/linux_like/linux/gnu/b64/loongarch64

1 file changed

+2
-17
lines changed

src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,6 @@ pub const SYS_vmsplice: ::c_long = 75;
325325
pub const SYS_splice: ::c_long = 76;
326326
pub const SYS_tee: ::c_long = 77;
327327
pub const SYS_readlinkat: ::c_long = 78;
328-
pub const SYS_newfstatat: ::c_long = 79;
329-
pub const SYS_fstat: ::c_long = 80;
330328
pub const SYS_sync: ::c_long = 81;
331329
pub const SYS_fsync: ::c_long = 82;
332330
pub const SYS_fdatasync: ::c_long = 83;
@@ -409,8 +407,6 @@ pub const SYS_setgroups: ::c_long = 159;
409407
pub const SYS_uname: ::c_long = 160;
410408
pub const SYS_sethostname: ::c_long = 161;
411409
pub const SYS_setdomainname: ::c_long = 162;
412-
pub const SYS_getrlimit: ::c_long = 163;
413-
pub const SYS_setrlimit: ::c_long = 164;
414410
pub const SYS_getrusage: ::c_long = 165;
415411
pub const SYS_umask: ::c_long = 166;
416412
pub const SYS_prctl: ::c_long = 167;
@@ -772,8 +768,8 @@ pub const EXTPROC: ::tcflag_t = 0x00010000;
772768
pub const TCSANOW: ::c_int = 0;
773769
pub const TCSADRAIN: ::c_int = 1;
774770
pub const TCSAFLUSH: ::c_int = 2;
775-
pub const SIGSTKSZ: ::size_t = 8192;
776-
pub const MINSIGSTKSZ: ::size_t = 2048;
771+
pub const SIGSTKSZ: ::size_t = 16384;
772+
pub const MINSIGSTKSZ: ::size_t = 4096;
777773
pub const CBAUD: ::tcflag_t = 0o0010017;
778774
pub const CSIZE: ::tcflag_t = 0x00000030;
779775
pub const CS6: ::tcflag_t = 0x00000010;
@@ -858,17 +854,6 @@ pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
858854
pub const EFD_CLOEXEC: ::c_int = 0x80000;
859855
pub const EFD_NONBLOCK: ::c_int = 0x800;
860856

861-
extern "C" {
862-
pub fn sysctl(
863-
name: *mut ::c_int,
864-
namelen: ::c_int,
865-
oldp: *mut ::c_void,
866-
oldlenp: *mut ::size_t,
867-
newp: *mut ::c_void,
868-
newlen: ::size_t,
869-
) -> ::c_int;
870-
}
871-
872857
cfg_if! {
873858
if #[cfg(libc_align)] {
874859
mod align;

0 commit comments

Comments
 (0)