MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / __clone

Function __clone

src/threadwrappers.cpp:143–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141
142// Make sure __clone is not called without pthread_create.
143extern "C" int
144__clone(int (*fn)(void *arg),
145 void *child_stack,
146 int flags,
147 void *arg,
148 int *parent_tidptr,
149 struct user_desc *newtls,
150 int *child_tidptr)
151{
152 Thread *thread = dmtcp_get_current_thread();
153 if (thread->state == ST_THREAD_CREATE) {
154 return _real_clone(
155 fn, child_stack, flags, arg, parent_tidptr, newtls, child_tidptr);
156 }
157
158 JASSERT(false)
159 .Text("Thread-creation with clone syscall isn't supported.");
160
161 return 0;
162}
163
164extern "C" long
165clone3(struct clone_args *cl_args, size_t size)

Callers 1

syscallFunction · 0.85

Calls 2

dmtcp_get_current_threadFunction · 0.85
_real_cloneFunction · 0.70

Tested by

no test coverage detected