| Linux Forum Index » Linux Embedded » errno value reliability... |
|
Page 1 of 1 |
|
| 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 |
|
|
| Back to top |
|
|
|
| ... |
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 |
|
|
| Back to top |
|
|
|
| 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. |
|
|
| Back to top |
|
|
|
|