summaryrefslogtreecommitdiffstats
path: root/lib/cpuset.c
diff options
context:
space:
mode:
authorSamuel Thibault2012-08-08 17:19:43 +0200
committerKarel Zak2012-08-13 15:14:13 +0200
commit4797b1e5928219864215c7b7cf9e6d023e345675 (patch)
tree3bc7d410acb2ccffac9335eae57a32f3bd7940fa /lib/cpuset.c
parentfdisk: aix: fix warning (diff)
downloadkernel-qcow2-util-linux-4797b1e5928219864215c7b7cf9e6d023e345675.tar.gz
kernel-qcow2-util-linux-4797b1e5928219864215c7b7cf9e6d023e345675.tar.xz
kernel-qcow2-util-linux-4797b1e5928219864215c7b7cf9e6d023e345675.zip
Fix non-Linux build
loopdev.c, test_pager, and get_max_number_of_cpus() are linux-specific. get_linux_version will only work on Linux, let's introduce system_supports_ext4_ext2() which assumes that mounting ext2 with ext4 is not supported on non-Linux systems. [kzak@redhat.com: - use #ifdef SYS_sched_getaffinity rather than __linux__] Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/cpuset.c')
-rw-r--r--lib/cpuset.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/cpuset.c b/lib/cpuset.c
index 78efd5302..26b0a90b7 100644
--- a/lib/cpuset.c
+++ b/lib/cpuset.c
@@ -59,6 +59,7 @@ static const char *nexttoken(const char *q, int sep)
*/
int get_max_number_of_cpus(void)
{
+#ifdef SYS_sched_getaffinity
int n, cpus = 2048;
size_t setsize;
cpu_set_t *set = cpuset_alloc(cpus, &setsize, NULL);
@@ -83,6 +84,7 @@ int get_max_number_of_cpus(void)
cpuset_free(set);
return n * 8;
}
+#endif
return -1;
}