4 ms·
Why does adding a mutex break the API? I guess it breaks `char**environ`. But the API wouldn't be broken.
by rerdavies 2y ago
Why does adding a mutex break the API? I guess it breaks `char**environ`. But the API wouldn't be broken.
- benmmurphy 2y agoI think you would have to change the API to return a copy of the string as the get_env result which the caller is responsible for free-ing or the env implementation would have to ensure returned values from get_env are stable and never change which is effectively a memory leak.
- layer8 2y agoGetenv_r() does this: https://man.netbsd.org/getenv_r.3 https://man.netbsd.org/getenv_r.3