| 141 | |
| 142 | // Make sure __clone is not called without pthread_create. |
| 143 | extern "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 | |
| 164 | extern "C" long |
| 165 | clone3(struct clone_args *cl_args, size_t size) |
no test coverage detected