diff options
| author | munjinoo <2jwdream7029@naver.com> | 2019-05-06 13:55:50 +0900 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-05-07 08:48:35 +0200 |
| commit | 001e36bc7862e1663aa5e6608882e78f08ebab41 (patch) | |
| tree | 68f14264f40fe4a08b765ea4e3a225077307dec3 /executor | |
| parent | 04e9d8cedd9dc356d116c5387eac8c1ea9d547f7 (diff) | |
executor: change syscall argument type to intptr_t
The type size of long depends on compiler.
Therefore, changing to intptr_t makes it depends on architecture.
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/executor.cc | 8 | ||||
| -rw-r--r-- | executor/executor_akaros.h | 2 | ||||
| -rw-r--r-- | executor/executor_bsd.h | 2 | ||||
| -rw-r--r-- | executor/executor_fuchsia.h | 8 | ||||
| -rw-r--r-- | executor/executor_linux.h | 2 | ||||
| -rw-r--r-- | executor/executor_test.h | 2 | ||||
| -rw-r--r-- | executor/executor_windows.h | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/executor/executor.cc b/executor/executor.cc index fad53657c..492cb314d 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -172,7 +172,7 @@ static const uint64 arg_csum_inet = 0; static const uint64 arg_csum_chunk_data = 0; static const uint64 arg_csum_chunk_const = 1; -typedef long(SYSCALLAPI* syscall_t)(long, long, long, long, long, long, long, long, long); +typedef intptr_t(SYSCALLAPI* syscall_t)(intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t, intptr_t); struct call_t { const char* name; @@ -199,8 +199,8 @@ struct thread_t { int call_index; int call_num; int num_args; - long args[kMaxArgs]; - long res; + intptr_t args[kMaxArgs]; + intptr_t res; uint32 reserrno; bool fault_injected; cover_t cov; @@ -847,7 +847,7 @@ void handle_completion(thread_t* th) if (event_isset(&th->ready) || !event_isset(&th->done) || !th->executing) fail("bad thread state in completion: ready=%d done=%d executing=%d", event_isset(&th->ready), event_isset(&th->done), th->executing); - if (th->res != (long)-1) + if (th->res != (intptr_t)-1) copyout_call_results(th); if (!collide && !th->colliding) { write_call_output(th, true); diff --git a/executor/executor_akaros.h b/executor/executor_akaros.h index e60e7cfc6..82cae909d 100644 --- a/executor/executor_akaros.h +++ b/executor/executor_akaros.h @@ -19,7 +19,7 @@ static void os_init(int argc, char** argv, void* data, size_t data_size) } } -static long execute_syscall(const call_t* c, long a[kMaxArgs]) +static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs]) { return syscall(c->sys_nr, a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); } diff --git a/executor/executor_bsd.h b/executor/executor_bsd.h index 15ac8aad2..055c69b6c 100644 --- a/executor/executor_bsd.h +++ b/executor/executor_bsd.h @@ -31,7 +31,7 @@ static void os_init(int argc, char** argv, void* data, size_t data_size) setrlimit(RLIMIT_NOFILE, &rlim); } -static long execute_syscall(const call_t* c, long a[kMaxArgs]) +static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs]) { if (c->call) return c->call(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); diff --git a/executor/executor_fuchsia.h b/executor/executor_fuchsia.h index 0703a07dc..9256f6b02 100644 --- a/executor/executor_fuchsia.h +++ b/executor/executor_fuchsia.h @@ -17,9 +17,9 @@ static void os_init(int argc, char** argv, void* data, size_t data_size) fail("mmap of data segment failed with: %d", status); } -static long execute_syscall(const call_t* c, long a[kMaxArgs]) +static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs]) { - long res = c->call(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); + intptr_t res = c->call(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); if (strncmp(c->name, "zx_", 3) == 0) { // Convert zircon error convention to the libc convention that executor expects. // The following calls return arbitrary integers instead of error codes. @@ -32,9 +32,9 @@ static long execute_syscall(const call_t* c, long a[kMaxArgs]) errno = (-res) & 0x7f; return -1; } - // We cast libc functions to signature returning long, + // We cast libc functions to signature returning intptr_t, // as the result int -1 is returned as 0x00000000ffffffff rather than full -1. if (res == 0xffffffff) - res = (long)-1; + res = (intptr_t)-1; return res; } diff --git a/executor/executor_linux.h b/executor/executor_linux.h index 489fb56a5..f98a93f90 100644 --- a/executor/executor_linux.h +++ b/executor/executor_linux.h @@ -48,7 +48,7 @@ static void os_init(int argc, char** argv, void* data, size_t data_size) static __thread cover_t* current_cover; -static long execute_syscall(const call_t* c, long a[kMaxArgs]) +static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs]) { if (c->call) return c->call(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); diff --git a/executor/executor_test.h b/executor/executor_test.h index e85057d23..5984fc8f1 100644 --- a/executor/executor_test.h +++ b/executor/executor_test.h @@ -13,7 +13,7 @@ static void os_init(int argc, char** argv, void* data, size_t data_size) fail("mmap of data segment failed"); } -static long execute_syscall(const call_t* c, long a[kMaxArgs]) +static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs]) { return c->call(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); } diff --git a/executor/executor_windows.h b/executor/executor_windows.h index a6159fb44..1e210826b 100644 --- a/executor/executor_windows.h +++ b/executor/executor_windows.h @@ -12,7 +12,7 @@ static void os_init(int argc, char** argv, void* data, size_t data_size) fail("mmap of data segment failed"); } -static long execute_syscall(const call_t* c, long a[kMaxArgs]) +static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs]) { __try { return c->call(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); |
