Also fixed stat() to be able to get function pointer to it.
Signed-off-by: Simon Gerber <simon.gerber@inf.ethz.ch>
__BEGIN_DECLS
mode_t umask(mode_t mask);
int chmod(const char *path, mode_t mode);
+int fchmod(int fd, mode_t mode);
int mkdir(const char *pathname, int mode);
int mkfifo(const char *pathname, mode_t mode);
int __stat(const char *pathname, struct stat *buf);
-#define stat(x,y) __stat(x,y)
+static inline int stat(const char *pathname, struct stat *buf) {
+ return __stat(pathname, buf);
+}
int fstat(int fd, struct stat*buf);
int lstat(const char *path, struct stat *buf);
__END_DECLS
unsigned int alarm(unsigned int seconds);
int chdir(const char*pathname);
int chown(const char *path, uid_t owner, gid_t group);
+int fchown(int fd, uid_t owner, gid_t group);
int close(int fd);
int dup(int oldfd);
int dup2(int oldfd, int newfd);
"kill.c",
"link.c",
"lseek.c",
+ "mmap.c",
"mkdir.c",
"open.c",
"pipe.c",
return 0;
}
+int fchmod(int fd, mode_t mode)
+{
+ POSIXCOMPAT_DEBUG("Warning: fchmod(%d, %o) ignored\n", fd, mode);
+ return 0;
+}
+
int chown(const char *path, uid_t owner, gid_t group)
{
POSIXCOMPAT_DEBUG("Warning: chown(\"%s\", %d, %d) ignored\n",
path, owner, group);
return 0;
}
+
+int fchown(int fd, uid_t owner, gid_t group)
+{
+ POSIXCOMPAT_DEBUG("Warning: chown(%d, %d, %d) ignored\n",
+ fd, owner, group);
+ return 0;
+}
--- /dev/null
+/*
+ * Copyright (c) 2015, ETH Zurich.
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached LICENSE file.
+ * If you do not find this file, copies can be found by writing to:
+ * ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
+ */
+
+#include <sys/mman.h>
+#include <barrelfish/barrelfish.h>
+#include "posixcompat.h"
+
+void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
+{
+ POSIXCOMPAT_DEBUG("Warning: mmap(%p, %zx, %d, %d, %d, %zu) ignored\n"
+ addr, length, prot, flags, fd, offset);
+ USER_PANIC("mmap NYI!");
+ return NULL;
+}
+
+int munmap(void *addr, size_t length)
+{
+ POSIXCOMPAT_DEBUG("Warning: munmap(%p, %zx) ignored\n"
+ addr, length);
+ USER_PANIC("mmap NYI!");
+ return -1;
+}