3 ms·
who pull in libraries in C like this?
by JaDogg 3y ago
who pull in libraries in C like this?
- agevag 3y ago[dead]
- Tobu 3y agoWho doesn't? libc itself calls getenv when getting system time: https://news.ycombinator.com/item?id=38344224 https://news.ycombinator.com/item?id=38344224 You may have a mutex on getenv/setenv, like the Rust stdlib does, but when libc doesn't look at that mutex, even on the read side, you run into UB. So the next step is never calling into seemingly innocent libc functions in safe code (which you have to enforce on your dependencies as well), implementing safe alternatives to a good chunk of libc (and making sure your dependencies use those), to cordon off anything that looks at the environment. This makes a good chunk of POSIX functionality useless.
- JaDogg 3y agoOK thank you for the explanation.. This makes more more scared to bring in libraries :(