<?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 aCC pstat compile error. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-pstat-compile-error/m-p/3151075#M717993</link>
    <description>I'm trying to compile example code from the pstat(2) man page -&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt;       * Example 4: Get a particular process' information&lt;BR /&gt;       */&lt;BR /&gt;      {&lt;BR /&gt;           struct pst_status pst;&lt;BR /&gt;           int target = (int)getppid();&lt;BR /&gt;&lt;BR /&gt;           if (pstat_getproc(&amp;amp;pst, sizeof(pst), (size_t)0, target) != -1)&lt;BR /&gt;                (void)printf("Parent started at %s", ctime(&amp;amp;pst.pst_start));&lt;BR /&gt;           else&lt;BR /&gt;                perror("pstat_getproc");&lt;BR /&gt;      }&lt;BR /&gt;&lt;BR /&gt;It fails compaining about the argument to ctime()&lt;BR /&gt;&lt;BR /&gt;Error 212: "stat.c", line 31 # Argument type 'int *' does not match expected parameter type 'const long *'.&lt;BR /&gt;                    (void)printf("Parent started at %s", ctime(&amp;amp;pst.pst_start));&lt;BR /&gt;                                        &lt;BR /&gt;&lt;BR /&gt;It does compile with harsh warnings, and runs, using cc or gcc.  Any ideas on how to fix this code?&lt;BR /&gt;Thanks,&lt;BR /&gt;Jim&lt;BR /&gt;</description>
    <pubDate>Mon, 22 Dec 2003 12:48:13 GMT</pubDate>
    <dc:creator>James Brand</dc:creator>
    <dc:date>2003-12-22T12:48:13Z</dc:date>
    <item>
      <title>aCC pstat compile error.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-pstat-compile-error/m-p/3151075#M717993</link>
      <description>I'm trying to compile example code from the pstat(2) man page -&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt;       * Example 4: Get a particular process' information&lt;BR /&gt;       */&lt;BR /&gt;      {&lt;BR /&gt;           struct pst_status pst;&lt;BR /&gt;           int target = (int)getppid();&lt;BR /&gt;&lt;BR /&gt;           if (pstat_getproc(&amp;amp;pst, sizeof(pst), (size_t)0, target) != -1)&lt;BR /&gt;                (void)printf("Parent started at %s", ctime(&amp;amp;pst.pst_start));&lt;BR /&gt;           else&lt;BR /&gt;                perror("pstat_getproc");&lt;BR /&gt;      }&lt;BR /&gt;&lt;BR /&gt;It fails compaining about the argument to ctime()&lt;BR /&gt;&lt;BR /&gt;Error 212: "stat.c", line 31 # Argument type 'int *' does not match expected parameter type 'const long *'.&lt;BR /&gt;                    (void)printf("Parent started at %s", ctime(&amp;amp;pst.pst_start));&lt;BR /&gt;                                        &lt;BR /&gt;&lt;BR /&gt;It does compile with harsh warnings, and runs, using cc or gcc.  Any ideas on how to fix this code?&lt;BR /&gt;Thanks,&lt;BR /&gt;Jim&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Dec 2003 12:48:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-pstat-compile-error/m-p/3151075#M717993</guid>
      <dc:creator>James Brand</dc:creator>
      <dc:date>2003-12-22T12:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: aCC pstat compile error.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-pstat-compile-error/m-p/3151076#M717994</link>
      <description>It's missing a few header files and a cast to (time_t *). This should fix you.&lt;BR /&gt;&lt;BR /&gt;This is not uncommon for man pages; some have not been updated for years.&lt;BR /&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;ERRNO.H&gt;&lt;BR /&gt;#include &lt;TIME.H&gt;&lt;BR /&gt;&lt;BR /&gt;int doit(void)&lt;BR /&gt;{&lt;BR /&gt;  struct pst_status pst;&lt;BR /&gt;  int target = (int)getppid();&lt;BR /&gt;&lt;BR /&gt;  if (pstat_getproc(&amp;amp;pst, sizeof(pst), (size_t) 0, target) != -1)&lt;BR /&gt;      (void)printf("Parent started at %s", ctime((time_t *) &amp;amp;(pst.pst_start)));&lt;BR /&gt;  else perror("pstat_getproc");&lt;BR /&gt;  return(0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;  int d;&lt;BR /&gt;&lt;BR /&gt;  d = doit();&lt;BR /&gt;  return(d);&lt;BR /&gt;}&lt;/TIME.H&gt;&lt;/ERRNO.H&gt;&lt;/STDIO.H&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/SYS&gt;</description>
      <pubDate>Mon, 22 Dec 2003 19:00:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-pstat-compile-error/m-p/3151076#M717994</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-12-22T19:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: aCC pstat compile error.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/acc-pstat-compile-error/m-p/3151077#M717995</link>
      <description>A. Clay,&lt;BR /&gt;&lt;BR /&gt;I had the header files but was missing the type cast to (time_t *). This fixed it, thanks very much.&lt;BR /&gt;&lt;BR /&gt;Jim</description>
      <pubDate>Tue, 23 Dec 2003 10:25:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/acc-pstat-compile-error/m-p/3151077#M717995</guid>
      <dc:creator>James Brand</dc:creator>
      <dc:date>2003-12-23T10:25:52Z</dc:date>
    </item>
  </channel>
</rss>

