rust-lang / libc

Raw bindings to platform APIs for Rust
https://docs.rs/libc
Apache License 2.0
2.09k stars 1.04k forks source link

`RLIM_*` constants mismatch with system header files #2724

Open Nugine opened 2 years ago

Nugine commented 2 years ago

The three constants defined in libc are different from those defined in <sys/resources.h> on some platforms.

libc::RLIM_INFINITY
libc::RLIM_SAVED_CUR
libc::RLIM_SAVED_MAX

Targets

arm-unknown-linux-gnueabi
arm-unknown-linux-gnueabihf
armv5te-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
i586-unknown-linux-gnu
i686-unknown-linux-gnu
mips-unknown-linux-gnu
mipsel-unknown-linux-gnu
powerpc-unknown-linux-gnu

Test code: https://github.com/Nugine/libc-rlim-mismatch/blob/master/src/lib.rs Test result: https://github.com/Nugine/libc-rlim-mismatch/actions/runs/1984774750

This bug is initially discovered in Nugine/rlimit tests.

Test result: https://github.com/Nugine/rlimit/actions/runs/1984623879 Workflow file: https://github.com/Nugine/rlimit/actions/runs/1984623879/workflow Issue: https://github.com/Nugine/rlimit/issues/30

tgross35 commented 2 months ago

PRs are very welcome! Please link the relevant header, the test results link is dead.