<?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: Problem with pstat_getproc in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572766#M103541</link>
    <description>I just want to let you know that I had the exact same problem.  I was trying to run the tool which you can find at &lt;A href="http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,5944,00.html" target="_blank"&gt;http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,5944,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;After reading this thread, I tried the two solutions.  The -D_PSTAT64 flag didn't work for me; all the process info for all the processes would report the same number.  Like the pid would be the same for all the processes.&lt;BR /&gt;&lt;BR /&gt;But the +DD64 flag made it work perfectly.  Thanks for your help.</description>
    <pubDate>Thu, 19 Jan 2006 15:12:02 GMT</pubDate>
    <dc:creator>Leo Lai</dc:creator>
    <dc:date>2006-01-19T15:12:02Z</dc:date>
    <item>
      <title>Problem with pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572758#M103533</link>
      <description>Im using the following code (found in man pages) to get processes info, and i get an error saying&lt;BR /&gt;&lt;BR /&gt;pstat_getproc failed: Value too large to be stored in data type&lt;BR /&gt;&lt;BR /&gt;Source Code:&lt;BR /&gt; #define BURST ((size_t)10)&lt;BR /&gt;&lt;BR /&gt;      struct pst_status pst[BURST];&lt;BR /&gt;      int i, count;&lt;BR /&gt;      int idx = 0; /* index within the context */&lt;BR /&gt;&lt;BR /&gt;      while ((count=pstat_getproc(pst, sizeof(pst[0]),BURST,idx))&amp;gt;0) {&lt;BR /&gt;              for (i = 0; i &amp;lt; count; i++) {&lt;BR /&gt;                   (void)printf("pid is %d, command is %s\n",pst[i].pst_pid, pst[i].pst_ucomm);&lt;BR /&gt;              }&lt;BR /&gt;              idx = pst[count-1].pst_idx + 1;&lt;BR /&gt;         }&lt;BR /&gt;&lt;BR /&gt;         if (count == -1)&lt;BR /&gt;              perror("pstat_getproc()");&lt;BR /&gt; #undef BURST&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Jun 2005 01:20:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572758#M103533</guid>
      <dc:creator>Andreas Tsamis</dc:creator>
      <dc:date>2005-06-29T01:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572759#M103534</link>
      <description>Try compiling your program with -D_PSTAT64. The following text is from pstat(2).&lt;BR /&gt;&lt;BR /&gt; Notes&lt;BR /&gt;      A wide (64 bit) version of the pstat interfaces are available for&lt;BR /&gt;      narrow (32 bit) applications to use.  A narrow application could use&lt;BR /&gt;      the flag -D_PSTAT64 at compile time to switch to the wide interfaces.&lt;BR /&gt;      Using this compiler flag in a narrow application is equivalent to&lt;BR /&gt;      using the default interfaces on a wide system.</description>
      <pubDate>Wed, 29 Jun 2005 02:17:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572759#M103534</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2005-06-29T02:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572760#M103535</link>
      <description>#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;&lt;BR /&gt;#define BURST ((size_t)10)&lt;BR /&gt;&lt;BR /&gt;main(){&lt;BR /&gt;struct pst_status pst[BURST];&lt;BR /&gt;int i, count;&lt;BR /&gt;int idx = 0; /* index within the context */&lt;BR /&gt;&lt;BR /&gt;while ((count=pstat_getproc(pst, sizeof(pst[0]),BURST,idx))&amp;gt;0) {&lt;BR /&gt;for (i = 0; i &amp;lt; count; i++) {&lt;BR /&gt;(void)printf("pid is %d, command is %s\n",pst[i].pst_pid, pst[i].pst_ucomm);&lt;BR /&gt;}&lt;BR /&gt;idx = pst[count-1].pst_idx + 1;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if (count == -1)&lt;BR /&gt;perror("pstat_getproc()");&lt;BR /&gt;}&lt;BR /&gt;#undef BURST&lt;BR /&gt;&lt;BR /&gt;I see no problem on my system. What is your system? do you have the error on compile or on exec?&lt;BR /&gt;How many process do you have?&lt;/SYS&gt;&lt;/SYS&gt;</description>
      <pubDate>Wed, 29 Jun 2005 02:20:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572760#M103535</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2005-06-29T02:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572761#M103536</link>
      <description>Flag -D_PSTAT64 doesn't work;&lt;BR /&gt;I'm working on an Itanium HPUX 11 v 2&lt;BR /&gt;&lt;BR /&gt;I get the error when i execute the program.&lt;BR /&gt;&lt;BR /&gt;This is the complete o/p:&lt;BR /&gt;I added some lines to o/p the pst size and no of processes.&lt;BR /&gt;&lt;BR /&gt;bash-3.00# ./sysinf&lt;BR /&gt;Size of pst 776&lt;BR /&gt;pstat_getproc failed: Value too large to be stored in data type&lt;BR /&gt;&lt;BR /&gt;*** 24 processes, 0 threads running&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Jun 2005 02:49:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572761#M103536</guid>
      <dc:creator>Andreas Tsamis</dc:creator>
      <dc:date>2005-06-29T02:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572762#M103537</link>
      <description>Basically i'm trying to make a "light" version of "top" so i can send selectively data about resources and processes using tcpip to win and other unix machines.</description>
      <pubDate>Wed, 29 Jun 2005 03:20:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572762#M103537</guid>
      <dc:creator>Andreas Tsamis</dc:creator>
      <dc:date>2005-06-29T03:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572763#M103538</link>
      <description>I've just tried program that Laurent posted on 11iv2 itanium box and it worked fine when compiled with -D_PSTAT64 flag. If I don't use this flag error "Value too large" occurs.&lt;BR /&gt;&lt;BR /&gt;$ cc -V&lt;BR /&gt;cc: HP aC++/ANSI C B3910B A.06.02 [Mar 24 2005]&lt;BR /&gt;$ cc -D_PSTAT64 pstat.c&lt;BR /&gt;$ ./a.out&lt;BR /&gt;pid is 0, command is swapper&lt;BR /&gt;pid is 1, command is init&lt;BR /&gt;pid is 8, command is ioconfigd&lt;BR /&gt;pid is 9, command is nfsktcpd&lt;BR /&gt;pid is 10, command is autofskd&lt;BR /&gt;pid is 11, command is lvmkd&lt;BR /&gt;pid is 12, command is lvmkd&lt;BR /&gt;pid is 13, command is lvmkd&lt;BR /&gt;pid is 14, command is lvmkd&lt;BR /&gt;pid is 15, command is lvmkd&lt;BR /&gt;pid is 16, command is lvmkd&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;If this still doesn't work for you try compiling 64-bit binary with +DD64 option to cc.</description>
      <pubDate>Wed, 29 Jun 2005 04:28:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572763#M103538</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2005-06-29T04:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572764#M103539</link>
      <description>Thanks is now working</description>
      <pubDate>Wed, 29 Jun 2005 04:47:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572764#M103539</guid>
      <dc:creator>Andreas Tsamis</dc:creator>
      <dc:date>2005-06-29T04:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572765#M103540</link>
      <description>hi andreas,&lt;BR /&gt;&lt;BR /&gt;This error "pstat_getproc failed: Value too large to be stored in data type" oocours when a 32 bit application running on a 64 bit booted machine...&lt;BR /&gt;&lt;BR /&gt;Check If the machine is booted in 64-bit mode, getconf KERNEL_BITS&lt;BR /&gt;and it  should return "64".&lt;BR /&gt;&lt;BR /&gt;32-bit applications that will be deployed on 64-bit HP-UX must use the&lt;BR /&gt;pstat() wrappers turned on with -D_PSTAT64 in order to function correctly&lt;BR /&gt;and remain compatible on 64-bit HP-UX&lt;BR /&gt;&lt;BR /&gt;Good Luck&lt;BR /&gt;&lt;BR /&gt;Vinod K</description>
      <pubDate>Wed, 29 Jun 2005 04:48:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572765#M103540</guid>
      <dc:creator>vinod_25</dc:creator>
      <dc:date>2005-06-29T04:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with pstat_getproc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572766#M103541</link>
      <description>I just want to let you know that I had the exact same problem.  I was trying to run the tool which you can find at &lt;A href="http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,5944,00.html" target="_blank"&gt;http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,5944,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;After reading this thread, I tried the two solutions.  The -D_PSTAT64 flag didn't work for me; all the process info for all the processes would report the same number.  Like the pid would be the same for all the processes.&lt;BR /&gt;&lt;BR /&gt;But the +DD64 flag made it work perfectly.  Thanks for your help.</description>
      <pubDate>Thu, 19 Jan 2006 15:12:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-pstat-getproc/m-p/3572766#M103541</guid>
      <dc:creator>Leo Lai</dc:creator>
      <dc:date>2006-01-19T15:12:02Z</dc:date>
    </item>
  </channel>
</rss>

