--- /dev/null
+/*
+ */
+#ifndef _ACESS_INTDEFS_H_
+#define _ACESS_INTDEFS_H_
+
+#define INT_MIN -0x80000000
+#define INT_MAX 0x7FFFFFFF
+
+typedef unsigned char __uint8_t;
+typedef unsigned short __uint16_t;
+typedef unsigned int __uint32_t;
+typedef unsigned long long __uint64_t;
+
+typedef signed char __int8_t;
+typedef signed short __int16_t;
+typedef signed int __int32_t;
+typedef signed long long __int64_t;
+
+#if ARCHDIR_is_x86
+typedef __int32_t __intptr_t;
+typedef __uint32_t __uintptr_t;
+#elif ARCHDIR_is_x86_64
+typedef __int64_t __intptr_t;
+typedef __uint64_t __uintptr_t;
+#elif ARCHDIR_is_armv7
+typedef __int32_t __intptr_t;
+typedef __uint32_t __uintptr_t;
+#else
+# error "Unknown pointer size"
+#endif
+
+//typedef uint64_t off_t;
+
+#endif
+
// TODO: Fully implement errno.h, make sure it matches the kernel one
+extern int _errno;
#define errno _errno
#define strerror(_x) "Unimplemented"
enum
{
- EINVAL
+ EOK,
+ EINVAL,
+ ERANGE,
+ ENODEV,
+ EBADF,
+ EINTR,
+ EAGAIN,
+ ENOMEM,
+
+ EADDRNOTAVAIL,
+ EINPROGRESS,
+
+ E_LAST
};
#endif
#ifndef _SIGNAL_H_
#define _SIGNAL_H_
+#define SIG_DFL ((void*)0)
+#define SIG_ERR ((void*)-1)
+#define SIGABRT 6
+
+#define SIGPIPE 1001
+#define SIGCHLD 1002
#endif
#ifndef _STDINT_H_
#define _STDINT_H_
+#include "acess/intdefs.h"
+
#define INT_MIN -0x80000000
#define INT_MAX 0x7FFFFFFF
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned long long uint64_t;
-
-typedef signed char int8_t;
-typedef signed short int16_t;
-typedef signed int int32_t;
-typedef signed long long int64_t;
+typedef __uint8_t uint8_t;
+typedef __uint16_t uint16_t;
+typedef __uint32_t uint32_t;
+typedef __uint64_t uint64_t;
+typedef __int8_t int8_t;
+typedef __int16_t int16_t;
+typedef __int32_t int32_t;
+typedef __int64_t int64_t;
-#if ARCHDIR_is_x86
-typedef int32_t intptr_t;
-typedef uint32_t uintptr_t;
-#elif ARCHDIR_is_x86_64
-typedef int64_t intptr_t;
-typedef uint64_t uintptr_t;
-#elif ARCHDIR_is_armv7
-typedef int32_t intptr_t;
-typedef uint32_t uintptr_t;
-#else
-# error "Unknown pointer size"
-#endif
+typedef __intptr_t intptr_t;
+typedef __uintptr_t uintptr_t;
//typedef uint64_t off_t;
/* === CONSTANTS === */
#define EOF (-1)
+#define BUFSIZ 1024
/* --- Standard IO --- */
extern int printf(const char *format, ...);
#ifndef _SYS_STAT_H_
#define _SYS_STAT_H_
-#include <stdint.h> /* Evil */
-#include <stddef.h>
+#include <acess/intdefs.h> /* Evil */
+#include "../stddef.h"
+;
typedef void *dev_t; /* TODO: How to identify a device with Acess */
-typedef uint64_t ino_t;
+typedef __uint64_t ino_t;
typedef unsigned int blksize_t;
-typedef uint64_t blkcnt_t;
+typedef __uint64_t blkcnt_t;
typedef unsigned int nlink_t;
-typedef uint32_t mode_t;
+typedef __uint32_t mode_t;
-typedef uint32_t uid_t;
-typedef uint32_t gid_t;
+typedef __uint32_t uid_t;
+typedef __uint32_t gid_t;
#define S_IFMT 0170000 /* type of file */
#define S_IFDIR 0040000 /* directory */
#ifndef _SYS_TYPES_H
#define _SYS_TYPES_H
+#include <acess/intdefs.h>
+
typedef struct stat t_fstat;
#define FD_SETSIZE 128
extern void FD_SET(int fd, fd_set *fdsetp);
extern int FD_ISSET(int fd, fd_set *fdsetp);
+typedef __uint8_t u_int8_t;
+typedef __uint16_t u_int16_t;
+typedef __uint32_t u_int32_t;
+
#include "../sys/stat.h"
#endif
#ifndef _TIME_H_
#define _TIME_H_
+#include <acess/intdefs.h>
+#include <sys/types.h> // time_t
+
struct tm
{
int tm_sec;
int tm_isdst;
};
+#define CLOCKS_PER_SEC 1000
+
+typedef signed long long clock_t;
+
+extern clock_t clock();
+
#endif