aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@apm-mustang-ev2-02.ml3.eng.bos.redhat.com>2014-01-30 19:42:16 -0500
committerPetr Machata <pmachata@redhat.com>2014-02-05 02:08:41 +0100
commit63753e08aaec64973649fcf17368740bebeea21e (patch)
treec75badd29a1a50d7d1c1fb9402c9eeb99fdff058
parent81efcb04cd4e84ffd2c6ab851a2a10360956bd15 (diff)
downloadltrace-63753e08aaec64973649fcf17368740bebeea21e.tar.gz
Force use of SYS_open on aarch64 as well
- That system call is not implemented on aarch64, but we don't care, we are only calling it to see if the parameters get decoded properly. So call using the "syscall" wrapper, and hard-code SYS_open value on aarch64, where glibc doesn't define it.
-rw-r--r--testsuite/ltrace.main/system_call_params.exp18
1 files changed, 16 insertions, 2 deletions
diff --git a/testsuite/ltrace.main/system_call_params.exp b/testsuite/ltrace.main/system_call_params.exp
index 787e342..2ccf840 100644
--- a/testsuite/ltrace.main/system_call_params.exp
+++ b/testsuite/ltrace.main/system_call_params.exp
@@ -1,5 +1,5 @@
# This file is part of ltrace.
-# Copyright (C) 2013 Petr Machata, Red Hat Inc.
+# Copyright (C) 2013, 2014 Petr Machata, Red Hat Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -17,11 +17,25 @@
# 02110-1301 USA
set bin [ltraceCompile {} [ltraceSource c {
+ #define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+ #include <unistd.h>
+ #include <sys/syscall.h> /* For SYS_xxx definitions */
+
+ #ifndef SYS_open
+ # if defined(__aarch64__)
+ # /* Linux doesn't actually implement SYS_open on AArch64, but for merely
+ # * recording the syscall, it's fine. */
+ # define SYS_open 1024
+ # else
+ # error SYS_open not available.
+ # endif
+ #endif
+
int main(void) {
- open("/some/path", O_RDONLY);
+ syscall(SYS_open, "/some/path", O_RDONLY);
write(1, "something", 10);
mount("source", "target", "filesystemtype", 0, 0);
}