1 // sched_cpualloc(0) should return unique pointers
2 // (often expected and gnulib replaces sched_cpualloc if sched_cpualloc(0) returns 0)
3 #include <stdlib.h>
4 #include <sched.h>
5 #include "test.h"
6 
main(void)7 int main(void)
8 {
9 	cpu_set_t *p = __sched_cpualloc(0);
10 	cpu_set_t *q = __sched_cpualloc(0);
11 	cpu_set_t *r = __sched_cpualloc(0);
12 	if (!p || !q || !r)
13 		t_error("sched_cpualloc(0) returned NULL\n");
14 	if (p == q || p == r || q == r)
15 		t_error("sched_cpualloc(0) returned non-unique pointers: %p, %p, %p\n", p, q, r);
16 	free(q);
17 	free(p);
18 	free(r);
19 	return t_status;
20 }
21