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

Unified Diff: src/untrusted/irt/irt_filename.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/untrusted/irt/irt_fdio.c ('k') | src/untrusted/irt/irt_interfaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/untrusted/irt/irt_filename.c
diff --git a/src/untrusted/irt/irt_filename.c b/src/untrusted/irt/irt_filename.c
index 6e49f588c01e37cca5756d1ed31ce42e837fb8ee..10e8d4687955ad11e5660120775a0a679e7138f1 100644
--- a/src/untrusted/irt/irt_filename.c
+++ b/src/untrusted/irt/irt_filename.c
@@ -41,12 +41,63 @@ static int nacl_irt_unlink(const char *pathname) {
return -NACL_SYSCALL(unlink)(pathname);
}
+static int nacl_irt_truncate(const char *path, off_t length) {
+ return -NACL_SYSCALL(truncate)(path, length);
+}
+
+static int nacl_irt_lstat(const char *path, struct stat *buf) {
+ return -NACL_SYSCALL(lstat)(path, buf);
+}
+
+static int nacl_irt_link(const char *oldpath, const char *newpath) {
+ return -NACL_SYSCALL(link)(oldpath, newpath);
+}
+
+static int nacl_irt_rename(const char *oldpath, const char *newpath) {
+ return -NACL_SYSCALL(rename)(oldpath, newpath);
+}
+
+static int nacl_irt_symlink(const char* oldpath, const char* newpath) {
+ return -NACL_SYSCALL(symlink)(oldpath, newpath);
+}
+
+static int nacl_irt_chmod(const char *path, mode_t mode) {
+ return -NACL_SYSCALL(chmod)(path, mode);
+}
+
+static int nacl_irt_access(const char *path, int mode) {
+ return -NACL_SYSCALL(access)(path, mode);
+}
+
+static int nacl_irt_readlink(const char *path, char *buf, size_t count,
+ size_t *nread) {
+ int rv = NACL_SYSCALL(readlink)(path, buf, count);
+ if (rv < 0)
+ return -rv;
+ *nread = rv;
+ return 0;
+}
+
+static int nacl_irt_utimes(const char* filename, const struct timeval* times) {
+ return -NACL_SYSCALL(utimes)(filename, times);
+}
+
const struct nacl_irt_filename nacl_irt_filename = {
nacl_irt_open,
nacl_irt_stat,
};
-const struct nacl_irt_dev_filename_v0_2 nacl_irt_dev_filename = {
+const struct nacl_irt_dev_filename_v0_2 nacl_irt_dev_filename_v0_2 = {
+ nacl_irt_open,
+ nacl_irt_stat,
+ nacl_irt_mkdir,
+ nacl_irt_rmdir,
+ nacl_irt_chdir,
+ nacl_irt_getcwd,
+ nacl_irt_unlink,
+};
+
+const struct nacl_irt_dev_filename nacl_irt_dev_filename = {
nacl_irt_open,
nacl_irt_stat,
nacl_irt_mkdir,
@@ -54,4 +105,13 @@ const struct nacl_irt_dev_filename_v0_2 nacl_irt_dev_filename = {
nacl_irt_chdir,
nacl_irt_getcwd,
nacl_irt_unlink,
+ nacl_irt_truncate,
+ nacl_irt_lstat,
+ nacl_irt_link,
+ nacl_irt_rename,
+ nacl_irt_symlink,
+ nacl_irt_chmod,
+ nacl_irt_access,
+ nacl_irt_readlink,
+ nacl_irt_utimes,
};
« no previous file with comments | « src/untrusted/irt/irt_fdio.c ('k') | src/untrusted/irt/irt_interfaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698