[PATCH] Add an option for raising Strauss awareness

Eugene Syromyatnikov evgsyr at gmail.com
Sun Apr 1 00:50:14 UTC 2018


As Der Strauss is the strace mascot and also an endangered species,
it is now strace's responsibility to raise awareness about it,
in a most strace way possible.

* straus.c: New file.
* straus.h: New header.
* Makefile.am [ENABLE_STRAUS] (strace_SOURCES): Add them.
* configure.ac: Add an option for enabling ability to raise Strauss
awareness.
* strace.c [ENABLE_STRAUS]: Include "straus.h"
[ENABLE_STRAUS] (straus_flag): New static variable.
(print_version): Print straus flag.
[ENABLE_STRAUS] (usage): Print information about -R option.
(printleader): Call print_straus if straus_flag is enabled.
[ENABLE_STRAUS] (init): Parse -R option.
* tests/straus.c: New file.
* tests/straus.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.
* tests/.gitignore: Add straus.
* tests/strace-V.test: Update expected output.
(getoption): Move it...
* tests/init.sh (getoption): ...here.
* tests/pure_executables.list: Add straus.
* strace.1.in: Document it.
* NEWS: Mention it.
---
 Makefile.am                 |   4 ++
 NEWS                        |   1 +
 configure.ac                |  16 +++++
 strace.1.in                 |   5 +-
 strace.c                    |  28 ++++++++
 straus.c                    |  80 +++++++++++++++++++++
 straus.h                    |  33 +++++++++
 tests/.gitignore            |   1 +
 tests/Makefile.am           |   1 +
 tests/init.sh               |  17 +++++
 tests/pure_executables.list |   1 +
 tests/strace-V.test         |  20 +-----
 tests/straus.c              | 169 ++++++++++++++++++++++++++++++++++++++++++++
 tests/straus.test           |   9 +++
 14 files changed, 366 insertions(+), 19 deletions(-)
 create mode 100644 straus.c
 create mode 100644 straus.h
 create mode 100644 tests/straus.c
 create mode 100755 tests/straus.test

diff --git a/Makefile.am b/Makefile.am
index b961a6d..1b6d356 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -356,6 +356,10 @@ strace_LDADD += $(libiberty_LIBS)
 endif
 endif
 
+if ENABLE_STRAUS
+strace_SOURCES += straus.c straus.h
+endif
+
 @CODE_COVERAGE_RULES@
 CODE_COVERAGE_BRANCH_COVERAGE = 1
 CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
diff --git a/NEWS b/NEWS
index e26ccb9..75fcb9a 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Noteworthy changes in release ?.?? (????-??-??)
   * Known pixel/SDR format names are printed as comments for pixelformat fields
     in v4l2 structures.
   * Enhanced decoding of kern_features syscall.
+  * Added ability to raise Strauss awareness.
 
 * Bug fixes
   * Fixed build on m68k.
diff --git a/configure.ac b/configure.ac
index 4b8bc73..2f57c81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -994,6 +994,22 @@ if test "$arch" = mips && test "$no_create" != yes; then
 	fi
 fi
 
+AC_ARG_ENABLE([straus],
+	[AS_HELP_STRING([--enable-straus=yes|no],
+		[whether to enable option for increasing Strauss awareness])],
+		[case "$enableval" in
+			yes|no) enable_straus="$enableval" ;;
+			*) AC_MSG_ERROR([bad value $enableval for enable-straus
+					 option. Valid options are: yes, no.])
+			;;
+		 esac],
+		[enable_straus=no])
+
+if test "x$enable_straus" = xyes; then
+	AC_DEFINE([ENABLE_STRAUS], 1, [Enable an option for raising Strauss awareness])
+fi
+AM_CONDITIONAL([ENABLE_STRAUS], [test "x$enable_straus" = xyes])
+
 AC_ARG_ENABLE([mpers],
 	[AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32],
 		[whether to enable multiple personalities support required
diff --git a/strace.1.in b/strace.1.in
index b0b692d..a9d3661 100644
--- a/strace.1.in
+++ b/strace.1.in
@@ -58,7 +58,7 @@
 strace \- trace system calls and signals
 .SH SYNOPSIS
 .SY strace
-.OP \-CdffhikqrtttTvVxxy
+.OP \-CdffhikqrRtttTvVxxy
 .OP \-I n
 .OP \-b execve
 .OM \-e expr
@@ -288,6 +288,9 @@ Print a relative timestamp upon entry to each system call.  This
 records the time difference between the beginning of successive
 system calls.
 .TP
+.B \-R
+Raise Strauss awareness in the output.
+.TP
 .BI "\-s " strsize
 Specify the maximum string size to print (the default is 32).  Note
 that filenames are not considered strings and are always printed in
diff --git a/strace.c b/strace.c
index 4535645..8142769 100644
--- a/strace.c
+++ b/strace.c
@@ -59,6 +59,10 @@
 #include "xstring.h"
 #include "delay.h"
 
+#ifdef ENABLE_STRAUS
+#include "straus.h"
+#endif
+
 /* In some libc, these aren't declared. Do it ourself: */
 extern char **environ;
 extern int optind;
@@ -96,6 +100,10 @@ static unsigned int tflag;
 static bool rflag;
 static bool print_pid_pfx;
 
+#ifdef ENABLE_STRAUS
+static bool straus_flag;
+#endif
+
 /* -I n */
 enum {
 	INTR_NOT_SET        = 0,
@@ -221,6 +229,9 @@ print_version(void)
 		" no-mx32-mpers"
 # endif
 #endif /* SUPPORTED_PERSONALITIES > 2 */
+#ifdef ENABLE_STRAUS
+		" straus"
+#endif
 		"";
 
 	printf("%s -- version %s\n"
@@ -300,6 +311,10 @@ Miscellaneous:\n\
   -h             print help message\n\
   -V             print version\n\
 "
+#ifdef ENABLE_STRAUS
+"  -R             raise Strauss awareness\n"
+#endif
+
 /* ancient, no one should use it
 -F -- attempt to follow vforks (deprecated, use -f)\n\
  */
@@ -638,6 +653,11 @@ printleader(struct tcb *tcp)
 	set_current_tcp(tcp);
 	current_tcp->curcol = 0;
 
+#ifdef ENABLE_STRAUS
+	if (straus_flag)
+		print_straus();
+#endif
+
 	if (print_pid_pfx)
 		tprintf("%-5d ", tcp->pid);
 	else if (nprocs > 1 && !outfname)
@@ -1581,6 +1601,9 @@ init(int argc, char *argv[])
 #ifdef USE_LIBUNWIND
 	    "k"
 #endif
+#ifdef ENABLE_STRAUS
+	    "R"
+#endif
 	    "a:b:cCdDe:E:fFhiI:o:O:p:P:qrs:S:tTu:vVwxyz")) != EOF) {
 		switch (c) {
 		case 'a':
@@ -1662,6 +1685,11 @@ init(int argc, char *argv[])
 		case 'r':
 			rflag = 1;
 			break;
+#ifdef ENABLE_STRAUS
+		case 'R':
+			straus_flag = 1;
+			break;
+#endif /* ENABLE_STRAUS */
 		case 's':
 			i = string_to_uint(optarg);
 			if (i < 0 || (unsigned int) i > -1U / 4)
diff --git a/straus.c b/straus.c
new file mode 100644
index 0000000..1f4706d
--- /dev/null
+++ b/straus.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+
+#include "straus.h"
+
+static const char *straus[] = {
+	"     ____                ",
+	"    /    \\               ",
+	"   |-. .-.|              ",
+	"   (_@)(_@)              ",
+	"   .---_  \\              ",
+	"  /..   \\_/              ",
+	"  |__.-^ /               ",
+	"      }  |               ",
+	"     |   [               ",
+	"     [  ]                ",
+	"    ]   |                ",
+	"    |   [                ",
+	"    [  ]                 ",
+	"   /   |        __       ",
+	"  \\|   |/     _/ /_      ",
+	" \\ |   |//___/__/__/_    ",
+	"\\\\  \\ /  //    -____/_   ",
+	"//   \"   \\\\      \\___.-  ",
+	" //     \\\\  __.----._/_  ",
+	"/ //|||\\\\ .-         __> ",
+	"[        /         __.-  ",
+	"[        [           }   ",
+	"\\        \\          /    ",
+	" \"-._____ \\.____.--\"     ",
+	"    |  | |  |            ",
+	"    |  | |  |            ",
+	"    |  | |  |            ",
+	"    |  | |  |            ",
+	"    {  } {  }            ",
+	"    |  | |  |            ",
+	"    |  | |  |            ",
+	"    |  | |  |            ",
+	"    /  { |  |            ",
+	" .-\"   / [   -._         ",
+	"/___/ /   \\ \\___\"-.      ",
+	"    -\"     \"-            ",
+	"                         ",
+	};
+
+void
+print_straus(void)
+{
+	static size_t pos;
+
+	tprints(straus[pos]);
+
+	pos = (pos + 1) % ARRAY_SIZE(straus);
+}
diff --git a/straus.h b/straus.h
new file mode 100644
index 0000000..826b323
--- /dev/null
+++ b/straus.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef STRACE_STRAUS_H
+#define STRACE_STRAUS_H
+
+extern void print_straus(void);
+
+#endif /* STRACE_STRAUS_H */
diff --git a/tests/.gitignore b/tests/.gitignore
index d55ee49..4dc3e38 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -444,6 +444,7 @@ stat64
 statfs
 statfs64
 statx
+straus
 swap
 sxetmask
 symlink
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c02542b..fbe9b91 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -315,6 +315,7 @@ MISC_TESTS = \
 	strace-t.test \
 	strace-tt.test \
 	strace-ttt.test \
+	straus.test \
 	termsig.test \
 	threads-execve.test \
 	# end of MISC_TESTS
diff --git a/tests/init.sh b/tests/init.sh
index 1f5ab49..6a03fbe 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -332,6 +332,23 @@ test_trace_expr()
 		< negative.list
 }
 
+# getoption OPTION YES_STRING [NO_STRING]
+#
+# Returns YES_STRING in case OPTION is enabled (present in config.h and has
+# a non-zero numeric value). Otherwise, NO_STRING (or empty string, if not
+# specified) is returned.
+getoption()
+{
+	local opt
+	opt=$(sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*([0-9]+)$/\1/p' \
+		../../config.h)
+	if [ -n "$opt" -a "$opt" != 0 ]; then
+		printf "%s" "$2"
+	else
+		printf "%s" "${3-}"
+	fi
+}
+
 check_prog cat
 check_prog rm
 
diff --git a/tests/pure_executables.list b/tests/pure_executables.list
index d78bd4d..a76ec28 100755
--- a/tests/pure_executables.list
+++ b/tests/pure_executables.list
@@ -365,6 +365,7 @@ stat64
 statfs
 statfs64
 statx
+straus
 swap
 sxetmask
 symlink
diff --git a/tests/strace-V.test b/tests/strace-V.test
index eb05e86..486e83e 100755
--- a/tests/strace-V.test
+++ b/tests/strace-V.test
@@ -14,23 +14,6 @@ getstr()
 		../../config.h
 }
 
-# getoption OPTION YES_STRING [NO_STRING]
-#
-# Returns YES_STRING in case OPTION is enabled (present in config.h and has
-# a non-zero numeric value). Otherwise, NO_STRING (or empty string, if not
-# specified) is returned.
-getoption()
-{
-	local opt
-	opt=$(sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*([0-9]+)$/\1/p' \
-		../../config.h)
-	if [ -n "$opt" -a "$opt" -ne 0 ]; then
-		printf "%s" "$2"
-	else
-		printf "%s" "${3-}"
-	fi
-}
-
 config_year=$(getstr COPYRIGHT_YEAR)
 
 [ "$year" -ge "$config_year" ] && [ "$config_year" -ge 2017 ] || {
@@ -40,6 +23,7 @@ config_year=$(getstr COPYRIGHT_YEAR)
 
 option_unwind=$(getoption USE_LIBUNWIND " stack-unwind")
 option_demangle=$(getoption USE_DEMANGLE " stack-demangle")
+option_straus=$(getoption ENABLE_STRAUS " straus")
 
 option_m32=
 option_mx32=
@@ -53,7 +37,7 @@ aarch64|powerpc64|riscv|s390x|sparc64|tile|x32)
 	;;
 esac
 
-features="${option_unwind}${option_demangle}${option_m32}${option_mx32}"
+features="${option_unwind}${option_demangle}${option_m32}${option_mx32}${option_straus}"
 [ -n "$features" ] || features=" (none)"
 
 cat > "$EXP" << __EOF__
diff --git a/tests/straus.c b/tests/straus.c
new file mode 100644
index 0000000..8be93ba
--- /dev/null
+++ b/tests/straus.c
@@ -0,0 +1,169 @@
+/*
+ * Check decoding of Der Strauss output.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+
+#include <stdio.h>
+#include <unistd.h>
+
+int main(void)
+{
+	long rc;
+
+	rc = chdir("...1");
+	printf("     ____                chdir(\"...1\")    = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...2");
+	printf("    /    \\               chdir(\"...2\")    = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...3");
+	printf("   |-. .-.|              chdir(\"...3\")    = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...4");
+	printf("   (_@)(_@)              chdir(\"...4\")    = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...5");
+	printf("   .---_  \\              chdir(\"...5\")    = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...6");
+	printf("  /..   \\_/              chdir(\"...6\")    = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...7");
+	printf("  |__.-^ /               chdir(\"...7\")    = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...8");
+	printf("      }  |               chdir(\"...8\")    = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...9");
+	printf("     |   [               chdir(\"...9\")    = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...10");
+	printf("     [  ]                chdir(\"...10\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...11");
+	printf("    ]   |                chdir(\"...11\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...12");
+	printf("    |   [                chdir(\"...12\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...13");
+	printf("    [  ]                 chdir(\"...13\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...14");
+	printf("   /   |        __       chdir(\"...14\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...15");
+	printf("  \\|   |/     _/ /_      chdir(\"...15\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...16");
+	printf(" \\ |   |//___/__/__/_    chdir(\"...16\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...17");
+	printf("\\\\  \\ /  //    -____/_   chdir(\"...17\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...18");
+	printf("//   \"   \\\\      \\___.-  chdir(\"...18\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...19");
+	printf(" //     \\\\  __.----._/_  chdir(\"...19\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...20");
+	printf("/ //|||\\\\ .-         __> chdir(\"...20\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...21");
+	printf("[        /         __.-  chdir(\"...21\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...22");
+	printf("[        [           }   chdir(\"...22\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...23");
+	printf("\\        \\          /    chdir(\"...23\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...24");
+	printf(" \"-._____ \\.____.--\"     chdir(\"...24\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...25");
+	printf("    |  | |  |            chdir(\"...25\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...26");
+	printf("    |  | |  |            chdir(\"...26\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...27");
+	printf("    |  | |  |            chdir(\"...27\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...28");
+	printf("    |  | |  |            chdir(\"...28\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...29");
+	printf("    {  } {  }            chdir(\"...29\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...30");
+	printf("    |  | |  |            chdir(\"...30\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...31");
+	printf("    |  | |  |            chdir(\"...31\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...32");
+	printf("    |  | |  |            chdir(\"...32\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...33");
+	printf("    /  { |  |            chdir(\"...33\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...34");
+	printf(" .-\"   / [   -._         chdir(\"...34\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...35");
+	printf("/___/ /   \\ \\___\"-.      chdir(\"...35\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...36");
+	printf("    -\"     \"-            chdir(\"...36\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...37");
+	printf("                         chdir(\"...37\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...38");
+	printf("     ____                chdir(\"...38\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...39");
+	printf("    /    \\               chdir(\"...39\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...40");
+	printf("   |-. .-.|              chdir(\"...40\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...41");
+	printf("   (_@)(_@)              chdir(\"...41\")   = %s\n",
+	       sprintrc(rc));
+	rc = chdir("...42");
+	printf("   .---_  \\              chdir(\"...42\")   = %s\n",
+	       sprintrc(rc));
+
+	puts("  /..   \\_/              +++ exited with 0 +++");
+
+	return 0;
+}
diff --git a/tests/straus.test b/tests/straus.test
new file mode 100755
index 0000000..be34ea9
--- /dev/null
+++ b/tests/straus.test
@@ -0,0 +1,9 @@
+#!/bin/sh -efu
+
+. "${srcdir=.}/init.sh"
+
+enable_straus=$(getoption ENABLE_STRAUS "1" "0")
+
+[ 1 = "$enable_straus" ] || skip_ "strace is built without Der Strauss option"
+
+run_strace_match_diff -a42 -R -e trace=chdir
-- 
2.1.4



More information about the Strace-devel mailing list