Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Unified Diff: src/untrusted/irt/irt_fdio.c

Issue 24889002: Provides some of the missing POSIX file syscalls Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/service_runtime/sys_filename.c ('k') | src/untrusted/irt/irt_filename.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/untrusted/irt/irt_fdio.c
diff --git a/src/untrusted/irt/irt_fdio.c b/src/untrusted/irt/irt_fdio.c
index a8b52bbe70e9dfaa049cc3c6436daae4e5af1e8c..e4c1318a0ed6d0a9691abec06ef3d15c0d622732 100644
--- a/src/untrusted/irt/irt_fdio.c
+++ b/src/untrusted/irt/irt_fdio.c
@@ -5,6 +5,7 @@
*/
#include "native_client/src/untrusted/irt/irt.h"
+#include "native_client/src/untrusted/irt/irt_dev.h"
#include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h"
static int nacl_irt_close(int fd) {
@@ -64,6 +65,26 @@ static int nacl_irt_getdents(int fd, struct dirent *buf, size_t count,
return 0;
}
+static int nacl_irt_fchdir(int fd) {
+ return -NACL_SYSCALL(fchdir)(fd);
+}
+
+static int nacl_irt_fchmod(int fd, mode_t mode) {
+ return -NACL_SYSCALL(fchmod)(fd, mode);
+}
+
+static int nacl_irt_fsync(int fd) {
+ return -NACL_SYSCALL(fsync)(fd);
+}
+
+static int nacl_irt_fdatasync(int fd) {
+ return -NACL_SYSCALL(fdatasync)(fd);
+}
+
+static int nacl_irt_ftruncate(int fd, off_t length) {
+ return -NACL_SYSCALL(ftruncate)(fd, length);
+}
+
const struct nacl_irt_fdio nacl_irt_fdio = {
nacl_irt_close,
nacl_irt_dup,
@@ -74,3 +95,19 @@ const struct nacl_irt_fdio nacl_irt_fdio = {
nacl_irt_fstat,
nacl_irt_getdents,
};
+
+const struct nacl_irt_dev_fdio nacl_irt_dev_fdio = {
+ nacl_irt_close,
+ nacl_irt_dup,
+ nacl_irt_dup2,
+ nacl_irt_read,
+ nacl_irt_write,
+ nacl_irt_seek,
+ nacl_irt_fstat,
+ nacl_irt_getdents,
+ nacl_irt_fchdir,
+ nacl_irt_fchmod,
+ nacl_irt_fsync,
+ nacl_irt_fdatasync,
+ nacl_irt_ftruncate,
+};
« no previous file with comments | « src/trusted/service_runtime/sys_filename.c ('k') | src/untrusted/irt/irt_filename.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698