If an error condition occurs, no thread is created, the contents of thread are undefined, and this routine returns an integer value indicating the type of error. Return Description 0 Successful completion. The system lacks the necessary resources to create another thread, or the system-imposed limit on the total number of threads under execution by a single user is exceeded. The value specified by attr is invalid.
Insufficient memory exists to create a thread.
The caller does not have the appropriate permission to create a thread with the specified attributes.