[CRIU] [PATCH 7/9] seccomp: test -- Add seccomp_filter_threads

Dmitry Safonov 0x7f454c46 at gmail.com
Fri May 4 22:51:32 MSK 2018


2018-04-26 21:14 GMT+01:00 Cyrill Gorcunov <gorcunov at gmail.com>:
[..]
> +       if (pid == 0) {
> +               pthread_t thread;
> +               void *p = NULL;
> +
> +               zdtm_seccomp = 1;
> +
> +               pthread_create(&thread, NULL, thread_main, NULL);
> +               if (pthread_join(thread, &p) != 0) {
> +                       pr_perror("pthread_join");
> +                       exit(1);
> +               }
> +
> +               syscall(__NR_exit, p);

Hmm.
a) why syscall() and not _exit()?
b) (void *p) is 64-bit long on 64-bit platfoms, exit() has (int)
parameter == 32-bit long.
  Does this work as expected without a cast?

Thanks,
             Dmitry


More information about the CRIU mailing list