Messages in this thread | | | Subject | Re: system call for finding the number of cpus?? | From | Robert Love <> | Date | 08 Apr 2002 17:25:08 -0400 |
| |
On Mon, 2002-04-08 at 17:18, Kuppuswamy, Priyadarshini wrote:
> I have a script that is using the /cpu/procinfo file to determine the > number of cpus present in the system. But I would like to implement it > using a system call rather than use the environment variables?? I couldn't > find a system call for linux that would give me the result. Could anyone > please let me know if there is one for redhat linux??
Linux does not implement such a syscall. Note
cat /proc/cpuinfo | grep processor | wc -l
works and is simple; you do not have to do it via script - execute it in your C program, save the one-line output, and atoi() it.
Robert Love
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |