<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: putenv() in child process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/putenv-in-child-process/m-p/2997097#M718535</link>
    <description>Hello!&lt;BR /&gt;&lt;BR /&gt;Maybe the change of timezone, the fork start to work difrent because of the changes in time.&lt;BR /&gt;&lt;BR /&gt;Caesar</description>
    <pubDate>Fri, 13 Jun 2003 16:12:21 GMT</pubDate>
    <dc:creator>Caesar_3</dc:creator>
    <dc:date>2003-06-13T16:12:21Z</dc:date>
    <item>
      <title>putenv() in child process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/putenv-in-child-process/m-p/2997096#M718534</link>
      <description>I have code something like this which is executed when different options selected from&lt;BR /&gt;X-motif GUI. The testme never startes. If I remove putenv then it works, Any thoughts..&lt;BR /&gt;&lt;BR /&gt; if ((pid = fork()) == 0)&lt;BR /&gt; {&lt;BR /&gt; if ( strcmp(app,"testme") == 0 )&lt;BR /&gt; putenv(localTZ);&lt;BR /&gt; setpgrp();&lt;BR /&gt; if ( strcmp(app,"testme") == 0 )&lt;BR /&gt;   execlp(path, app,"-26", (char *) 0);&lt;BR /&gt; else&lt;BR /&gt; execlp(path, app,(char *) 0);&lt;BR /&gt; _exit(1);&lt;BR /&gt;}&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Jun 2003 16:04:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/putenv-in-child-process/m-p/2997096#M718534</guid>
      <dc:creator>Sup</dc:creator>
      <dc:date>2003-06-13T16:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: putenv() in child process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/putenv-in-child-process/m-p/2997097#M718535</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;Maybe the change of timezone, the fork start to work difrent because of the changes in time.&lt;BR /&gt;&lt;BR /&gt;Caesar</description>
      <pubDate>Fri, 13 Jun 2003 16:12:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/putenv-in-child-process/m-p/2997097#M718535</guid>
      <dc:creator>Caesar_3</dc:creator>
      <dc:date>2003-06-13T16:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: putenv() in child process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/putenv-in-child-process/m-p/2997098#M718536</link>
      <description>Best guess because not enough code is visible:&lt;BR /&gt;&lt;BR /&gt;localTZ is an auto decalared variable that has gone out of scope because of a function exit. Move localTZ out to file scope or dynamically allocate it but don't free it.&lt;BR /&gt;&lt;BR /&gt;If you are doing something like this:&lt;BR /&gt;&lt;BR /&gt;int bad_myenv(char *tz)&lt;BR /&gt;{&lt;BR /&gt;  int cc = 0;&lt;BR /&gt;  char localTZ[128];&lt;BR /&gt;&lt;BR /&gt;  (void) sprintf(local_TZ,"TZ=%s",tz);&lt;BR /&gt;   cc =  putenv(localTZ);&lt;BR /&gt;  return(cc)&lt;BR /&gt;} /* bad_myenv */&lt;BR /&gt;&lt;BR /&gt;Change it to:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;int good_myenv(char *tz)&lt;BR /&gt;{&lt;BR /&gt;  int cc = 0;&lt;BR /&gt;  static char localTZ[128];&lt;BR /&gt;&lt;BR /&gt;  (void) sprintf(local_TZ,"TZ=%s",tz);&lt;BR /&gt;   cc =  putenv(localTZ);&lt;BR /&gt;  return(cc)&lt;BR /&gt;} /* good_myenv */&lt;BR /&gt;&lt;BR /&gt;OR&lt;BR /&gt;&lt;BR /&gt;static char localTZ[128];&lt;BR /&gt;&lt;BR /&gt;int good_myenv2(char *tz)&lt;BR /&gt;{&lt;BR /&gt;  int cc = 0;&lt;BR /&gt;&lt;BR /&gt;  (void) sprintf(local_TZ,"TZ=%s",tz);&lt;BR /&gt;   cc =  putenv(localTZ);&lt;BR /&gt;  return(cc)&lt;BR /&gt;} /* good_myenv2 */&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Jun 2003 16:16:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/putenv-in-child-process/m-p/2997098#M718536</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-06-13T16:16:00Z</dc:date>
    </item>
  </channel>
</rss>

