Index: sysdeps/nacl/sysdep.h |
diff --git a/sysdeps/nacl/sysdep.h b/sysdeps/nacl/sysdep.h |
index 5265722f16905123710e426521570d45e77e630f..bc4adb68201a476e4073c868196885434c738011 100644 |
--- a/sysdeps/nacl/sysdep.h |
+++ b/sysdeps/nacl/sysdep.h |
@@ -3,167 +3,195 @@ |
#if !defined(__ASSEMBLER__) |
#include <futex_emulation.h> |
+#include <irt_syscalls.h> |
#include <lowlevellock.h> |
/* TODO(mseaborn): Don't use these in the NaCl build, or at least |
don't hard code the value of ENOSYS. */ |
pasko-google - do not use
2011/09/02 16:25:24
this TODO is obsolete, please, remove
we should c
khim
2011/09/02 16:36:09
Done.
|
#define INTERNAL_SYSCALL(name, err, nr, args...) \ |
- INTERNAL_SYSCALL_ ## name(err, nr, args) |
- |
-#define INTERNAL_SYSCALL_access(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_chmod(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_chown(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_chown32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_clock_getres(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_clock_gettime(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_clock_nanosleep(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_clock_settime(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_clone(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_close(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_epoll_pwait(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_eventfd(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_execve(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_faccessat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fallocate(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fadvise64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fchmodat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fchown(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fchown32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fchownat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fcntl(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fcntl64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fstat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fstat64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fstatat64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_fstatfs64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_ftruncate64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_futimesat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getcpu(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getcwd(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getdents(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getdents64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getegid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getegid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_geteuid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_geteuid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getgid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getgid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getgroups(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getgroups32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getpmsg(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getpriority(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getresgid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getresgid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getresuid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getresuid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getrlimit(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_gettid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getuid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_getuid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_ioctl(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_ipc(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_kill(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_lchown(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_lchown32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_link(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_linkat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL__llseek(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_lstat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_lstat64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_madvise(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_mkdir(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_mkdirat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_mknod(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_mknodat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_mq_notify(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_mq_open(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_mq_unlink(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_munmap(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_newfstatat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_open(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_openat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_poll(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_ppoll(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_pread(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_ptrace(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_putpmsg(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_pwrite(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_pselect6(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_readahead(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_readlink(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_readlinkat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_readv(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_reboot(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_rename(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_renameat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_rmdir(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_rt_sigaction(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_rt_sigpending(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_rt_sigprocmask(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_rt_sigqueueinfo(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_rt_sigsuspend(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_rt_sigtimedwait(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_sched_get_priority_max(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_sched_get_priority_min(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_sched_getaffinity(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_sched_getparam(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_sched_getscheduler(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_sched_setaffinity(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_sched_setscheduler(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_set_robust_list(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_set_tid_address(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setfsgid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setfsgid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setfsuid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setfsuid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setgid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setgid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setgroups(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setgroups32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setregid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setregid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setresgid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setresgid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setresuid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setresuid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setreuid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setreuid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setrlimit(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setuid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_setuid32(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_signalfd(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_stat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_stat64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_statfs64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_symlink(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_symlinkat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_sync_file_range(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL__sysctl(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_tgkill(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_time(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_timer_create(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_timer_delete(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_timer_getoverrun(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_timer_gettime(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_timer_settime(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_times(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_tkill(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_truncate64(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_ugetrlimit(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_unlink(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_unlinkat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_ustat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_utime(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_utimensat(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_utimes(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_wait4(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_waitid(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_write(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_writev(err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) (-38 /* ENOSYS */) |
-#define INTERNAL_SYSCALL_futex(err, nr, args...) \ |
- INTERNAL_SYSCALL_futex ## nr(args) |
+ INTERNAL_SYSCALL_ ## name ## _ ## nr (&err , ## args) |
+ |
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ |
+ INTERNAL_SYSCALL_NCS_ ## nr (name, &err , ## args) |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_NCS_3 (int syscall_nr, int *err, int id1, int id2, int id3) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
pasko-google - do not use
2011/09/02 16:25:24
no need for round brackets
why not just #define E
khim
2011/09/02 16:36:09
Because it's sometimes defined as "12" (from NaCl
|
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_access_2 (int *err, const char *pathname, int mode) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_chmod_2 (int *err, const char *path, mode_t mode) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_chown_3 (int *err, const char *path, |
+ __kernel_uid_t owner, __kernel_gid_t group) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_chown32_3 (int *err, const char *path, |
+ uid_t owner, gid_t group) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_clock_getres_2 (int *err, clockid_t clk_id, |
+ struct timespec *res) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_clock_gettime_2 (int *err, clockid_t clk_id, |
+ struct timespec *tp) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_clock_nanosleep_4 (int *err, clockid_t clock_id, int flags, |
+ const struct timespec *request, |
+ struct timespec *remain) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_clock_settime_2 (int *err, clockid_t clk_id, |
+ const struct timespec *tp) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_close_1 (int *err, unsigned int fd) |
+{ |
+ (*err) = __nacl_irt_close(fd); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_epoll_pwait_6 (int *err, int epfd, struct epoll_event *events, |
+ int maxevents, int timeout, |
+ const sigset_t *sigmask, size_t sigsetsize) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_execve_3 (int *err, const char *filename, char *const argv[], |
+ char *const envp[]) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_eventfd2_2 (int *err, unsigned int initval, int flags) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_eventfd_1 (int *err, unsigned int initval) |
+{ |
+ return INTERNAL_SYSCALL_eventfd2_2(err, initval, 0); |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_faccessat_3 (int *err, int dirfd, const char *pathname, |
+ int mode) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_fchmod_2 (int *err, int fd, mode_t mode) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_fchmodat_3 (int *err, int dirfd, const char *pathname, |
+ mode_t mode) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_fchown_3 (int *err, int fd, |
+ __kernel_uid_t owner, __kernel_gid_t group) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_fchown32_3 (int *err, int fd, |
+ uid_t owner, gid_t group) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_fchownat_5 (int *err, int dirfd, const char *pathname, |
+ uid_t owner, gid_t group, int flags) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_fcntl_3 (int *err, int fd, int cmd, void *arg) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_fcntl64_3 (int *err, int fd, int cmd, |
+ union __attribute__ ((__transparent_union__)) |
+ { |
+ unsigned long long ullarg; |
+ long long llarg; |
+ unsigned long ularg; |
+ long larg; |
+ unsigned int uiarg; |
+ int iarg; |
+ void *parg; |
+ } arg) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
__errordecl (__futex_emulation_unknown_operation, |
"unknown futex operation or argument"); |
@@ -183,114 +211,1048 @@ union __attribute__ ((__transparent_union__)) encoded_futex_operation |
struct decoded_futex_operation decoded_futex_operation; |
}; |
-__extern_always_inline unsigned int |
-INTERNAL_SYSCALL_futex2 (union __attribute__ ((__transparent_union__)) |
- { |
- volatile int *addr; |
- volatile unsigned int *uaddr; |
- } addr, |
- union encoded_futex_operation futex_operation) |
+__extern_always_inline void |
+INTERNAL_SYSCALL_futex_2 (int *err, |
+ union __attribute__ ((__transparent_union__)) |
+ { |
+ volatile int *addr; |
+ volatile unsigned int *uaddr; |
+ } addr, |
+ union encoded_futex_operation futex_operation) |
{ |
switch (futex_operation.decoded_futex_operation.operation) |
pasko-google - do not use
2011/09/02 16:25:24
switch? why?
this is easier to read:
if (blah ==
khim
2011/09/02 16:36:09
All other functions use switch.
|
{ |
case FUTEX_UNLOCK_PI: |
- return (-38 /* ENOSYS */); |
+ (*err) = (38 /* ENOSYS */); |
+ return; |
default: |
if (__builtin_constant_p ( |
futex_operation.decoded_futex_operation.operation)) |
__futex_emulation_unknown_operation (); |
+ (*err) = 0; |
} |
- return 0; |
} |
__extern_always_inline unsigned int |
-INTERNAL_SYSCALL_futex3 (union __attribute__ ((__transparent_union__)) |
- { |
- volatile int *addr; |
- volatile unsigned int *uaddr; |
- } addr, |
- union encoded_futex_operation futex_operation, |
- int val) |
+INTERNAL_SYSCALL_futex_3 (int *err, |
+ union __attribute__ ((__transparent_union__)) |
+ { |
+ volatile int *addr; |
+ volatile unsigned int *uaddr; |
+ } addr, |
+ union encoded_futex_operation futex_operation, |
+ int val) |
{ |
+ int count; |
switch (futex_operation.decoded_futex_operation.operation) |
{ |
case FUTEX_WAKE: |
- return __nacl_futex_wake (addr.addr, val, __FUTEX_BITSET_MATCH_ANY); |
+ (*err) = __nacl_futex_wake (addr.addr, val, __FUTEX_BITSET_MATCH_ANY, |
+ &count); |
+ return count; |
default: |
if (__builtin_constant_p ( |
futex_operation.decoded_futex_operation.operation)) |
__futex_emulation_unknown_operation (); |
+ (*err) = 0; |
} |
return 0; |
} |
__extern_always_inline unsigned int |
-INTERNAL_SYSCALL_futex4 (union __attribute__ ((__transparent_union__)) |
- { |
- volatile int *addr; |
- volatile unsigned int *uaddr; |
- } addr, |
- union encoded_futex_operation futex_operation, |
- int val1, |
- /* We need to accept 0 here. May be better to |
- replace 0 with NULL in NPTL code? */ |
- union __attribute__ ((__transparent_union__)) |
- { |
- const struct timespec *timeout; |
- int null_timeout; |
- } val2) |
+INTERNAL_SYSCALL_futex_4 (int *err, |
+ union __attribute__ ((__transparent_union__)) |
+ { |
+ volatile int *addr; |
+ volatile unsigned int *uaddr; |
+ } addr, |
+ union encoded_futex_operation futex_operation, |
+ int val1, |
+ /* We need to accept 0 here. May be better to |
+ replace 0 with NULL in NPTL code? */ |
+ union __attribute__ ((__transparent_union__)) |
+ { |
+ const struct timespec *timeout; |
+ int null_timeout; |
+ } val2) |
{ |
switch (futex_operation.decoded_futex_operation.operation) |
{ |
case FUTEX_WAIT: |
- return __nacl_futex_wait (addr.addr, val1, __FUTEX_BITSET_MATCH_ANY, |
- val2.timeout); |
- /* TODO(khim): handle PI-locks in some less hacky way. */ |
+ (*err) = __nacl_futex_wait (addr.addr, val1, __FUTEX_BITSET_MATCH_ANY, |
+ val2.timeout); |
+ return 0; |
+ /* TODO(khim): hook up PI-locks to some IRT-handleable functions. */ |
case FUTEX_LOCK_PI: |
case FUTEX_UNLOCK_PI: |
case FUTEX_TRYLOCK_PI: |
- return (-38 /* ENOSYS */); |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
default: |
if (__builtin_constant_p ( |
futex_operation.decoded_futex_operation.operation)) |
__futex_emulation_unknown_operation (); |
+ (*err) = 0; |
} |
return 0; |
} |
+ |
__extern_always_inline unsigned int |
-INTERNAL_SYSCALL_futex6 (union __attribute__ ((__transparent_union__)) |
- { |
- volatile int *addr; |
- volatile unsigned int *uaddr; |
- } addr1, |
- union encoded_futex_operation futex_operation, |
- int val1, |
- int val2, |
- union __attribute__ ((__transparent_union__)) |
- { |
- volatile int *addr; |
- volatile unsigned int *uaddr; |
- } addr2, |
- int val3) |
+INTERNAL_SYSCALL_futex_6 (int *err, |
+ union __attribute__ ((__transparent_union__)) |
+ { |
+ volatile int *addr; |
+ volatile unsigned int *uaddr; |
+ } addr1, |
+ union encoded_futex_operation futex_operation, |
+ int val1, |
+ int val2, |
+ union __attribute__ ((__transparent_union__)) |
+ { |
+ volatile int *addr; |
+ volatile unsigned int *uaddr; |
+ } addr2, |
+ int val3) |
{ |
+ int count; |
switch (futex_operation.decoded_futex_operation.operation) |
{ |
case FUTEX_WAKE_OP: |
- return __nacl_futex_wake_op (addr1.addr, addr2.addr, val1, val2, val3); |
+ (*err) = __nacl_futex_wake_op (addr1.addr, addr2.addr, |
+ val1, val2, val3, &count); |
+ return count; |
case FUTEX_CMP_REQUEUE: |
- return __nacl_futex_cmp_requeue (addr1.addr, addr2.addr, |
- val1, val2, val3); |
+ (*err) = __nacl_futex_cmp_requeue (addr1.addr, addr2.addr, |
+ val1, val2, val3, &count); |
+ return count; |
default: |
if (__builtin_constant_p ( |
futex_operation.decoded_futex_operation.operation)) |
__futex_emulation_unknown_operation (); |
+ (*err) = 0; |
} |
return 0; |
} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_futimesat_3 (int *err, int dirfd, const char *pathname, |
+ const struct timeval times[2]) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getcpu_3 (int *err, unsigned *cpu, unsigned *node, |
+ struct getcpu_cache *tcache) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+/* NOTE! The user-level library version returns a character pointer. |
+ |
+ The system call just returns the length of the buffer filled (which includes |
+ the ending '\0' character), or zero in case of error. */ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getcwd_2 (int *err, char *buf, size_t size) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline __kernel_gid_t |
+INTERNAL_SYSCALL_getegid_0 (int *err) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline gid_t |
+INTERNAL_SYSCALL_getegid32_0 (int *err) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline __kernel_uid_t |
+INTERNAL_SYSCALL_geteuid_0 (int *err) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline uid_t |
+INTERNAL_SYSCALL_geteuid32_0 (int *err) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline __kernel_gid_t |
+INTERNAL_SYSCALL_getgid_0 (int *err) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline gid_t |
+INTERNAL_SYSCALL_getgid32_0 (int *err) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getgroups_2 (int *err, int size, __kernel_gid_t *list) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getgroups32_2 (int *err, int size, gid_t *list) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getmsg_4 (int *err, int fildes, const struct strbuf *ctlptr, |
+ const struct strbuf *dataptr, int *pflags) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getpmsg_5 (int *err, int fildes, const struct strbuf *ctlptr, |
+ const struct strbuf *dataptr, int *pband, int *pflags) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+/* The return value of getpriority syscall is biased by this value |
+ to avoid returning negative values. */ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getpriority_2 (int *err, int which, int who) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getresgid_3 (int *err, __kernel_gid_t *rgid, |
+ __kernel_gid_t *egid, __kernel_gid_t *sgid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getresgid32_3 (int *err, gid_t *rgid, gid_t *egid, gid_t *sgid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getresuid_3 (int *err, __kernel_uid_t *ruid, |
+ __kernel_uid_t *euid, __kernel_uid_t *suid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_getresuid32_3 (int *err, uid_t *ruid, uid_t *euid, uid_t *ugid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline __kernel_uid_t |
+INTERNAL_SYSCALL_getuid_0 (int *err) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline uid_t |
+INTERNAL_SYSCALL_getuid32_0 (int *err) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline uid_t |
+INTERNAL_SYSCALL_open_3 (int *err, const char *pathname, int flags, mode_t mode) |
+{ |
+ int newfd; |
+ (*err) = __nacl_irt_open (pathname, flags, mode, &newfd); |
+ return newfd; |
+} |
+ |
+__extern_always_inline uid_t |
+INTERNAL_SYSCALL_openat_4 (int *err, int dirfd, const char *pathname, |
+ int flags, mode_t mode) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_ioctl_3 (int *err, int d, int request, |
+ union __attribute__ ((__transparent_union__)) |
+ { |
+ unsigned long long ullarg; |
+ long long llarg; |
+ unsigned long ularg; |
+ long larg; |
+ unsigned int uiarg; |
+ int iarg; |
+ void *parg; |
+ } arg) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_ipc_6 (int *err, unsigned int call, int first, int second, |
+ int third, void *ptr, long fifth) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_ipc_5 (int *err, unsigned int call, int first, int second, |
+ int third, void *ptr) |
+{ |
+ return INTERNAL_SYSCALL_ipc_6 (err, call, first, second, third, ptr, 0); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_kill_2 (int *err, pid_t pid, int sig) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_laccess_2 (int *err, const char *pathname, int mode) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_lchown_3 (int *err, const char *path, |
+ __kernel_uid_t owner, __kernel_gid_t group) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_lchown32_3 (int *err, const char *path, |
+ uid_t owner, gid_t group) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_link_2 (int *err, const char *oldpath, const char *newpath) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_linkat_5 (int *err, int olddfd, const char *oldname, |
+ int newdfd, const char *newname, int flags) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_madvise_3 (int *err, void *addr, size_t length, int advice) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_mkdir_2 (int *err, const char *pathname, mode_t mode) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_mkdirat_3 (int *err, int dirfd, const char *pathname, |
+ mode_t mode) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_mknod_3 (int *err, const char *pathname, |
+ mode_t mode, dev_t dev) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_mknodat_4 (int *err, int dirfd, const char *pathname, |
+ mode_t mode, dev_t dev) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+struct mq_attr; |
+__extern_always_inline int/*mqd_t*/ |
+INTERNAL_SYSCALL_mq_open_4 (int *err, const char *name, int oflag, mode_t mode, |
+ struct mq_attr *attr) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_mq_notify_2 (int *err, int/*mqd_t*/ mqdes, |
+ const struct sigevent *notification) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_mq_unlink_1 (int *err, const char *name) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_munmap_2 (int *err, void *addr, size_t length) |
+{ |
+ (*err) = __nacl_irt_munmap(addr, length); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_poll_3 (int *err, struct pollfd *fds, nfds_t nfds, int timeout) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_ppoll_5 (int *err, struct pollfd *fds, nfds_t nfds, |
+ const struct timespec *timeout, |
+ const sigset_t *sigmask, size_t sigsetsize) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline long |
+INTERNAL_SYSCALL_ptrace_4 (int *err, enum __ptrace_request request, pid_t pid, |
+ void *addr, void *data) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_putmsg_4 (int *err, int fildes, const struct strbuf *ctlptr, |
+ const struct strbuf *dataptr, int flags) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_putpmsg_5 (int *err, int fildes, const struct strbuf *ctlptr, |
+ const struct strbuf *dataptr, int band, int flags) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_readahead_4 (int *err, int fd, |
+ __LONG_LONG_PAIR(long offset_high, |
+ long offset_low), size_t count) |
+{ |
+#if 0 |
+ off64_t offset = ((off64_t)offset_high) << 32 | offset_low; |
+#endif |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline ssize_t |
+INTERNAL_SYSCALL_readv_3 (int *err, int fd, const |
+ struct iovec *iov, int iovcnt) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline ssize_t |
+INTERNAL_SYSCALL_readlink_3 (int *err, const char *path, |
+ char *buf, size_t bufsiz) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline ssize_t |
+INTERNAL_SYSCALL_readlinkat_4 (int *err, int dirfd, const char *pathname, |
+ char *buf, size_t bufsiz) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_reboot_4 (int *err, int magic1, int magic2, int cmd, void *arg) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_reboot_3 (int *err, int magic1, int magic2, int howto) |
+{ |
+ return INTERNAL_SYSCALL_reboot_4 (err, magic1, magic2, howto, NULL); |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_rename_2 (int *err, const char *oldpath, const char *newpath) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_renameat_4 (int *err, int olddfd, const char *oldname, |
+ int newdfd, const char *newname) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_rmdir_1 (int *err, const char *pathname) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_rt_sigpending_2(int *err, sigset_t *set, size_t sigsetsize) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_rt_sigprocmask_4 (int *err, int how, const sigset_t *set, |
+ sigset_t *oldset, size_t sigsetsize) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_rt_sigqueueinfo_3 (int *err, pid_t pid, int sig, |
+ siginfo_t *info) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_rt_sigsuspend_2 (int *err, const sigset_t *mask, |
+ size_t sigsetsize) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_rt_sigtimedwait_4 (int *err, const sigset_t *set, |
+ siginfo_t *info, |
+ const struct timespec *timeout, |
+ size_t sigsetsize) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_sched_getaffinity_3 (int *err, pid_t pid, size_t cpusetsize, |
+ cpu_set_t *mask) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_sched_getparam_2 (int *err, pid_t pid, |
+ struct sched_param *param) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_sched_get_priority_min_1 (int *err, int policy) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_sched_get_priority_max_1 (int *err, int policy) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_sched_getscheduler_1 (int *err, pid_t pid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_sched_setaffinity_3 (int *err, pid_t pid, size_t cpusetsize, |
+ const cpu_set_t *mask) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_sched_setparam_2 (int *err, pid_t pid, |
+ struct sched_param *param) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_sched_setscheduler_3 (int *err, pid_t pid, int policy, |
+ const struct sched_param *param) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setfsgid_1 (int *err, __kernel_gid_t gid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setfsgid32_1 (int *err, gid_t gid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setfsuid_1 (int *err, __kernel_uid_t uid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setfsuid32_1 (int *err, uid_t uid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setgid_1 (int *err, __kernel_gid_t gid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setgid32_1 (int *err, gid_t gid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setgroups_2 (int *err, int size, const __kernel_gid_t *list) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setgroups32_2 (int *err, int size, const gid_t *list) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setpriority_3 (int *err, int which, int who, int prio) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setregid_2 (int *err, __kernel_gid_t rgid, __kernel_gid_t egid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setregid32_2 (int *err, gid_t rgid, gid_t egid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setresgid_3 (int *err, __kernel_gid_t rgid, |
+ __kernel_gid_t egid, __kernel_gid_t sgid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setresgid32_3 (int *err, gid_t rgid, gid_t egid, gid_t sgid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setresuid_3 (int *err, __kernel_uid_t ruid, |
+ __kernel_uid_t euid, __kernel_uid_t suid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setresuid32_3 (int *err, uid_t ruid, uid_t euid, uid_t suid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setreuid_2 (int *err, __kernel_uid_t ruid, __kernel_uid_t euid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setreuid32_2 (int *err, uid_t ruid, uid_t euid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_set_robust_list_2 (int *err, struct robust_list_head *head, |
+ size_t len) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setuid_1 (int *err, __kernel_uid_t uid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_setuid32_1 (int *err, uid_t uid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_signalfd4_4 (int *err, int fd, const sigset_t *mask, |
+ size_t sigsetsize, int flags) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_signalfd_3 (int *err, int fd, const sigset_t *mask, |
+ size_t sigsetsize) |
+{ |
+ return INTERNAL_SYSCALL_signalfd4_4 (err, fd, mask, sigsetsize, 0); |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_symlink_2 (int *err, const char *oldpath, const char *newpath) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_symlinkat_3 (int *err, const char *oldpath, |
+ int newdirfd, const char *newpath) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_sync_file_range_6 (int *err, int fd, |
+ __LONG_LONG_PAIR(long offset_high, |
+ long offset_low), |
+ __LONG_LONG_PAIR(long nbytes_high, |
+ long nbytes_low), |
+ unsigned int flags) |
+{ |
+#if 0 |
+ off64_t offset = ((off64_t)offset_high) << 32 | offset_low; |
+ off64_t nbytes = ((off64_t)nbytes_high) << 32 | nbytes_low; |
+#endif |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL__sysctl_1 (int *err, struct __sysctl_args *args) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_tgkill_3 (int *err, gid_t tgid, pid_t tid, int sig) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_timer_create_3 (int *err, clockid_t clockid, |
+ struct sigevent *evp, |
+ __kernel_timer_t *timerid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_timer_delete_1 (int *err, __kernel_timer_t timerid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_timer_getoverrun_1 (int *err, __kernel_timer_t timerid) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_timer_gettime_2 (int *err, __kernel_timer_t timerid, |
+ struct itimerspec *curr_value) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_timer_settime_4 (int *err, __kernel_timer_t timerid, int flags, |
+ const struct itimerspec *new_value, |
+ struct itimerspec * old_value) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline clock_t |
+INTERNAL_SYSCALL_times_1 (int *err, struct tms *buf) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_tkill_2 (int *err, pid_t tid, int sig) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_unlink_1 (int *err, const char *pathname) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_unlinkat_3 (int *err, int dirfd, const char *pathname, |
+ int flags) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_ustat_2 (int *err, dev_t dev, struct ustat *ubuf) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_utime_2 (int *err, const char *filename, |
+ const struct utimbuf *times) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_utimes_2 (int *err, const char *filename, |
+ const struct timeval times[2]) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_utimensat_4 (int *err, int dirfd, const char *pathname, |
+ const struct timespec times[2], int flags) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline pid_t |
+INTERNAL_SYSCALL_wait3_3 (int *err, int *status, int options, |
+ struct rusage *rusage) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline pid_t |
+INTERNAL_SYSCALL_wait4_4 (int *err, pid_t pid, int *status, int options, |
+ struct rusage *rusage) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
+ |
+__extern_always_inline ssize_t |
+INTERNAL_SYSCALL_write_3 (int *err, int fd, const void *buf, size_t count) |
+{ |
+ size_t nwrote; |
+ (*err) = __nacl_irt_write (fd, buf, count, &nwrote); |
+ return nwrote; |
+} |
+ |
+__extern_always_inline ssize_t |
+INTERNAL_SYSCALL_writev_3 (int *err, int fd, const |
+ struct iovec *iov, int iovcnt) |
+{ |
+ (*err) = (38 /* ENOSYS */); |
+ return 0; |
+} |
#endif |
#include_next <sysdep.h> |
+#if !defined(__ASSEMBLER__) && \ |
+ defined(THREAD_SELF) && defined(CLOCK_IDFIELD_SIZE) |
+#include <tls.h> |
+ |
+/* We don't support redefinition of this function. We always use 30 bits of the |
+ address of pthread structure as TID. */ |
+__extern_always_inline pid_t |
+INTERNAL_SYSCALL_gettid_0 (int *err) |
+{ |
+ (*err) = 0; |
+ /* Native Client does not have a notion of a thread ID, so we make |
+ one up. This must be small enough to leave space for number |
+ identifying the clock. Use CLOCK_IDFIELD_SIZE to guarantee |
+ that. */ |
+ return ((unsigned int) THREAD_SELF) >> CLOCK_IDFIELD_SIZE; |
+} |
+ |
+/* We can not return error code - this function is not supposed to fail. |
+ It should return pid (which is equal to tid for the main process). |
+ It's only ever called from main process so we just return TID. */ |
+__extern_always_inline int |
+INTERNAL_SYSCALL_set_tid_address_1 (int *err, volatile int *tidptr) |
+{ |
+ return INTERNAL_SYSCALL_gettid_0 (err); |
+} |
+#endif |
+ |
+#undef INTERNAL_SYSCALL_DECL |
+#define INTERNAL_SYSCALL_DECL(err) int err |
+ |
+#undef INTERNAL_SYSCALL_ERRNO |
+#define INTERNAL_SYSCALL_ERRNO(val, err) err |
pasko-google - do not use
2011/09/02 16:25:24
(err)
khim
2011/09/02 16:36:09
Done.
|
+ |
+#undef INTERNAL_SYSCALL_ERROR_P |
+#define INTERNAL_SYSCALL_ERROR_P(val, err) err |
pasko-google - do not use
2011/09/02 16:25:24
(err)
khim
2011/09/02 16:36:09
Done.
|
+ |
+/* Define a macro which expands inline into the wrapper code for a IRT |
+ call. */ |
+# undef INLINE_SYSCALL |
+# define INLINE_SYSCALL(name, nr, args...) \ |
+ ({ \ |
+ INTERNAL_SYSCALL_DECL (err); \ |
+ unsigned long int resultvar = INTERNAL_SYSCALL (name, err, nr , ## args); \ |
+ if (__builtin_expect (err, 0)) \ |
+ { \ |
+ __set_errno (err); \ |
+ resultvar = (unsigned long int) -1; \ |
+ } \ |
+ (long int) resultvar; }) |
+ |
+#undef INTERNAL_VSYSCALL |
+#define INTERNAL_VSYSCALL INTERNAL_SYSCALL |
+ |
#undef __NR_fallocate |
#undef __NR_pselect6 |
#undef __NR_rt_sigaction |
@@ -319,6 +1281,7 @@ INTERNAL_SYSCALL_futex6 (union __attribute__ ((__transparent_union__)) |
#define PSEUDO_END_NOERRNO(name) \ |
END (name) |
+#undef ret_NOERRNO |
#define ret_NOERRNO NACLRET |
/* The function has to return the error code. */ |