The error message most propably is wrong, as the pthread_*
family of functions does not set errno
. The error code is returned by the functions.
So mod you code like this:
int scannerThreadReturnValue = pthread_create(&parserThreadHandle, &attr, parserThread, (void*)filename);
if (scannerThreadReturnValue != 0)
{
printf("Unable to create thread: %s\n", strerror(scannerThreadReturnValue));
}
else
{
printf("Parser thread creation successful.\n");
}
This will give you the correct error message.