| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| | |
adding KERNEL_VERSION macro for linux.
|
| | |
|
| |
| |
| |
| | |
These are the main diffs present in the android opensource project.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add support for QNX/Neutrino 7.1
Test cases (ctest2, all succeed):
QNX/Neutrino 7.1 x86_64: 9884
QNX/Neutrino 7.1 aarch64: 9766
Co-authored-by: Tristan Roach <troach@qnx.com>
Co-authored-by: Florian Bartels <Florian.Bartels@elektrobit.com>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Test cases (ctest2, all succeed):
QNX/Neutrino 7.1 x86_64: 9884
QNX/Neutrino 7.1 aarch64: 9766
Co-authored-by: Tristan Roach <troach@qnx.com>
Co-authored-by: Florian Bartels <Florian.Bartels@elektrobit.com>
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
linux: Add AT_SYSINFO_EHDR constant
When passed to [`getauxval(3)`][2] this is used to retrieve the base address of the vdso mapped into the current process. It is defined the architecture specific `auxvec.h` headers but [it is defined to the same value in all of them][1] so I've put it in `src/unix/linux_like/linux/mod.rs` instead of in the arch submodule.
[1]: https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/torvalds/linux%24+%23define+AT_SYSINFO_EHDR&patternType=standard&sm=1
[2]: https://man7.org/linux/man-pages/man3/getauxval.3.html
|
| | |
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | | |
adding getopt_long for unixes.
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
Add more capsicum functions for FreeBSD
These have all been available since at least FreeBSD 9.2.
|
| |/ /
| | |
| | |
| | | |
These have all been available since at least FreeBSD 9.2.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
linux musl adding `PIDFD_NONBLOCK` constant.
closes #3002
|
| | | |
| | | |
| | | |
| | | | |
closes #3002
|
|\ \ \ \
| |_|/ /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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/73c25f4e9d66054d1496c693b72d60caea00c4a9/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.)~
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
r=JohnTitor,petrochenkov
handle c circular dependence (linux gnu)
Repeating libc allows solve [this fixme](https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_ssa/src/back/link.rs#:~:text=//%20HACK/FIXME%3A%20Fixup,the%20libc%20crate.) in rust compiler.
|
| | |/ /
| |/| | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
adding SYS_pidfd_send_signal/SYS_pidfd_getfd constants to linux uclib…
…c arm flavor.
closes #3008
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | | |
flavor.
closes #3008
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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`
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
```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>
|
|/ / / |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add sys/ucontext.h signatures for linux aarch64 glibc
### `getcontext`, `setcontext`, `makecontext`, `swapcontext`
From \<sys/ucontext.h\>. The specification for these was removed from POSIX.1-2008 in favor of POSIX threads, but glibc continues to ship an implementation for aarch64 just as it does for x86_64.
Libc crate's existing x86_64 binding with the same signatures added in this PR:
https://github.com/rust-lang/libc/blob/bbf929d2c8355fa19384b3551c5874c866be465f/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs#L810-L813
Glibc implementation:
- https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/aarch64/getcontext.S
- https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/aarch64/setcontext.S
- https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/aarch64/makecontext.c
- https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/aarch64/swapcontext.S
<br>
### ~~`iopl`, `ioperm`~~
~~From \<sys/io.h\>. These are functions for accessing x86 I/O ports. ARM has no such I/O ports in the architecture. Linux's `man 2` for both functions contains: _"This call is mostly for the i386 architecture. On many other architectures it does not exist or will always return an error."_ Glibc ships one of these "always return an error" implementation of both functions for aarch64.~~
~~Matching signatures from x86_64:~~
https://github.com/rust-lang/libc/blob/bbf929d2c8355fa19384b3551c5874c866be465f/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs#L814-L815
~~Glibc implementation:~~
- ~~https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/arm/ioperm.c~~
~~The implementation has `unsigned int` for the argument of `iopl` but I've used int in the PR to match the Linux docs, which seems more authoritative. Unclear why glibc diverges from this but it doesn't make a difference in the ABI.~~
|
| |/ / |
|
|\ \ \
| | | |
| | | |
| | | | |
Add rand48 functions
|
| | | | |
|
| |/ /
|/| | |
|
|\ \ \
| | | |
| | | |
| | | | |
freebsd procctl flags update
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
add extattr_list_xxx() on NetBSD
Corresponds to [this](https://github.com/NetBSD/src/blob/ac36f3f9fee8aff1c69d653503149faaa531f752/sys/sys/extattr.h#L98-L103):
```c
ssize_t extattr_list_fd(int _fd, int _attrnamespace, void *_data,
size_t _nbytes);
ssize_t extattr_list_file(const char *_path, int _attrnamespace, void *_data,
size_t _nbytes);
ssize_t extattr_list_link(const char *_path, int _attrnamespace, void *_data,
size_t _nbytes);
```
|
| |/ / / |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Add Android uinput bindings
This is mostly copied from the Linux bindings.
|
| | |_|/
| |/| | |
|
| |/ /
|/| | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
add extended attributes constants on NetBSD
Add three EA-related constants on NetBSD:
1. [XATTR_CREATE](https://github.com/NetBSD/src/blob/ac36f3f9fee8aff1c69d653503149faaa531f752/sys/sys/xattr.h#L54)
2. [XATTR_REPLACE](https://github.com/NetBSD/src/blob/ac36f3f9fee8aff1c69d653503149faaa531f752/sys/sys/xattr.h#L55)
3. [EXTATTR_NAMESPACE_EMPTY](https://github.com/NetBSD/src/blob/ac36f3f9fee8aff1c69d653503149faaa531f752/sys/sys/extattr.h#L44)
And include `sys/xattr.h` in the test.
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
r=JohnTitor
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"
$
```
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Add FICLONE ioctl for linux aarch64
The ioctl number is the same on aarch64 as on x86_64:
- https://github.com/sunfishcode/linux-raw-sys/blob/v0.1.2/src/aarch64/ioctl.rs#L215-L216
- https://github.com/sunfishcode/linux-raw-sys/blob/v0.1.2/src/x86_64/ioctl.rs#L215-L216
|
| | | | | |
|
|/ / / / |
|