From: John Hodge Date: Sun, 9 Mar 2014 07:14:46 +0000 (+0800) Subject: Usermode/libposix - Stubbed functions for bochs X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=5f750c175569e11a01902f5ea443fe5e9b7918e4;hp=41f5d1923eac00f90097f80e51f0c1f8d1ab7cb3;p=tpg%2Facess2.git Usermode/libposix - Stubbed functions for bochs --- diff --git a/Usermode/Libraries/libposix.so_src/Makefile b/Usermode/Libraries/libposix.so_src/Makefile index 30c4cd2e..dcbf8f53 100644 --- a/Usermode/Libraries/libposix.so_src/Makefile +++ b/Usermode/Libraries/libposix.so_src/Makefile @@ -11,7 +11,7 @@ LDFLAGS += -soname libposix.so -Map map.txt -lc OBJ = main.o unistd.o dirent.o stat.o utmpx.o termios.o OBJ += pwd.o syslog.o sys_time.o sys_ioctl.o sys_resource.o OBJ += fcntl.o clocks.o sys_wait.o unistd_crypt.o -OBJ += grp.o pty.o mktemp.o +OBJ += grp.o pty.o mktemp.o utime.o DEPFILES := $(OBJ:%.o=%.d) BIN = libposix.so diff --git a/Usermode/Libraries/libposix.so_src/include_exp/sys/types.h b/Usermode/Libraries/libposix.so_src/include_exp/sys/types.h index 12238574..c94a65a8 100644 --- a/Usermode/Libraries/libposix.so_src/include_exp/sys/types.h +++ b/Usermode/Libraries/libposix.so_src/include_exp/sys/types.h @@ -5,10 +5,14 @@ #include +#define __USE_BSD 1 + //typedef signed int ssize_t; -//#ifdef __USE_BSD + +#ifdef __USE_BSD +typedef unsigned long u_long; typedef unsigned int u_int; -//#endif +#endif typedef struct stat t_fstat; diff --git a/Usermode/Libraries/libposix.so_src/unistd.c b/Usermode/Libraries/libposix.so_src/unistd.c index 64cb70f5..0f5bb38a 100644 --- a/Usermode/Libraries/libposix.so_src/unistd.c +++ b/Usermode/Libraries/libposix.so_src/unistd.c @@ -50,6 +50,12 @@ int open(const char *path, int openmode, ...) return ret; } +int access(const char *path, int openmode) +{ + errno = EINVAL; + return -1; +} + int creat(const char *path, mode_t mode) { // TODO: Make native call to do this cheaper diff --git a/Usermode/Libraries/libposix.so_src/utime.c b/Usermode/Libraries/libposix.so_src/utime.c new file mode 100644 index 00000000..de9483a8 --- /dev/null +++ b/Usermode/Libraries/libposix.so_src/utime.c @@ -0,0 +1,19 @@ +/* + * Acess2 POSIX Emulation Layer + * - By John Hodge + * + * utime.h + * - + */ +#include +#include + +// === CODE === +int utime(const char *filename, const struct utimbuf *times) +{ + _SysDebug("TODO: libposix utime('%s', {%lli,%lli})", + filename, times->actime, times->modtime + ); + return 0; +} +