News for hackers. Stuff that matters.
Re:Getaddrinfo() on glibc calls getenv(), oh boy by raggi on Monday October 16, 2023 @09:23PM (#37909128)
there are lots of programs that access `*environ` directly, so while this might be good, it wouldn’t solve all classes of the problem. There are also uses out there which are performance sensitive (and often just as if not more unsafe, such as holding pointers into the structure over long periods).

threaded programs should probably seriously consider retiring libc, but we don’t currently have a common ground replacement.

name related activities are one of the worst areas, contributing significantly to the glibc linkage and abi challenges, but also lacking sufficient standards for alternatives or even consensus to be built quickly.

Re:Getaddrinfo() on glibc calls getenv(), oh boy by dundarious on Monday October 16, 2023 @10:29PM (#37909767)
Yes, on Linux you can even write `int main(int argc, char* argv[], char* envp[])`.
Re:Getaddrinfo() on glibc calls getenv(), oh boy by o11c on Tuesday October 17, 2023 @12:29AM (#37910638)
`envp` is unsafe after `setenv` even in single-threaded programs though. So you really should use `environ`.