]> granicus.if.org Git - strace/blobdiff - affinity.c
travis: add build environment information to the travis log
[strace] / affinity.c
index 6e347dddded1c328e529d6153bf79b1d30997eb9..0eb109404c0b8ae5acf79f2a83882d0e66f1aee3 100644 (file)
@@ -47,10 +47,9 @@ get_cpuset_size(void)
                 * the kernel and find out the minimal valid cpuset size
                 * without allocating any memory for the CPU affinity mask.
                 */
-               pid_t pid = getpid();
                cpuset_size = 128;
                while (cpuset_size &&
-                      sched_getaffinity(pid, cpuset_size, NULL) == -1 &&
+                      sched_getaffinity(0, cpuset_size, NULL) == -1 &&
                       EINVAL == errno) {
                        cpuset_size <<= 1;
                }
@@ -62,7 +61,8 @@ get_cpuset_size(void)
 }
 
 static void
-print_affinitylist(struct tcb *tcp, const unsigned long addr, const unsigned int len)
+print_affinitylist(struct tcb *const tcp, const kernel_ulong_t addr,
+                  const unsigned int len)
 {
        const unsigned int max_size = get_cpuset_size();
        const unsigned int umove_size = len < max_size ? len : max_size;