Operating System - HP-UX
1825747 Members
2765 Online
109687 Solutions
New Discussion

Re: how to use PUTENV and GETENV in different process

 
meghana9490
Occasional Advisor

how to use PUTENV and GETENV in different process

Hi team , 

I am trying to put the enviroment variable using PUTENV  from one vas (procees) and accessing the same environment variable in different vas(process) using GETENV api .

when I tried this way  but I am facing core dump , can you please help me on this 

 

meghanagujjeti
1 REPLY 1
Steven Schweda
Honored Contributor

Re: how to use PUTENV and GETENV in different process

> I am trying to put the enviroment variable using PUTENV from one vas
> (procees) and accessing the same environment variable in different
> vas(process) using GETENV api .

Why should the environment for one process be shared with any other
process?

> when I tried this way but I am facing core dump [...]

   What, exactly, failed?  Debugging visible code is often easier than
debugging invisible code.  With my weak psychic powers, I don't know
what you did.  My first guess would be that you got a null pointer from
getenv(), and then you tried to use it.  But that's only a guess.

> [...] PUTENV [...] GETENV [...]

   Note that in C, case matters.  I assume that you mean getenv() and
putenv(), which are the names of functions in the C RTL.