<?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: Printing process name in Shared lib function in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/printing-process-name-in-shared-lib-function/m-p/2755839#M722263</link>
    <description>Depending upon the compiler/linker you use a global variable is set. Man crt0 for details.&lt;BR /&gt;&lt;BR /&gt;The scheme is this:&lt;BR /&gt;&lt;BR /&gt;extern char **__argv_value;&lt;BR /&gt;/* yours may be __argv */&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;.....&lt;BR /&gt;.....&lt;BR /&gt;(void) printf("Process: %s\n",__argv_value[0]);&lt;BR /&gt;---------------------------------------------&lt;BR /&gt;A far mode portable method is to do a getpid() and then a popen() call to ps -p pid.&lt;BR /&gt;</description>
    <pubDate>Mon, 01 Jul 2002 20:19:15 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2002-07-01T20:19:15Z</dc:date>
    <item>
      <title>Printing process name in Shared lib function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/printing-process-name-in-shared-lib-function/m-p/2755838#M722262</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have 3 functions calling single function &lt;BR /&gt;present in shared lib. I want to print these &lt;BR /&gt;process names in the shared lib function.&lt;BR /&gt;&lt;BR /&gt;Is there any system call to get process name?&lt;BR /&gt;&lt;BR /&gt;Thanx in Advance&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Jul 2002 19:49:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/printing-process-name-in-shared-lib-function/m-p/2755838#M722262</guid>
      <dc:creator>Sup</dc:creator>
      <dc:date>2002-07-01T19:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Printing process name in Shared lib function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/printing-process-name-in-shared-lib-function/m-p/2755839#M722263</link>
      <description>Depending upon the compiler/linker you use a global variable is set. Man crt0 for details.&lt;BR /&gt;&lt;BR /&gt;The scheme is this:&lt;BR /&gt;&lt;BR /&gt;extern char **__argv_value;&lt;BR /&gt;/* yours may be __argv */&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;.....&lt;BR /&gt;.....&lt;BR /&gt;(void) printf("Process: %s\n",__argv_value[0]);&lt;BR /&gt;---------------------------------------------&lt;BR /&gt;A far mode portable method is to do a getpid() and then a popen() call to ps -p pid.&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Jul 2002 20:19:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/printing-process-name-in-shared-lib-function/m-p/2755839#M722263</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-07-01T20:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Printing process name in Shared lib function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/printing-process-name-in-shared-lib-function/m-p/2755840#M722264</link>
      <description>Define another function initname(const char*)for the shared library, which you call at the beginning of main( .... argv) { initname(argv[0]); ... &lt;BR /&gt;&lt;BR /&gt;char* processname;&lt;BR /&gt;void initname(const char* name ) {&lt;BR /&gt;    processname = name;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;you can access processname in all (shared) functions.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Klaus&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jul 2002 09:00:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/printing-process-name-in-shared-lib-function/m-p/2755840#M722264</guid>
      <dc:creator>Klaus Crusius</dc:creator>
      <dc:date>2002-07-11T09:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Printing process name in Shared lib function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/printing-process-name-in-shared-lib-function/m-p/2755841#M722265</link>
      <description>assigning points to the replies is as easy as reading them, at least easier than providing the answers.</description>
      <pubDate>Tue, 16 Jul 2002 12:42:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/printing-process-name-in-shared-lib-function/m-p/2755841#M722265</guid>
      <dc:creator>Klaus Crusius</dc:creator>
      <dc:date>2002-07-16T12:42:38Z</dc:date>
    </item>
  </channel>
</rss>

