]> granicus.if.org Git - strace/blobdiff - desc.c
mmap_cache: add function to enable mmap_cache
[strace] / desc.c
diff --git a/desc.c b/desc.c
index b45a13b15efa867af012d9f72ff92181dff905d8..f99d25c6877ba64893f65603ee99d2a4ad9c3d0e 100644 (file)
--- a/desc.c
+++ b/desc.c
@@ -3,7 +3,7 @@
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
  * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
- * Copyright (c) 1999-2017 The strace developers.
+ * Copyright (c) 1999-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -196,29 +196,21 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
        return 0;
 }
 
+#if HAVE_ARCH_OLD_SELECT
 SYS_FUNC(oldselect)
 {
-       kernel_ulong_t select_args[5];
-       unsigned int oldselect_args[5];
+       kernel_ulong_t *args =
+               fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 5);
 
-       if (sizeof(*select_args) == sizeof(*oldselect_args)) {
-               if (umove_or_printaddr(tcp, tcp->u_arg[0], &select_args)) {
-                       return 0;
-               }
+       if (args) {
+               return decode_select(tcp, args, print_timeval, sprint_timeval);
        } else {
-               unsigned int i;
-
-               if (umove_or_printaddr(tcp, tcp->u_arg[0], &oldselect_args)) {
-                       return 0;
-               }
-
-               for (i = 0; i < 5; ++i) {
-                       select_args[i] = oldselect_args[i];
-               }
+               if (entering(tcp))
+                       printaddr(tcp->u_arg[0]);
+               return RVAL_DECODED;
        }
-
-       return decode_select(tcp, select_args, print_timeval, sprint_timeval);
 }
+#endif /* HAVE_ARCH_OLD_SELECT */
 
 #ifdef ALPHA
 SYS_FUNC(osf_select)