The errno "variable" is required to be thread-specific. It gets defined to a macro which dereferences a pointer returned by a kernel function. In user mode, we cannot simply read/write the thread struct. We do not have thread-local storage mechanism, so for now use the lowest address of the thread stack to store this value, since this is guaranteed to be read/writable by a user thread. The downside of this approach is potential stack corruption if the stack pointer goes down this far but does not exceed the location, since a fault won't be generated in this case. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| libc-hooks.c | ||