提交 0d03735f 编写于 作者: E Eric Blake

build: work with glibc that lacks CPU_COUNT

Building on RHEL 5 warned:

nodeinfo.c: 305: warning: implicit declaration of function 'CPU_COUNT'

This extension macro in <sched.h> was not added until later glibc.

* src/nodeinfo.c (CPU_COUNT): Add fallback implementation.
上级 77de1f35
......@@ -184,6 +184,19 @@ virNodeParseSocket(const char *dir, unsigned int cpu)
return ret;
}
# ifndef CPU_COUNT
static int
CPU_COUNT(cpu_set_t *set)
{
int i, count = 0;
for (i = 0; i < CPU_SETSIZE; i++)
if (CPU_ISSET(i, set))
count++;
return count;
}
# endif /* !CPU_COUNT */
/* parses a node entry, returning number of processors in the node and
* filling arguments */
static int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册