Compare commits
6 Commits
6507146c60
...
f13c48b562
Author | SHA1 | Date | |
---|---|---|---|
f13c48b562 | |||
7139b4403f | |||
e3e33bacbc | |||
8d552b1522 | |||
46f60b192a | |||
9aa96de61d |
@ -13,6 +13,7 @@ extern int errno;
|
||||
#define EISDIR 21 // Is a directory
|
||||
#define EINVAL 22 // Invalid argument
|
||||
#define EMFILE 24 // Too many open files
|
||||
#define EPIPE 32 // Broken pipe. Not implemented.
|
||||
#define ENOSYS 38 // Function not implemented
|
||||
|
||||
#endif
|
21
libs/libc/include/inttypes.h
Normal file
21
libs/libc/include/inttypes.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef _INTTYPES_H
|
||||
#define _INTTYPES_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define PRId8 "%d"
|
||||
#define PRId16 "%d"
|
||||
#define PRId32 "%d"
|
||||
#define PRId64 "%ld"
|
||||
#define PRIdLEAST8 "%d"
|
||||
#define PRIdLEAST16 "%d"
|
||||
#define PRIdLEAST32 "%d"
|
||||
#define PRIdLEAST64 "%ld"
|
||||
#define PRIdFAST8 "%d"
|
||||
#define PRIdFAST16 "%d"
|
||||
#define PRIdFAST32 "%d"
|
||||
#define PRIdFAST64 "%ld"
|
||||
#define PRIdMAX "%ld"
|
||||
#define PRIdPTR "%ld"
|
||||
|
||||
#endif
|
16
libs/libc/include/libgen.h
Normal file
16
libs/libc/include/libgen.h
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef _LIBGEN_H
|
||||
#define _LIBGEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
char* basename(char*); // Not implemented.
|
||||
char* dirname(char*); // Not implemented.
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
23
libs/libc/include/setjmp.h
Normal file
23
libs/libc/include/setjmp.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef _SETJMP_H
|
||||
#define _SETJMP_H
|
||||
|
||||
#include <bits/macros.h>
|
||||
|
||||
typedef int jmp_buf[1];
|
||||
typedef int sigjmp_buf[1];
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
int setjmp(jmp_buf env); // Not implemented.
|
||||
int sigsetjmp(sigjmp_buf env, int savesigs); // Not implemented.
|
||||
__lc_noreturn void longjmp(jmp_buf env, int val); // Not implemented.
|
||||
__lc_noreturn void siglongjmp(sigjmp_buf env, int val); // Not implemented.
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
7
libs/libc/include/signal.h
Normal file
7
libs/libc/include/signal.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef _SIGNAL_H
|
||||
#define _SIGNAL_H
|
||||
|
||||
typedef int sig_atomic_t; // FIXME: Implement signals (I'm trying to build bc, this header is only to satisfy it) and
|
||||
// use a proper atomic integer type.
|
||||
|
||||
#endif
|
15
libs/libc/src/libgen.cpp
Normal file
15
libs/libc/src/libgen.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include <libgen.h>
|
||||
#include <luna.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
char* basename(char*)
|
||||
{
|
||||
NOT_IMPLEMENTED("basename");
|
||||
}
|
||||
|
||||
char* dirname(char*)
|
||||
{
|
||||
NOT_IMPLEMENTED("dirname");
|
||||
}
|
||||
}
|
25
libs/libc/src/setjmp.cpp
Normal file
25
libs/libc/src/setjmp.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include <luna.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
int setjmp(jmp_buf)
|
||||
{
|
||||
NOT_IMPLEMENTED("setjmp");
|
||||
}
|
||||
|
||||
int sigsetjmp(sigjmp_buf, int)
|
||||
{
|
||||
NOT_IMPLEMENTED("sigsetjmp");
|
||||
}
|
||||
|
||||
__lc_noreturn void longjmp(jmp_buf, int)
|
||||
{
|
||||
NOT_IMPLEMENTED("longjmp");
|
||||
}
|
||||
|
||||
__lc_noreturn void siglongjmp(sigjmp_buf, int)
|
||||
{
|
||||
NOT_IMPLEMENTED("siglongjmp");
|
||||
}
|
||||
}
|
@ -176,7 +176,7 @@ extern "C"
|
||||
case ENOEXEC: return "Exec format error";
|
||||
case EFAULT: return "Bad address";
|
||||
case 0: return "Success";
|
||||
default: return (char*)(unsigned long int)err;
|
||||
default: return "Unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user