<?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: Getting CPU number from C program in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010178#M718669</link>
    <description>Hi,&lt;BR /&gt;You may get clock rate with this with "pstat_getprocessor()" function.&lt;BR /&gt;twang</description>
    <pubDate>Fri, 27 Jun 2003 16:10:03 GMT</pubDate>
    <dc:creator>twang</dc:creator>
    <dc:date>2003-06-27T16:10:03Z</dc:date>
    <item>
      <title>Getting CPU number from C program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010172#M718663</link>
      <description>How can I get number of CPU installed on the system by means of a system call (via C program)?&lt;BR /&gt;I didn't find any example program or ioctl usage example.&lt;BR /&gt;Thank in advance to anyone who knows an answer.</description>
      <pubDate>Fri, 27 Jun 2003 15:48:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010172#M718663</guid>
      <dc:creator>Maurizio_12</dc:creator>
      <dc:date>2003-06-27T15:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Getting CPU number from C program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010173#M718664</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Have a look at 'pstat_getprocessor()'.  Do 'man 2 pstat' for details.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 27 Jun 2003 15:56:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010173#M718664</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-06-27T15:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Getting CPU number from C program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010174#M718665</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;You have the pstat_getprocesor but it's not&lt;BR /&gt;much suported on every unix like OS.&lt;BR /&gt;&lt;BR /&gt;Caesar</description>
      <pubDate>Fri, 27 Jun 2003 16:01:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010174#M718665</guid>
      <dc:creator>Caesar_3</dc:creator>
      <dc:date>2003-06-27T16:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Getting CPU number from C program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010175#M718666</link>
      <description>Maurizio,&lt;BR /&gt;  JRF got the answer. Check the examples section in man pages of pstat_getprocessor().&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Umapathy</description>
      <pubDate>Fri, 27 Jun 2003 16:02:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010175#M718666</guid>
      <dc:creator>Umapathy S</dc:creator>
      <dc:date>2003-06-27T16:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Getting CPU number from C program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010176#M718667</link>
      <description>You can use pstat_getprocessor.  If you are using pthreads, you can also use pthread_num_processors_np.&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;&lt;BR /&gt;#include &lt;PTHREAD.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;    struct pst_processor st;&lt;BR /&gt;    int id;&lt;BR /&gt;    for (id=0; pstat_getprocessor(&amp;amp;st, sizeof(st), (size_t)1, id)==1; id++) ;&lt;BR /&gt;    printf("%d processors by pstat_getprocessor\n", id);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;    printf("%d processors by pthread_num_processors_np\n",&lt;BR /&gt; pthread_num_processors_np());&lt;BR /&gt;    return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/PTHREAD.H&gt;&lt;/STDIO.H&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/SYS&gt;</description>
      <pubDate>Fri, 27 Jun 2003 16:03:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010176#M718667</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2003-06-27T16:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Getting CPU number from C program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010177#M718668</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;Als ocheck this msg:&lt;BR /&gt;&lt;A href="http://mail.nongnu.org/archive/html/gomp-discuss/2003-02/msg00263.html" target="_blank"&gt;http://mail.nongnu.org/archive/html/gomp-discuss/2003-02/msg00263.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There you will find another way to get this&lt;BR /&gt;info.&lt;BR /&gt;&lt;BR /&gt;Caesar</description>
      <pubDate>Fri, 27 Jun 2003 16:07:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010177#M718668</guid>
      <dc:creator>Caesar_3</dc:creator>
      <dc:date>2003-06-27T16:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Getting CPU number from C program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010178#M718669</link>
      <description>Hi,&lt;BR /&gt;You may get clock rate with this with "pstat_getprocessor()" function.&lt;BR /&gt;twang</description>
      <pubDate>Fri, 27 Jun 2003 16:10:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-cpu-number-from-c-program/m-p/3010178#M718669</guid>
      <dc:creator>twang</dc:creator>
      <dc:date>2003-06-27T16:10:03Z</dc:date>
    </item>
  </channel>
</rss>

