The pthread_create function creates a thread with the attributes specified in attr. If attr is NULL then the default attributes are used. The new thread starts execution in start_routine, which is passed the single specified argument.
If the pthread_create function succeeds it returns 0 and puts the new thread id into thread, otherwise it returns -1 and sets an error number as follows:
EAGAIN if there is insufficient memory to create another thread |
ENOMEM if there is insufficient memory for the thread's stack |
EINVAL if a value specified by attr is invalid |