Question: Error Handling ~~~~~~~~~~~~~~ How is error reporting different for the pthread library functions when compared to the C library functions we've learned in the past?

Error Handling
~~~~~~~~~~~~~~
How is error reporting different for the pthread library functions when
compared to the C library functions we've learned in the past?
-() The pthread functions return 0 on error and -1 on success, the opposite
of what we've seen before.
-() The pthread functions don't set 'errno', so we have no way of reporting
the underlying reason for the failure as we did with 'perror()' before.
-() The pthread functions don't set 'errno', so we use 'strerror()' on the
returned value to report the underlying cause of a failure.
-() Trick question: Error reporting is the same as usual for the pthread
library questions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!