From d57069175dc37d27cd783d27c34f3b9c64bc3acf Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Thu, 30 Jan 2014 19:42:16 -0500 Subject: [PATCH] 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. --- testsuite/ltrace.main/system_call_params.exp | 18 ++++++++++++++++-- 1 file 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 #include #include + #include + #include /* 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); } -- 2.7.4