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

Side by Side Diff: sysdeps/nacl/irt_syscalls.c

Issue 9965011: added several syscalls for nacl mounts (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: remove buf check Created 8 years, 8 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 unified diff | Download patch
« no previous file with comments | « sysdeps/nacl/irt_syscalls.h ('k') | sysdeps/nacl/sysdep.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <string.h> 1 #include <string.h>
2 #include <sys/stat.h> 2 #include <sys/stat.h>
3 #include <time.h> 3 #include <time.h>
4 #include <nacl_stat.h> 4 #include <nacl_stat.h>
5 #include <nacl_syscalls.h> 5 #include <nacl_syscalls.h>
6 #define stat nacl_abi_stat 6 #define stat nacl_abi_stat
7 #include <irt.h> 7 #include <irt.h>
8 #undef stat 8 #undef stat
9 #include <irt_syscalls.h> 9 #include <irt_syscalls.h>
10 #ifdef IS_IN_rtld 10 #ifdef IS_IN_rtld
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 static int nacl_irt_clock_gettime(clockid_t clk_id, 267 static int nacl_irt_clock_gettime(clockid_t clk_id,
268 struct timespec *tp) { 268 struct timespec *tp) {
269 return -NACL_SYSCALL (clock_gettime) (clk_id, tp); 269 return -NACL_SYSCALL (clock_gettime) (clk_id, tp);
270 } 270 }
271 271
272 static size_t no_interface (const char *interface_ident, 272 static size_t no_interface (const char *interface_ident,
273 void *table, size_t tablesize) { 273 void *table, size_t tablesize) {
274 return 0; 274 return 0;
275 } 275 }
276 276
277 static int not_implemented() {
278 return (12 /* ENOSYS */);
279 }
280
277 size_t (*__nacl_irt_query) (const char *interface_ident, 281 size_t (*__nacl_irt_query) (const char *interface_ident,
278 void *table, size_t tablesize); 282 void *table, size_t tablesize);
279 283
284 int (*__nacl_irt_mkdir) (const char* pathname, mode_t mode);
285 int (*__nacl_irt_rmdir) (const char* pathname);
286 int (*__nacl_irt_chdir) (const char* pathname);
287 int (*__nacl_irt_getcwd) (char* buf, size_t size, int* ret);
288
280 void (*__nacl_irt_exit) (int status); 289 void (*__nacl_irt_exit) (int status);
281 int (*__nacl_irt_gettod) (struct timeval *tv); 290 int (*__nacl_irt_gettod) (struct timeval *tv);
282 int (*__nacl_irt_clock) (clock_t *ticks); 291 int (*__nacl_irt_clock) (clock_t *ticks);
283 int (*__nacl_irt_nanosleep) (const struct timespec *req, struct timespec *rem); 292 int (*__nacl_irt_nanosleep) (const struct timespec *req, struct timespec *rem);
284 int (*__nacl_irt_sched_yield) (void); 293 int (*__nacl_irt_sched_yield) (void);
285 int (*__nacl_irt_sysconf) (int name, int *value); 294 int (*__nacl_irt_sysconf) (int name, int *value);
286 295
287 int (*__nacl_irt_open) (const char *pathname, int oflag, mode_t cmode, 296 int (*__nacl_irt_open) (const char *pathname, int oflag, mode_t cmode,
288 int *newfd); 297 int *newfd);
289 int (*__nacl_irt_close) (int fd); 298 int (*__nacl_irt_close) (int fd);
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 __nacl_irt_clock_gettime = u.nacl_irt_clock.gettime; 547 __nacl_irt_clock_gettime = u.nacl_irt_clock.gettime;
539 } 548 }
540 else 549 else
541 { 550 {
542 __nacl_irt_clock_getres = nacl_irt_clock_getres; 551 __nacl_irt_clock_getres = nacl_irt_clock_getres;
543 __nacl_irt_clock_gettime = nacl_irt_clock_gettime; 552 __nacl_irt_clock_gettime = nacl_irt_clock_gettime;
544 } 553 }
545 554
546 if (!__nacl_irt_query) 555 if (!__nacl_irt_query)
547 __nacl_irt_query = no_interface; 556 __nacl_irt_query = no_interface;
557
558 __nacl_irt_mkdir = not_implemented;
559 __nacl_irt_chdir = not_implemented;
560 __nacl_irt_rmdir = not_implemented;
561 __nacl_irt_getcwd = not_implemented;
548 } 562 }
549 563
550 size_t nacl_interface_query(const char *interface_ident, 564 size_t nacl_interface_query(const char *interface_ident,
551 void *table, size_t tablesize) { 565 void *table, size_t tablesize) {
552 return (*__nacl_irt_query)(interface_ident, table, tablesize); 566 return (*__nacl_irt_query)(interface_ident, table, tablesize);
553 } 567 }
OLDNEW
« no previous file with comments | « sysdeps/nacl/irt_syscalls.h ('k') | sysdeps/nacl/sysdep.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698