SHA256
1
0
forked from pool/strace
strace/0014-stat64-v.test-add-newfstatat-syscall-support.patch
Martin Pluskal 0b44e76647 Accepting request 292570 from home:Andreas_Schwab:Factory
- 0001-aarch64-fix-rt_sigreturn-decoding.patch,
  0002-m68k-define-HAVE_SA_RESTORER.patch,
  0003-Fix-decoding-of-mmap2-for-arm.patch,
  0005-tests-select.test-handle-architectures-using-pselect.patch,
  0006-aarch64-fix-ioctl-decoding.patch,
  0007-m68k-fix-sigreturn-decoding.patch,
  0008-Fix-crash-in-ipc_sem-test.patch,
  0009-tests-ipc_-match-IPC_64-flag.patch,
  0010-semctl-fix-indirect-syscall-decoding.patch,
  0011-Fix-stat64-st_-acm-time-decoding-for-personalities-w.patch,
  0012-tests-verify-that-all-patterns-match.patch,
  0013-aarch64-properly-decode-generic-syscalls.patch,
  0014-stat64-v.test-add-newfstatat-syscall-support.patch,
  0015-tests-uid-use-fchown-instead-of-chown.patch: Patches from upstream
  to fix testsuite failure.
- Enable libunwind support (strace -k).

OBS-URL: https://build.opensuse.org/request/show/292570
OBS-URL: https://build.opensuse.org/package/show/devel:tools/strace?expand=0&rev=44
2015-03-24 18:25:03 +00:00

93 lines
2.4 KiB
Diff

From f79252f072a193bdff435afeaa6b6cd6d5c79947 Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Mon, 16 Mar 2015 17:18:40 +0000
Subject: [PATCH 14/15] stat64-v.test: add newfstatat syscall support
Newer architectures have no stat syscall, so stat() is implemented there
using newfstatat syscall.
* tests/stat.c (STAT_FNAME): Rename to STAT_PREFIX. Update callers.
[_FILE_OFFSET_BITS == 64] (STAT_PREFIX): Add newfstatat support.
(main) [!NR_stat]: Add newfstatat support.
Reported-by: Andreas Schwab <schwab@suse.de>
---
tests/stat.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/tests/stat.c b/tests/stat.c
index 21e37fb..2b04010 100644
--- a/tests/stat.c
+++ b/tests/stat.c
@@ -14,22 +14,22 @@
# include <sys/types.h>
#endif
-#undef STAT_FNAME
+#undef STAT_PREFIX
#undef NR_stat
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
# include <sys/stat.h>
-# define STAT_FNAME "stat(64)?"
+# define STAT_PREFIX "(stat(64)?\\(|newfstatat\\(AT_FDCWD, )"
#else
# include <sys/syscall.h>
# if defined __NR_stat
# define NR_stat __NR_stat
-# define STAT_FNAME "stat"
+# define STAT_PREFIX "stat\\("
# elif defined __NR_newstat
# define NR_stat __NR_newstat
-# define STAT_FNAME "newstat"
+# define STAT_PREFIX "newstat\\("
# endif
-# ifdef STAT_FNAME
+# ifdef STAT_PREFIX
/* for S_IFMT */
# define stat libc_stat
# define stat64 libc_stat64
@@ -57,10 +57,10 @@
# define off_t __kernel_off_t
# define loff_t __kernel_loff_t
# include <asm/stat.h>
-# endif /* STAT_FNAME */
+# endif /* STAT_PREFIX */
#endif /* _FILE_OFFSET_BITS */
-#ifdef STAT_FNAME
+#ifdef STAT_PREFIX
static void
print_ftype(unsigned int mode)
@@ -115,7 +115,7 @@ main(int ac, const char **av)
assert(stat(av[1], &stb) == 0);
#endif
- printf(STAT_FNAME "\\(\"%s\", \\{", av[1]);
+ printf(STAT_PREFIX "\"%s\", \\{", av[1]);
printf("st_dev=makedev\\(%u, %u\\)",
(unsigned int) major(stb.st_dev),
(unsigned int) minor(stb.st_dev));
@@ -159,11 +159,15 @@ main(int ac, const char **av)
printf("(, st_flags=[0-9]+)?");
printf("(, st_fstype=[^,]*)?");
printf("(, st_gen=[0-9]+)?");
- printf("\\}\\) += 0\n");
+ printf("\\}");
+#ifndef NR_stat
+ printf("(, 0)?");
+#endif
+ printf("\\) += 0\n");
return 0;
}
-#else /* !STAT_FNAME */
+#else /* !STAT_PREFIX */
int main(void)
{
return 77;
--
2.3.3