Add missing string-to-number functions from ISO C
These should be the observable API changes:
- ISO C90 function `atol()` is added to all `fuchsia`, `unix`, `vxworks`, `wasi`, and `windows` targets.
- ISO C90 function `atof()` is added to `android`, `redox`, and `vxworks`.
- ISO C99 functions `atoll()`, `strtoll()`, and `strtoull()` are added to all `fuchsia`, `unix`, `vxworks`, `wasi`, and `windows` targets.
Also, I wasn't exactly sure where to insert the new functions, so I just tried to place them near related functions.
Try readding all inotify flags
Adds back some inotify flags that were once too new, but it appears the inexorable process of time has made the tests pass now.
redox: long is 32-bits on 32-bit systems
This ensures that 32-bit systems use i32 for c_long and u32 for c_ulong.
I have also adjusted off_t and time_t to be `long long`, which is what they are in `relibc` now.
Enable copy_file_range on FreeBSD
PR #2479 did this, but only in the freebsd13 and freebsd14 modules, which was incorrect. Those modules should only be used for functions that change across FreeBSD versions, and therefore need different ELF symbol versions. Functions that were newly added since FreeBSD 11 can still go in the base freebsd module. It will cause no problems for them to be there, and users will see an error at link time if they try to use such a function in an environment that is too old to support it.
PR #2479 did this, but only in the freebsd13 and freebsd14 modules,
which was incorrect. Those modules should only be used for functions
that change across FreeBSD versions, and therefore need different ELF
symbol versions. Functions that were newly added since FreeBSD 11 can
still go in the base freebsd module. It will cause no problems for them
to be there, and users will see an error at link time if they try to
use such a function in an environment that is too old to support it.
Rearrange `sockaddr_storage` padding/alignment fields on Linux and Fuchsia
Part of #3004.
Previously on Linux, the `sockaddr_storage` structure had padding bytes between the `ss_family` and `__ss_align` fields. The `__ss_align` field has now been moved to the end of the structure to eliminate these padding bytes, matching recent glibc versions: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/bits/socket.h;h=4f1f810ea1d9bf00ff428e4e7c49a52c71620775;hb=c804cd1c00adde061ca51711f63068c103e94eef#l190
After the PR on Linux x86-64:
```
print-type-size type: `unix::linux_like::sockaddr_storage`: 128 bytes, alignment: 8 bytes
print-type-size field `.ss_family`: 2 bytes
print-type-size field `.__ss_pad2`: 118 bytes
print-type-size field `.__ss_align`: 8 bytes
```
These moved fields are private but they are used in the `sockaddr_storage`s `PartialEq`, `Debug`, and `Hash` implementations, so the exact behaviour may change slightly, but I don't think anyone should be depending on this.
~(It looks like [Fuchsia](https://github.com/rust-lang/libc/blob/e101db2785fa471540e66d8d3d897009ee5cced1/src/fuchsia/mod.rs#L910) has the same issue, but I didn't modify its structure because I don't know much about it, or how to test it.)~
Migrate from highfive to triagebot
This migrates this repository from using the highfive bot to using triagebot (aka rustbot).
This is ready to merge now, feel free to merge to re-enable auto-assignment.
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.