errno: add the errno variable and base macros
A <bits/errno.h> file will likely by added later on for each target to add more specific values.
This commit is contained in:
parent
c87805ef10
commit
5f48a6b4e0
|
@ -73,6 +73,7 @@ set(SOURCES
|
|||
src/libc/ctype/isxdigit.c
|
||||
src/libc/ctype/tolower.c
|
||||
src/libc/ctype/toupper.c
|
||||
src/libc/errno/errno.c
|
||||
src/libc/locale/setlocale.c
|
||||
src/libc/locale/localeconv.c
|
||||
src/libc/stdio/vsnprintf.c
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef __ERRNO_H__
|
||||
# define __ERRNO_H__
|
||||
|
||||
/* Initialized to 0 at startup. Currently not TLS, maybe in the future if
|
||||
threads are supported. */
|
||||
extern int errno;
|
||||
|
||||
#define EDOM 1
|
||||
#define EILSEQ 2
|
||||
#define ERANGE 3
|
||||
|
||||
#endif /*__ERRNO_H__*/
|
|
@ -0,0 +1,4 @@
|
|||
#include <errno.h>
|
||||
|
||||
/* The initial value is 0 at program startup */
|
||||
int errno = 0;
|
Loading…
Reference in New Issue