Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset fde2982c in mainline


Ignore:
Timestamp:
2011-04-21T14:14:47Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
d161715
Parents:
a7dbd49
Message:

use thread/fibril-safe errno

Location:
uspace/lib/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/errno.c

    ra7dbd49 rfde2982c  
    3636#include <fibril.h>
    3737
    38 int _errno;
     38static fibril_local int fibril_errno;
     39
     40int *__errno(void)
     41{
     42        return &fibril_errno;
     43}
    3944
    4045/** @}
  • uspace/lib/c/include/errno.h

    ra7dbd49 rfde2982c  
    3939#include <fibril.h>
    4040
    41 #define errno _errno
     41#define errno  (*(__errno()))
    4242
    43 extern int _errno;
     43extern int *__errno(void) __attribute__((const));
    4444
    4545#define EMFILE        (-18)
Note: See TracChangeset for help on using the changeset viewer.