sgx/enclaveshim_ecalls.c
// NOTE: thread, attr should be allocated outside the enclave
thread, attr should be allocated outside the enclave
thread attr should be allocated outside the enclave
int enclaveshim_thread_create(thread_t *thread, const thread_attr_t *attr, void *start_routine, void *arg) {
    int ret;
    struct thread_info *tinfo = malloc(sizeof(*tinfo));
    tinfo->start_routine = start_routine;
    tinfo->arg = arg;
    ret = pthread_create(thread, attr, &thread_start, tinfo);
    tinfo->thread_id = *thread;
    return ret;
}
int enclaveshim_thread_create ( thread_t * thread , const thread_attr_t * attr , void * start_routine , void * arg ) { int ret ; struct thread_info * tinfo = malloc ( sizeof ( * tinfo ) ) ; tinfo -> start_routine = start_routine ; tinfo -> arg = arg ; ret = pthread_create ( thread , attr , & thread_start , tinfo ) ; tinfo -> thread_id = * thread ; return ret ; }
NOTE: thread, attr should be allocated outside the enclave
NOTE : thread attr should be allocated outside the enclave