0ad/source/lib/sysdep/unix/ucpu.cpp
janwas 73683b6109 # SwEng
. the massive renaming undertaking: camelCase functions -> PascalCase.
. add some cppdoc.
. minor additional renaming improvements: e.g. GetIsClosed -> IsClosed
. in entity code, replace constructs like "pvec = new vector; return
pvec; use *pvec; delete pvec" with a simple stack variable passed as
output parameter (avoid unnecessary dynamic allocs)
. timer: simpler handling of raw ticks vs normal timer (less #if)

This was SVN commit r5017.
2007-05-02 12:07:08 +00:00

53 lines
801 B
C++

#include "precompiled.h"
#include "ucpu.h"
int ucpu_IsThrottlingPossible()
{
return -1; // don't know
}
int ucpu_NumPackages()
{
long res = sysconf(_SC_NPROCESSORS_CONF);
if (res == -1)
return 1;
else
return (int)res;
}
double ucpu_ClockFrequency()
{
return -1; // don't know
}
// apparently not possible on non-Windows OSes because they seem to lack
// a CPU affinity API. see sysdep.h comment.
LibError ucpu_CallByEachCPU(CpuCallback cb, void* param)
{
UNUSED2(cb);
/*
cpu_set_t currentCPU;
while ( j < sysNumProcs )
{
CPU_ZERO(&currentCPU);
CPU_SET(j, &currentCPU);
if ( sched_setaffinity (0, sizeof (currentCPU), &currentCPU)
== 0 )
{
sleep(0); // Ensure system to switch to the right
*/
return ERR::NO_SYS;
}