mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibC: Make "errno" thread-specific
Now that the kernel supports thread-local storage, we can declare errno with the __thread keyword, which causes it to be per-thread. This should fix all the stupid issues that happen when many threads use the same errno. :^)
This commit is contained in:
parent
ec6bceaa08
commit
af14b8dc59
Notes:
sideshowbarker
2024-07-19 12:14:48 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/af14b8dc592
2 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ extern "C" {
|
|||
|
||||
int main(int, char**);
|
||||
|
||||
int errno;
|
||||
__thread int errno;
|
||||
char** environ;
|
||||
bool __environ_is_malloced;
|
||||
|
||||
|
|
|
@ -17,6 +17,6 @@ __BEGIN_DECLS
|
|||
|
||||
extern const char* sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
extern int errno;
|
||||
extern __thread int errno;
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Reference in a new issue