libc
libc copied to clipboard
Raw bindings to platform APIs for Rust
WinAPI provides low level libc-like functions but for Windows. One may expect to find it here, so provide the links. `winapi` crate works well, but it was last updated four...
Header source: [AT_EACCESS](https://github.com/emscripten-core/emscripten/blob/3073806d3fde4320c81cb2dc7cf0e00378f52df1/system/lib/libc/musl/include/fcntl.h#L68)
I added `getgrgid`, `getgrnam`, `getgrnam_r` and `getgrgid_r` for emscripten. Header sources: [getgrgid](https://github.com/emscripten-core/emscripten/blob/3073806d3fde4320c81cb2dc7cf0e00378f52df1/system/lib/libc/musl/include/grp.h#L26) [getgrnam](https://github.com/emscripten-core/emscripten/blob/3073806d3fde4320c81cb2dc7cf0e00378f52df1/system/lib/libc/musl/include/grp.h#L27) [getgrgid_r](https://github.com/emscripten-core/emscripten/blob/127fb03dad7288a71f51bd46be49f1da8bdb0fa8/system/lib/libc/musl/include/grp.h#L29) [getgrnam_r](https://github.com/emscripten-core/emscripten/blob/127fb03dad7288a71f51bd46be49f1da8bdb0fa8/system/lib/libc/musl/include/grp.h#L30)
`getpwnam` and `getpwuid` exist, but `*_r` functions do not exist for Emscripten, so I added them. Header sources: [getpwnam_r](https://github.com/emscripten-core/emscripten/blob/127fb03dad7288a71f51bd46be49f1da8bdb0fa8/system/lib/libc/musl/include/pwd.h#L39) [getpwuid_r](https://github.com/emscripten-core/emscripten/blob/127fb03dad7288a71f51bd46be49f1da8bdb0fa8/system/lib/libc/musl/include/pwd.h#L38)
Resolves #1618 It seems like #1618 has already been mostly resolved; this PR simply adds some of the few `pthread` APIs that are still missing.
Adds a few additional structs for BPF operations (`bpf_version`, `bpf_stat`, `bpf_zbuf`) as well as ioctl constants. Adds constants used for creating/manipulating network interfaces via ioctls. Resolves #3626
`libc-test` was already at 2018 Edition, bumping to 2021 just needs changing it in `Cargo.toml`
On Linux, [clone](https://docs.rs/libc/0.2.95/libc/fn.clone.html) takes a callback function pointer. The function pointer type is not marked `unsafe`, but there is basically no way to implement this callback with a safe function...