- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Getting CPU number from C program
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 08:48 AM
06-27-2003 08:48 AM
I didn't find any example program or ioctl usage example.
Thank in advance to anyone who knows an answer.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 08:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 09:01 AM
06-27-2003 09:01 AM
Re: Getting CPU number from C program
You have the pstat_getprocesor but it's not
much suported on every unix like OS.
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 09:02 AM
06-27-2003 09:02 AM
Re: Getting CPU number from C program
JRF got the answer. Check the examples section in man pages of pstat_getprocessor().
HTH,
Umapathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 09:03 AM
06-27-2003 09:03 AM
Re: Getting CPU number from C program
#include
#include
#include
#include
#include
int main(int argc, char *argv[])
{
struct pst_processor st;
int id;
for (id=0; pstat_getprocessor(&st, sizeof(st), (size_t)1, id)==1; id++) ;
printf("%d processors by pstat_getprocessor\n", id);
printf("%d processors by pthread_num_processors_np\n",
pthread_num_processors_np());
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 09:07 AM
06-27-2003 09:07 AM
Re: Getting CPU number from C program
Als ocheck this msg:
http://mail.nongnu.org/archive/html/gomp-discuss/2003-02/msg00263.html
There you will find another way to get this
info.
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 09:10 AM
06-27-2003 09:10 AM
Re: Getting CPU number from C program
You may get clock rate with this with "pstat_getprocessor()" function.
twang