Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » BSDs: Is there "int get_nprocs (void)"
Re: BSDs: Is there "int get_nprocs (void)" [message #10878 is a reply to message #10865] Thu, 02 August 2007 11:02 Go to previous messageGo to previous message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
On Net-, Open-, DragonflyBSD one must use sysctl system call like that:

int mib[2], maxproc;
size_t len;

mib[0] = CTL_HW;
mib[1] = HW_NCPU;
len = sizeof(maxproc);
sysctl(mib, 2, &maxproc, &len, NULL, 0);


But then the kernel sources have to be installed and the following files have to be included:
<sys/systctl.h> and <sys/param.h> on Net-, OpenBSD and <sys/types.h> on DragonflyBSD.

Matthias

[Updated on: Thu, 02 August 2007 11:27]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Package Problem with Ubuntu 7.04
Next Topic: Win_CE
Goto Forum:
  


Current Time: Sat Apr 27 10:58:22 CEST 2024

Total time taken to generate the page: 0.05097 seconds