errno value reliability

Hello All, Whenever a system call returns error, it will set the errno variable to the appropriate reason. But how far is this value reliable in case of multi threaded/ multi task environment? As there is always a possibility of context switch and hence some other task/ thread might change this value so it may not be valid at all!! Is there any standard to avoid this problem?

Thank you, Kaushal

Reply to
krishna
Loading thread data ...

Hi Kaushal.

set the

Not a problem since errno is in thread-local storage. See /usr/include/bits/errno.h.

Steve

Reply to
steve_schefter

l set the

Oh got it! Thanks Steve.

-Kaushal.

Reply to
Kaushal Rampalli

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.