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`
mips32: fix missing __s64 type definition
The compilation error message:
```shell
$ cargo build hello --target mipsel-unknown-linux-uclibc
...
error[E0412]: cannot find type `__s64` in the crate root
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.137/src/unix/linux_like/linux/mod.rs:601:23
|
601 | pub src_fd: ::__s64,
| ^^^^^ help: a type alias with a similar name exists: `__u64`
|
::: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.137/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs:15:1
|
15 | pub type __u64 = ::c_ulonglong;
| ------------------------------- similarly named type alias `__u64` defined here
For more information about this error, try `rustc --explain E0412`.
```
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Migrate from highfive to triagebot
This migrates this repository from using the highfive bot to using triagebot (aka rustbot).
This should not be merged without coordinating the removal of the highfive webhook and/or merging https://github.com/rust-lang/highfive/pull/433.
```shell
$ cargo build hello --target mipsel-unknown-linux-uclibc
...
error[E0412]: cannot find type `__s64` in the crate root
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.137/src/unix/linux_like/linux/mod.rs:601:23
|
601 | pub src_fd: ::__s64,
| ^^^^^ help: a type alias with a similar name exists: `__u64`
|
::: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.137/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs:15:1
|
15 | pub type __u64 = ::c_ulonglong;
| ------------------------------- similarly named type alias `__u64` defined here
For more information about this error, try `rustc --explain E0412`.
```
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
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.
ci: Read test output from stderr
CI is currently failing because https://github.com/JohnTitor/ctest2/pull/37 changed the place to display the test results and `runtest-android.rs` cannot find it on stdout. This PR fixes it by reading lines from stderr instead.
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
Newer emulator versions fail to create an AVD correctly.
Use an old Android emulator until we figure out why.
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
fix wrong definitions of getpwent_r and getgrent_r on solarish os
Closes#2908
* [man page for `getpwent_r`](https://illumos.org/man/3C/getpwnam)
* [man page for `getgrent_r`](https://illumos.org/man/3C/getgrnam)
You may find the definitions for `getpwnam_r/getpwuid_r/getgrnam_r/getgruid_r` exposed by `libc` are also wrong:
```c
struct passwd *getpwnam_r(const char *name, struct passwd *pwd,
char *buffer, int buflen);
```
```rust
pub fn getpwnam_r(
name: *const ::c_char,
pwd: *mut passwd,
buf: *mut ::c_cha
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
```
But actually they are **correct** as there are the POSIX-conforming definitions (see `Standard conforming` section of above man pages):
```
Standard conforming
cc [ flag...] file... -D_POSIX_PTHREAD_SEMANTICS [ library... ]
int getpwnam_r(const char *name, struct passwd *pwd, char *buffer,
size_t bufsize, struct passwd **result);
int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer,
size_t bufsize, struct passwd **result);
```
`getpwent_r/getgrent_r` don't get lucky, they do not have the POSIX-conforming alternatives.
To double check this, I searched its [source code](https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libc/port/gen/getpwnam_r.c):
```shell
$ rg "__posix_getpwnam_r"
port/mapfile-vers
1582: __posix_getpwnam_r;
port/gen/getpwnam_r.c
152:__posix_getpwnam_r(const char *name, struct passwd *pwd, char *buffer,
$ rg "__posix_getpwent_r"
$
```
Enforce order of any `s_*!` macro calls
Before this change, only the order of `s!` was checked. After, it also checks `s_no_extra_traits!` and `s_paren!`. Only the order is checked, not the number of calls. This is required because multiple calls have to be allowed.
Before this change, only the order of `s!` was checked.
After, it also checks `s_no_extra_traits!` and `s_paren!`.
Only the order is checked, not the number of calls. This is
required because multiple calls have to be allowed.
linux: Add POSIX_SPAWN_SETSID flag
This flag allows the child process created by POSIX spawn to create a new session and become leader of a new process group. Expose the flag so that Rust code can use it.