Problems with putenv and getenv
Hi I am a newbie in Linux and encountered a problem with putenv and getenv while using Linux. I did not see this issue with VxWorks so I am assuming that this may be related to processes.
In my code I have a powerup() function where I call another function get_ips()to perform a putenv. After that I call another function set_ips() where I perform a getenv to save the ip in a string so that I can setup a socket. Now when I do a putenv I can see that the environment variable is set, but when I do a getenv the environment variable is no longer set. I thought that it was due to different processes so I put in logMsgs where I did the put/getenv but the logMsgs are telling me that they are running of the same task - main. Can anyone help me understand why this is happening? Am I on the right path? Thank you for your help in advance.