RE: FC5 system() call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Even assuming you mean 

int num_proc = system("cat /proc/cpuinfo | grep -c processor >>
/dev/null 2>&1");

I dont see how this will give you the # of cpus.

num-proc will only contain the status of the system call, not the result
of the grep, wont it?

You're right, it's giving me the return value from grep, which is 0.  I
need the string printed by grep ... How can I get this???



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux