summaryrefslogtreecommitdiff
path: root/src/sysdeps/tryclonenewpid.c
blob: 1a1401a80dc4b896cf9224b6ccfbf4f1d675b782 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* ISC license. */

#undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

#include <sched.h>
#include <sys/syscall.h>
#include <stdint.h>
#include <unistd.h>

struct clone_args
{
  uint64_t flags ;
  uint64_t pidfd ;
  uint64_t child_tid ;
  uint64_t parent_tid ;
  uint64_t exit_signal ;
  uint64_t stack ;
  uint64_t stack_size ;
  uint64_t tls ;
  uint64_t set_tid ;
  uint64_t set_tid_size ;
  uint64_t cgroup ;
} ;

int main (void)
{
  struct clone_args args = { 0 } ;
  args.flags = CLONE_NEWPID ;
  syscall(SYS_clone3, &args, sizeof(struct clone_args)) ;
  return 0 ;
}