lib: c: add fallback errno storage for single-threaded programs
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#ifndef ERRNO_H_
|
||||
#define ERRNO_H_
|
||||
|
||||
#define errno (*__errno_location())
|
||||
|
||||
#define SUCCESS 0 /* Success */
|
||||
#define EPERM 1 /* Operation not permitted */
|
||||
#define ENOENT 2 /* No such file or directory */
|
||||
@@ -142,4 +144,6 @@
|
||||
extern int __set_errno(int err);
|
||||
extern int __errno_from_kern_status(unsigned int err);
|
||||
|
||||
extern int __attribute__((weak)) * __errno_location(void);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user