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

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 getcwd 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.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 *err != 0 ? -1 : 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
128 __extern_always_inline int 128 __extern_always_inline int
(...skipping 452 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 int ret;
592 return 0; 592 if (buf == 0) {
pasko-google - do not use 2012/03/30 13:24:58 GNU style code (ugly, huh?): if (buf == 0) {
593 *err = EINVAL;
594 return 0;
595 }
596 *err = __nacl_irt_getcwd (buf, size, &ret);
597 return ret;
593 } 598 }
594 599
595 __extern_always_inline gid_t 600 __extern_always_inline gid_t
596 INTERNAL_SYSCALL_getegid_0 (int *err) 601 INTERNAL_SYSCALL_getegid_0 (int *err)
597 { 602 {
598 *err = (38 /* ENOSYS */); 603 *err = (38 /* ENOSYS */);
599 return 0; 604 return 0;
600 } 605 }
601 606
602 __extern_always_inline uid_t 607 __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, 913 INTERNAL_SYSCALL_mincore_3 (int *err, void *addr, size_t length,
909 unsigned char *vec) 914 unsigned char *vec)
910 { 915 {
911 *err = (38 /* ENOSYS */); 916 *err = (38 /* ENOSYS */);
912 return 0; 917 return 0;
913 } 918 }
914 919
915 __extern_always_inline int 920 __extern_always_inline int
916 INTERNAL_SYSCALL_mkdir_2 (int *err, const char *pathname, mode_t mode) 921 INTERNAL_SYSCALL_mkdir_2 (int *err, const char *pathname, mode_t mode)
917 { 922 {
918 *err = (38 /* ENOSYS */); 923 *err = __nacl_irt_mkdir (pathname, mode);
919 return 0; 924 return *err != 0 ? -1 : 0;
920 } 925 }
921 926
922 __extern_always_inline int 927 __extern_always_inline int
923 INTERNAL_SYSCALL_mkdirat_3 (int *err, int dirfd, const char *pathname, 928 INTERNAL_SYSCALL_mkdirat_3 (int *err, int dirfd, const char *pathname,
924 mode_t mode) 929 mode_t mode)
925 { 930 {
926 *err = (38 /* ENOSYS */); 931 *err = (38 /* ENOSYS */);
927 return 0; 932 return 0;
928 } 933 }
929 934
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 INTERNAL_SYSCALL_renameat_4 (int *err, int olddfd, const char *oldname, 1303 INTERNAL_SYSCALL_renameat_4 (int *err, int olddfd, const char *oldname,
1299 int newdfd, const char *newname) 1304 int newdfd, const char *newname)
1300 { 1305 {
1301 *err = (38 /* ENOSYS */); 1306 *err = (38 /* ENOSYS */);
1302 return 0; 1307 return 0;
1303 } 1308 }
1304 1309
1305 __extern_always_inline int 1310 __extern_always_inline int
1306 INTERNAL_SYSCALL_rmdir_1 (int *err, const char *pathname) 1311 INTERNAL_SYSCALL_rmdir_1 (int *err, const char *pathname)
1307 { 1312 {
1308 *err = (38 /* ENOSYS */); 1313 *err = __nacl_irt_rmdir (pathname);
1309 return 0; 1314 return *err != 0 ? -1 : 0;
1310 } 1315 }
1311 1316
1312 __extern_always_inline int 1317 __extern_always_inline int
1313 INTERNAL_SYSCALL_rt_sigpending_2 (int *err, sigset_t *set, size_t sigsetsize) 1318 INTERNAL_SYSCALL_rt_sigpending_2 (int *err, sigset_t *set, size_t sigsetsize)
1314 { 1319 {
1315 *err = (38 /* ENOSYS */); 1320 *err = (38 /* ENOSYS */);
1316 return 0; 1321 return 0;
1317 } 1322 }
1318 1323
1319 __extern_always_inline int 1324 __extern_always_inline int
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 #define PSEUDO_END_ERRVAL(name) \ 2110 #define PSEUDO_END_ERRVAL(name) \
2106 END (name) 2111 END (name)
2107 2112
2108 #undef SYSCALL_ERROR_HANDLER_TLS_STORE 2113 #undef SYSCALL_ERROR_HANDLER_TLS_STORE
2109 #define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \ 2114 #define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \
2110 movl %gs:0, %eax; \ 2115 movl %gs:0, %eax; \
2111 movl src, (%eax,destoff) 2116 movl src, (%eax,destoff)
2112 2117
2113 #endif 2118 #endif
2114 #endif 2119 #endif
OLDNEW
« no previous file with comments | « sysdeps/nacl/irt_syscalls.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698