diff --git a/CMakeLists.txt b/CMakeLists.txt index 9adba1f..5374f29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -project(FxLibc VERSION 1.4.1 LANGUAGES C ASM) +project(FxLibc VERSION 1.4.3 LANGUAGES C ASM) set(CMAKE_INSTALL_MESSAGE LAZY) @@ -259,18 +259,6 @@ if(sh-generic IN_LIST TARGET_FOLDERS) target_include_directories(fxlibc PRIVATE "${FXSDK_COMPILER_INSTALL}/include/openlibm") endif() -if(FXLIBC_SHARED) - target_compile_options(fxlibc PRIVATE -fPIC) - - if("${FXLIBC_ARCH}" STREQUAL "sh") - # Original command: "ar qc ; ranlib " - set(CMAKE_C_CREATE_STATIC_LIBRARY - "sh-elf-ld -shared -o ") - else() - message(SEND_ERROR "TODO: Shared vhex on non-SuperH not available yet") - endif() -endif() - foreach(FOLDER IN LISTS TARGET_FOLDERS) target_include_directories(fxlibc PRIVATE include/target/${FOLDER}/) endforeach() diff --git a/include/errno.h b/include/errno.h index 1f412f5..023b41b 100644 --- a/include/errno.h +++ b/include/errno.h @@ -28,6 +28,10 @@ extern int errno; #define ENOTEMPTY 17 /* Directory is not empty. */ #define EINTR 18 /* Interrupted system call. */ #define EAGAIN 19 /* Resource temporarily unavailable. */ +#define EIO 20 /* Input/Output error */ +#define ENODEV 21 /* No such device */ +#define ENOMEDIUM 22 /* No medium found */ +#define EMEDIUMTYPE 23 /* Wrong medium type */ #ifdef __cplusplus } diff --git a/include/target/vhex/bits/confname.h b/include/target/vhex/bits/confname.h new file mode 100644 index 0000000..39733dc --- /dev/null +++ b/include/target/vhex/bits/confname.h @@ -0,0 +1,7 @@ +#ifndef __BITS_CONFNAME_H__ +# define __BITS_CONFNAME_H__ + +#define _SC_PAGE_SIZE 0 +#define _SC_PAGESIZE _SC_PAGE_SIZE + +#endif /*__BITS_CONFNAME_H__*/ diff --git a/include/target/vhex/bits/exit.h b/include/target/vhex/bits/exit.h new file mode 100644 index 0000000..30e4207 --- /dev/null +++ b/include/target/vhex/bits/exit.h @@ -0,0 +1,8 @@ +#ifndef __BITS_EXIT_H__ +# define __BITS_EXIT_H__ + +/* Exit codes for CASIOWIN add-ins. */ +#define EXIT_SUCCESS 1 +#define EXIT_FAILURE 0 + +#endif /*__BITS_EXIT_H__*/ diff --git a/include/target/vhex/bits/signum.h b/include/target/vhex/bits/signum.h new file mode 100644 index 0000000..a340352 --- /dev/null +++ b/include/target/vhex/bits/signum.h @@ -0,0 +1,20 @@ +#ifndef __BITS_SIGNUM_H__ +# define __BITS_SIGNUM_H__ + +// Define the number of signals +#define _NSIG 16 + +/* Fake signal functions. */ +#define SIG_ERR ((__sighandler_t) -1) /* Error return. */ +#define SIG_DFL ((__sighandler_t) 0) /* Default action. */ +#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */ + +/* ISO C99 signals. */ +#define SIGINT 2 /* Interactive attention signal. */ +#define SIGILL 4 /* Illegal instruction. */ +#define SIGABRT 6 /* Abnormal termination. */ +#define SIGFPE 8 /* Erroneous arithmetic operation. */ +#define SIGSEGV 11 /* Invalid access to storage. */ +#define SIGTERM 15 /* Termination request. */ + +#endif /*__BITS_SIGNUM_H__*/ diff --git a/include/target/vhex/bits/types/DIR.h b/include/target/vhex/bits/types/DIR.h new file mode 100644 index 0000000..4b61693 --- /dev/null +++ b/include/target/vhex/bits/types/DIR.h @@ -0,0 +1,12 @@ +#ifndef __BITS_TYPES_DIR_H__ +# define __BITS_TYPES_DIR_H__ + +#include +#include + +typedef struct { + /* Associated directory descriptor */ + int fd; +} DIR; + +#endif /*__BITS_TYPES_DIR_H__*/ diff --git a/src/string/strerror.c b/src/string/strerror.c index e7315a3..1a372dc 100644 --- a/src/string/strerror.c +++ b/src/string/strerror.c @@ -20,6 +20,11 @@ static char *errno_strings [] = { [EISDIR] = "Is a directory", [ENOTDIR] = "Not a directory", [ENOTEMPTY] = "Directory not empty", + [EINTR] = "Interrupted system call", + [EAGAIN] = "Resource temporarily unavailable", + [EIO] = "Input/output error", + [ENOMEDIUM] = "No medium found", + [EMEDIUMTYPE] = "Wrong medium type", }; char *strerror(int e)