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

Side by Side Diff: sysdeps/nacl/sysdep.h

Issue 9965011: added several syscalls for nacl mounts (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: fixed TODO 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
« elf/Versions ('K') | « sysdeps/nacl/irt_syscalls.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef _NACL_SYSDEP_H 1 #ifndef _NACL_SYSDEP_H
2 #define _NACL_SYSDEP_H 1 2 #define _NACL_SYSDEP_H 1
3 3
4 #if !defined(__ASSEMBLER__) 4 #if !defined(__ASSEMBLER__)
5 #include <futex_emulation.h> 5 #include <futex_emulation.h>
6 #include <irt_syscalls.h> 6 #include <irt_syscalls.h>
7 #include <lowlevellock.h> 7 #include <lowlevellock.h>
8 8
9 /* Implementation of all syscalls for use in platform- and OS- independent code 9 /* Implementation of all syscalls for use in platform- and OS- independent code
10 as inline functions. Each function translates the syscall arguments into IRT 10 as inline functions. Each function translates the syscall arguments into IRT
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 INTERNAL_SYSCALL_capset_2 (int *err, struct __user_cap_header_struct *hdrp, 107 INTERNAL_SYSCALL_capset_2 (int *err, struct __user_cap_header_struct *hdrp,
108 const struct __user_cap_data_struct *datap) 108 const struct __user_cap_data_struct *datap)
109 { 109 {
110 *err = (38 /* ENOSYS */); 110 *err = (38 /* ENOSYS */);
111 return 0; 111 return 0;
112 } 112 }
113 113
114 __extern_always_inline int 114 __extern_always_inline int
115 INTERNAL_SYSCALL_chdir_1 (int *err, const char *path) 115 INTERNAL_SYSCALL_chdir_1 (int *err, const char *path)
116 { 116 {
117 *err = (38 /* ENOSYS */); 117 *err = __nacl_irt_chdir (path);
118 return 0; 118 return 0;
119 } 119 }
120 120
121 __extern_always_inline int 121 __extern_always_inline int
122 INTERNAL_SYSCALL_chmod_2 (int *err, const char *path, mode_t mode) 122 INTERNAL_SYSCALL_chmod_2 (int *err, const char *path, mode_t mode)
123 { 123 {
124 *err = (38 /* ENOSYS */); 124 *err = (38 /* ENOSYS */);
125 return 0; 125 return 0;
126 } 126 }
127 127
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 return 0; 581 return 0;
582 } 582 }
583 583
584 /* NOTE! The user-level library version returns a character pointer. 584 /* NOTE! The user-level library version returns a character pointer.
585 585
586 The system call just returns the length of the buffer filled (which includes 586 The system call just returns the length of the buffer filled (which includes
587 the ending '\0' character), or zero in case of error. */ 587 the ending '\0' character), or zero in case of error. */
588 __extern_always_inline int 588 __extern_always_inline int
589 INTERNAL_SYSCALL_getcwd_2 (int *err, char *buf, size_t size) 589 INTERNAL_SYSCALL_getcwd_2 (int *err, char *buf, size_t size)
590 { 590 {
591 *err = (38 /* ENOSYS */); 591 char* ret = __nacl_irt_getcwd (buf, size) > 0 ? buf : 0;
592 return 0; 592 return ret > 0 ? 0 : errno;
pasko-google - do not use 2012/03/30 12:36:29 *err must be updated in case of error and we shoul
593 } 593 }
594 594
595 __extern_always_inline gid_t 595 __extern_always_inline gid_t
596 INTERNAL_SYSCALL_getegid_0 (int *err) 596 INTERNAL_SYSCALL_getegid_0 (int *err)
597 { 597 {
598 *err = (38 /* ENOSYS */); 598 *err = (38 /* ENOSYS */);
599 return 0; 599 return 0;
600 } 600 }
601 601
602 __extern_always_inline uid_t 602 __extern_always_inline uid_t
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 INTERNAL_SYSCALL_mincore_3 (int *err, void *addr, size_t length, 908 INTERNAL_SYSCALL_mincore_3 (int *err, void *addr, size_t length,
909 unsigned char *vec) 909 unsigned char *vec)
910 { 910 {
911 *err = (38 /* ENOSYS */); 911 *err = (38 /* ENOSYS */);
912 return 0; 912 return 0;
913 } 913 }
914 914
915 __extern_always_inline int 915 __extern_always_inline int
916 INTERNAL_SYSCALL_mkdir_2 (int *err, const char *pathname, mode_t mode) 916 INTERNAL_SYSCALL_mkdir_2 (int *err, const char *pathname, mode_t mode)
917 { 917 {
918 *err = (38 /* ENOSYS */); 918 *err = __nacl_irt_mkdir (pathname, mode);
919 return 0; 919 return 0;
920 } 920 }
921 921
922 __extern_always_inline int 922 __extern_always_inline int
923 INTERNAL_SYSCALL_mkdirat_3 (int *err, int dirfd, const char *pathname, 923 INTERNAL_SYSCALL_mkdirat_3 (int *err, int dirfd, const char *pathname,
924 mode_t mode) 924 mode_t mode)
925 { 925 {
926 *err = (38 /* ENOSYS */); 926 *err = (38 /* ENOSYS */);
927 return 0; 927 return 0;
928 } 928 }
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 INTERNAL_SYSCALL_renameat_4 (int *err, int olddfd, const char *oldname, 1298 INTERNAL_SYSCALL_renameat_4 (int *err, int olddfd, const char *oldname,
1299 int newdfd, const char *newname) 1299 int newdfd, const char *newname)
1300 { 1300 {
1301 *err = (38 /* ENOSYS */); 1301 *err = (38 /* ENOSYS */);
1302 return 0; 1302 return 0;
1303 } 1303 }
1304 1304
1305 __extern_always_inline int 1305 __extern_always_inline int
1306 INTERNAL_SYSCALL_rmdir_1 (int *err, const char *pathname) 1306 INTERNAL_SYSCALL_rmdir_1 (int *err, const char *pathname)
1307 { 1307 {
1308 *err = (38 /* ENOSYS */); 1308 *err = __nacl_irt_rmdir (pathname);
1309 return 0; 1309 return 0;
1310 } 1310 }
1311 1311
1312 __extern_always_inline int 1312 __extern_always_inline int
1313 INTERNAL_SYSCALL_rt_sigpending_2 (int *err, sigset_t *set, size_t sigsetsize) 1313 INTERNAL_SYSCALL_rt_sigpending_2 (int *err, sigset_t *set, size_t sigsetsize)
1314 { 1314 {
1315 *err = (38 /* ENOSYS */); 1315 *err = (38 /* ENOSYS */);
1316 return 0; 1316 return 0;
1317 } 1317 }
1318 1318
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 #define PSEUDO_END_ERRVAL(name) \ 2105 #define PSEUDO_END_ERRVAL(name) \
2106 END (name) 2106 END (name)
2107 2107
2108 #undef SYSCALL_ERROR_HANDLER_TLS_STORE 2108 #undef SYSCALL_ERROR_HANDLER_TLS_STORE
2109 #define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \ 2109 #define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \
2110 movl %gs:0, %eax; \ 2110 movl %gs:0, %eax; \
2111 movl src, (%eax,destoff) 2111 movl src, (%eax,destoff)
2112 2112
2113 #endif 2113 #endif
2114 #endif 2114 #endif
OLDNEW
« elf/Versions ('K') | « sysdeps/nacl/irt_syscalls.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698