<?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 pstat_getcommandline() link error ?? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pstat-getcommandline-link-error/m-p/3444769#M707645</link>
    <description>&lt;P&gt;Hello.&lt;BR /&gt;I'm a begginer on HP-UX's C programmings&lt;BR /&gt;and environment.&lt;BR /&gt;&lt;BR /&gt;I wrote a program(bsntest.c) as below:&lt;BR /&gt;&lt;BR /&gt;include &amp;lt;STDIO.H&amp;gt;&lt;BR /&gt;#include &lt;BR /&gt;#include &amp;lt;UNISTD.H&amp;gt;&lt;BR /&gt;&lt;BR /&gt;main(){&lt;BR /&gt;char buf[1024+1];&lt;BR /&gt;int pid;&lt;BR /&gt;pid = (int) getpid();&lt;BR /&gt;puts("use pstat_commandline()");&lt;BR /&gt;pstat_getcommandline(buf,1024,1,pid);&lt;BR /&gt;&lt;BR /&gt;printf("command line : %s", buf);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;when I did "cc bsntest.c",&lt;BR /&gt;then the error messages displayed as bellow:&lt;BR /&gt;&lt;BR /&gt;$ cc bsntest.c&lt;BR /&gt;/usr/ccs/bin/ld: Unsatisfied symbols:&lt;BR /&gt;pstat_getcommandline (first referenced in bsntest.o) (code)&lt;BR /&gt;&lt;BR /&gt;I guess that something is wrong to link,&lt;BR /&gt;but I can't understand the details of ld at now.(ofcource, I read ld's man page..)&lt;BR /&gt;&lt;BR /&gt;Please tell me how to solve this problem.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;Takanobu Maekawa&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moved from HP-UX Technical Documentation to HP-UX &amp;gt; languages&lt;/P&gt;</description>
    <pubDate>Fri, 29 Mar 2013 07:44:09 GMT</pubDate>
    <dc:creator>Ma_Ta</dc:creator>
    <dc:date>2013-03-29T07:44:09Z</dc:date>
    <item>
      <title>pstat_getcommandline() link error ??</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pstat-getcommandline-link-error/m-p/3444769#M707645</link>
      <description>&lt;P&gt;Hello.&lt;BR /&gt;I'm a begginer on HP-UX's C programmings&lt;BR /&gt;and environment.&lt;BR /&gt;&lt;BR /&gt;I wrote a program(bsntest.c) as below:&lt;BR /&gt;&lt;BR /&gt;include &amp;lt;STDIO.H&amp;gt;&lt;BR /&gt;#include &lt;BR /&gt;#include &amp;lt;UNISTD.H&amp;gt;&lt;BR /&gt;&lt;BR /&gt;main(){&lt;BR /&gt;char buf[1024+1];&lt;BR /&gt;int pid;&lt;BR /&gt;pid = (int) getpid();&lt;BR /&gt;puts("use pstat_commandline()");&lt;BR /&gt;pstat_getcommandline(buf,1024,1,pid);&lt;BR /&gt;&lt;BR /&gt;printf("command line : %s", buf);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;when I did "cc bsntest.c",&lt;BR /&gt;then the error messages displayed as bellow:&lt;BR /&gt;&lt;BR /&gt;$ cc bsntest.c&lt;BR /&gt;/usr/ccs/bin/ld: Unsatisfied symbols:&lt;BR /&gt;pstat_getcommandline (first referenced in bsntest.o) (code)&lt;BR /&gt;&lt;BR /&gt;I guess that something is wrong to link,&lt;BR /&gt;but I can't understand the details of ld at now.(ofcource, I read ld's man page..)&lt;BR /&gt;&lt;BR /&gt;Please tell me how to solve this problem.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;Takanobu Maekawa&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moved from HP-UX Technical Documentation to HP-UX &amp;gt; languages&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2013 07:44:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pstat-getcommandline-link-error/m-p/3444769#M707645</guid>
      <dc:creator>Ma_Ta</dc:creator>
      <dc:date>2013-03-29T07:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: pstat_getcommandline() link error ??</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pstat-getcommandline-link-error/m-p/3444770#M707646</link>
      <description>pstat_getcommandline() is not available as a documented and supported function until 11i v2. Assuming that you are on 11i v1 you can use the following code to get up to 1024 characters of the command line of a process.&lt;BR /&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#define MAX_LENGTH (1024)&lt;BR /&gt;main (argc, argv) int argc; char *argv[]; {&lt;BR /&gt;    int pid;&lt;BR /&gt;    char long_command [MAX_LENGTH];&lt;BR /&gt;    union pstun pu;&lt;BR /&gt;&lt;BR /&gt;    pid = atoi(argv[1]);&lt;BR /&gt;    pu.pst_command = long_command;&lt;BR /&gt;    if (pstat(PSTAT_GETCOMMANDLINE, pu, MAX_LENGTH, 1, pid) == -1) {&lt;BR /&gt; printf("ERROR: pstat() failure using pid(%d)\n", pid);&lt;BR /&gt; exit(-1);&lt;BR /&gt;    }&lt;BR /&gt;    printf("pid %d = %s\n", pid, pu.pst_command);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/SYS&gt;&lt;/SYS&gt;</description>
      <pubDate>Wed, 15 Dec 2004 21:25:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pstat-getcommandline-link-error/m-p/3444770#M707646</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2004-12-15T21:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: pstat_getcommandline() link error ??</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pstat-getcommandline-link-error/m-p/3444771#M707647</link>
      <description>Thanks very much!&lt;BR /&gt;the probrem has removed!&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;Takanobu Maekawa&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Dec 2004 22:26:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pstat-getcommandline-link-error/m-p/3444771#M707647</guid>
      <dc:creator>Ma_Ta</dc:creator>
      <dc:date>2004-12-15T22:26:40Z</dc:date>
    </item>
  </channel>
</rss>

