[ltrace-commits] 04/06: Force use of SYS_open on aarch64 as well

Petr Machata pmachata-guest at moszumanska.debian.org
Wed Feb 5 01:17:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

pmachata-guest pushed a commit to branch pmachata/aarch64
in repository ltrace.

commit 63753e08aaec64973649fcf17368740bebeea21e
Author: Petr Machata <pmachata at apm-mustang-ev2-02.ml3.eng.bos.redhat.com>
Date:   Thu Jan 30 19:42:16 2014 -0500

    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 <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);
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/ltrace.git



More information about the ltrace-commits mailing list