| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include "native_client/src/untrusted/irt/irt.h" | 7 #include "native_client/src/untrusted/irt/irt.h" |
| 8 #include "native_client/src/untrusted/irt/irt_dev.h" | 8 #include "native_client/src/untrusted/irt/irt_dev.h" |
| 9 #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" | 9 #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 static int nacl_irt_getdents(int fd, struct dirent *buf, size_t count, | 61 static int nacl_irt_getdents(int fd, struct dirent *buf, size_t count, |
| 62 size_t *nread) { | 62 size_t *nread) { |
| 63 int rv = NACL_GC_WRAP_SYSCALL(NACL_SYSCALL(getdents)(fd, buf, count)); | 63 int rv = NACL_GC_WRAP_SYSCALL(NACL_SYSCALL(getdents)(fd, buf, count)); |
| 64 if (rv < 0) | 64 if (rv < 0) |
| 65 return -rv; | 65 return -rv; |
| 66 *nread = rv; | 66 *nread = rv; |
| 67 return 0; | 67 return 0; |
| 68 } | 68 } |
| 69 | 69 |
| 70 static int nacl_irt_fchdir(int fd) { | 70 static int nacl_irt_fchdir(int fd) { |
| 71 return ENOSYS; | 71 return -NACL_SYSCALL(fchdir)(fd); |
| 72 } | 72 } |
| 73 | 73 |
| 74 static int nacl_irt_fchmod(int fd, mode_t mode) { | 74 static int nacl_irt_fchmod(int fd, mode_t mode) { |
| 75 return ENOSYS; | 75 return -NACL_SYSCALL(fchmod)(fd, mode); |
| 76 } | 76 } |
| 77 | 77 |
| 78 static int nacl_irt_fsync(int fd) { | 78 static int nacl_irt_fsync(int fd) { |
| 79 return ENOSYS; | 79 return -NACL_SYSCALL(fsync)(fd); |
| 80 } | 80 } |
| 81 | 81 |
| 82 static int nacl_irt_fdatasync(int fd) { | 82 static int nacl_irt_fdatasync(int fd) { |
| 83 return ENOSYS; | 83 return -NACL_SYSCALL(fdatasync)(fd); |
| 84 } | 84 } |
| 85 | 85 |
| 86 static int nacl_irt_ftruncate(int fd, off_t legnth) { | 86 static int nacl_irt_ftruncate(int fd, off_t length) { |
| 87 return ENOSYS; | 87 return -NACL_SYSCALL(ftruncate)(fd, length); |
| 88 } | 88 } |
| 89 | 89 |
| 90 static int nacl_irt_isatty(int fd, int *result) { | 90 static int nacl_irt_isatty(int fd, int *result) { |
| 91 int rv = NACL_SYSCALL(isatty)(fd); | 91 int rv = NACL_SYSCALL(isatty)(fd); |
| 92 if (rv < 0) | 92 if (rv < 0) |
| 93 return -rv; | 93 return -rv; |
| 94 *result = rv; | 94 *result = rv; |
| 95 return 0; | 95 return 0; |
| 96 } | 96 } |
| 97 | 97 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 115 nacl_irt_seek, | 115 nacl_irt_seek, |
| 116 nacl_irt_fstat, | 116 nacl_irt_fstat, |
| 117 nacl_irt_getdents, | 117 nacl_irt_getdents, |
| 118 nacl_irt_fchdir, | 118 nacl_irt_fchdir, |
| 119 nacl_irt_fchmod, | 119 nacl_irt_fchmod, |
| 120 nacl_irt_fsync, | 120 nacl_irt_fsync, |
| 121 nacl_irt_fdatasync, | 121 nacl_irt_fdatasync, |
| 122 nacl_irt_ftruncate, | 122 nacl_irt_ftruncate, |
| 123 nacl_irt_isatty | 123 nacl_irt_isatty |
| 124 }; | 124 }; |
| OLD | NEW |