libc
libc copied to clipboard
Raw bindings to platform APIs for Rust
for musl, these names were removed in 827aa8fbcac89a63c6efb986871663861500cd13 (back to reserved space). https://github.com/bminor/musl/commit/827aa8fbcac89a63c6efb986871663861500cd13 since musl doesn't actually touch/implement these options, they shouldn't be exposed. --- discovered in https://github.com/haileys/bark/issues/4 . afaict,...
The following code ```rs use libc::{socket, bind, accept, listen, connect, close}; use libc::{sockaddr_in, sockaddr, in_addr}; use libc::{AF_INET, SOCK_STREAM, INADDR_ANY}; use std::os::fd::RawFd; fn main() { unsafe { let sock:RawFd = socket(AF_INET,...
A common use of `unsafe` code is to access or modify the bytes of libc types (e.g. by transmuting them; [here's an example](https://github.com/bytecodealliance/rustix/blob/main/src/backend/libc/net/ext.rs)). Many libc types could implement the zerocopy...
The `CMSG_LEN` and `CMSG_SPACE` macros defined in `` on most UNIX platforms do not have well-defined types, but they generally (not always[0]) operate on `size_t`: ```c /* Linux (GNU libc,...
Same with SIGSTKSZ. This starts with a more philosophical problem: glibc 2.34 defines these macros as expanding to an expression that resolves as a dynamic, non-constant value. This addresses the...
Please, reexport UNIX's variable `environ` https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
If we look at the `stat` type's definition for different platforms, we see: - [x86_64-unknown-linux-gnu](https://rust-lang.github.io/libc/x86_64-unknown-linux-gnu/doc/libc/struct.stat.html): ```rust st_dev: dev_t st_ino: ino_t [...] ``` - [aarch64-linux-android](https://rust-lang.github.io/libc/aarch64-linux-android/doc/libc/struct.stat.html): - same But for [arm-linux-androideabi](https://rust-lang.github.io/libc/arm-linux-androideabi/doc/libc/struct.stat.html) we...
The CMSG_\* code is unsafe if the buffers passed to it are malformed. This is not a problem if they come from the kernel (the usual case), since the kernel...
Your structs `dirent`, `dirent64` are wrong at x86_64-unknown-linux-gnu. Their field `d_name` contains 256 bytes. But names can be bigger than 256 bytes in NTFS (in Linux). I was able to...