• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #define _GNU_SOURCE
2 #include <stdarg.h>
3 #include <unistd.h>
4 #include <sched.h>
5 #include "pthread_impl.h"
6 #include "syscall.h"
7 #include <unsupported_api.h>
8 
clone(int (* func)(void *),void * stack,int flags,void * arg,...)9 int clone(int (*func)(void *), void *stack, int flags, void *arg, ...)
10 {
11 	va_list ap;
12 	pid_t *ptid, *ctid;
13 	void  *tls;
14 
15 	unsupported_api(__FUNCTION__);
16 	va_start(ap, arg);
17 	ptid = va_arg(ap, pid_t *);
18 	tls  = va_arg(ap, void *);
19 	ctid = va_arg(ap, pid_t *);
20 	va_end(ap);
21 
22 	return __syscall_ret(__clone(func, stack, flags, arg, ptid, tls, ctid));
23 }
24