Usermode/libposix - Stubbed functions for bochs
authorJohn Hodge <[email protected]>
Sun, 9 Mar 2014 07:14:46 +0000 (15:14 +0800)
committerJohn Hodge <[email protected]>
Sun, 9 Mar 2014 07:14:46 +0000 (15:14 +0800)
Usermode/Libraries/libposix.so_src/Makefile
Usermode/Libraries/libposix.so_src/include_exp/sys/types.h
Usermode/Libraries/libposix.so_src/unistd.c
Usermode/Libraries/libposix.so_src/utime.c [new file with mode: 0644]

index 30c4cd2..dcbf8f5 100644 (file)
@@ -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\r
 OBJ += pwd.o syslog.o sys_time.o sys_ioctl.o sys_resource.o\r
 OBJ += fcntl.o clocks.o sys_wait.o unistd_crypt.o\r
-OBJ += grp.o pty.o mktemp.o\r
+OBJ += grp.o pty.o mktemp.o utime.o\r
 DEPFILES := $(OBJ:%.o=%.d)\r
 BIN = libposix.so\r
 \r
index 1223857..c94a65a 100644 (file)
@@ -5,10 +5,14 @@
 
 #include <stddef.h>
 
+#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;
 
index 64cb70f..0f5bb38 100644 (file)
@@ -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 (file)
index 0000000..de9483a
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Acess2 POSIX Emulation Layer
+ * - By John Hodge
+ * 
+ * utime.h
+ * - 
+ */
+#include <utime.h>
+#include <acess/sys.h>
+
+// === CODE ===
+int utime(const char *filename, const struct utimbuf *times)
+{
+       _SysDebug("TODO: libposix utime('%s', {%lli,%lli})",
+               filename, times->actime, times->modtime
+               );
+       return 0;
+}
+

UCC git Repository :: git.ucc.asn.au