1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00

Add libc header <errno.h> (#111)

This commit is contained in:
Alex Kotov 2022-11-27 04:31:17 +04:00 committed by GitHub
parent 86542dbef8
commit 666b2cdc7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 0 deletions

View file

@ -79,6 +79,7 @@ zero). Work-in-progress APIs can change at any time.
* [Example: vsnprintf](/examples/printf_str_va.c) * [Example: vsnprintf](/examples/printf_str_va.c)
* libc replacement (*work in progress*) * libc replacement (*work in progress*)
* [ctype.h](/libc/include/ctype.h) * [ctype.h](/libc/include/ctype.h)
* [errno.h](/libc/include/errno.h)
* [inttypes.h](/libc/include/inttypes.h) * [inttypes.h](/libc/include/inttypes.h)
* [setjmp.h](/libc/include/setjmp.h) * [setjmp.h](/libc/include/setjmp.h)
* [stdlib.h](/libc/include/stdlib.h) * [stdlib.h](/libc/include/stdlib.h)

View file

@ -10,6 +10,7 @@ endif
libc_la_SOURCES = \ libc_la_SOURCES = \
src/ctype.c \ src/ctype.c \
src/errno.c \
src/stdlib.c \ src/stdlib.c \
src/string.c src/string.c

View file

@ -1,5 +1,6 @@
nobase_include_HEADERS = \ nobase_include_HEADERS = \
ctype.h \ ctype.h \
errno.h \
inttypes.h \ inttypes.h \
setjmp.h \ setjmp.h \
stdlib.h \ stdlib.h \

16
libc/include/errno.h Normal file
View file

@ -0,0 +1,16 @@
#ifndef _ERRNO_H
#define _ERRNO_H 1
#ifdef __cplusplus
extern "C" {
#endif
#define ERANGE 1
extern int errno;
#ifdef __cplusplus
}
#endif
#endif

7
libc/src/errno.c Normal file
View file

@ -0,0 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <errno.h>
int errno = 0;