On Wed, 24 May 2006, James Pearson wrote:
It appears that /proc/PID/environ only returns the first 4096 bytes of a
processes' environment.
Is there any other way via userland to get the whole environment for a
process?
Thanks
James Pearson
I think that /proc/PID/environ just returns the environment that
existed when the process was created, irrespective of size. You
can check this as:
#include <stdio.h>
main()
{
setenv("FOO=", "1234", 1);
printf("%d\n", getpid());
pause();
}
Variable "FOO" will not appear in /proc. It you set the environment
in non-standard ways, overwriting the original, you can see it in
/proc.