Main Page | Report this Page
Linux Forum Index  »  Linux Embedded  »  errno value reliability...
Page 1 of 1    

errno value reliability...

Author Message
krishna...
Posted: Tue Jul 07, 2009 10:46 pm
Guest
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
 
...
Posted: Wed Jul 08, 2009 3:29 am
Guest
Hi Kaushal.

Quote:
             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?

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

Steve
 
Kaushal Rampalli...
Posted: Wed Jul 08, 2009 8:34 pm
Guest
On Jul 8, 6:29 pm, steve_schef... at (no spam) hotmail.com wrote:
Quote:
Hi Kaushal.

             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?

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

       Steve

Oh got it! Thanks Steve.

-Kaushal.
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Wed Nov 25, 2009 3:42 pm