News for hackers. Stuff that matters.
Re:Setenv Is Not Thread Safe and C Doesn't Want to Fix It by faiD9Eet on Monday November 20, 2023 @04:43AM (#38345523)
I am trying to make sense of the argument of pushing configuration into a library:

    * if the library is just a dependency, the Linux loader will set it up. It will have the same environment as the other libraries and as the main program.
    * if the library is set up by dlopen(), there is no way to provide an environment pointer
Altering the global environment variable for child processes makes no sense, for

    execve()
accepts an

    char* envp[]
. So I guess we need to talk about issues with a specific use case of

     dlopen()
Re:Setenv Is Not Thread Safe and C Doesn't Want to Fix It by planede on Monday November 20, 2023 @05:05AM (#38345763)
Maybe the dlopen issue could be hacked around by dlmopen and injecting getenv and setenv symbols that access a different environment variable list than the application's.