about summary refs log tree commit diff
path: root/elf/argv0test.c
diff options
context:
space:
mode:
authorVincent Mihalkovic <vmihalko@redhat.com>2020-09-29 12:34:39 +0200
committerFlorian Weimer <fweimer@redhat.com>2020-09-29 12:34:40 +0200
commitc6702789344043fa998923c8f32ed0bdb2edfa9c (patch)
tree60362f3e9d0e1f5a886469d0575df25f5c71a2eb /elf/argv0test.c
parentd3c57027470b78dba79c6d931e4e409b1fecfc80 (diff)
downloadglibc-c6702789344043fa998923c8f32ed0bdb2edfa9c.tar.gz
glibc-c6702789344043fa998923c8f32ed0bdb2edfa9c.tar.xz
glibc-c6702789344043fa998923c8f32ed0bdb2edfa9c.zip
ld.so: add an --argv0 option [BZ #16124]
Diffstat (limited to 'elf/argv0test.c')
-rw-r--r--elf/argv0test.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/elf/argv0test.c b/elf/argv0test.c
new file mode 100644
index 0000000000..c22ba5ea70
--- /dev/null
+++ b/elf/argv0test.c
@@ -0,0 +1,31 @@
+/* Test for --argv0 option ld.so.
+
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <string.h>
+#include <support/check.h>
+
+static int
+do_test (int argc, char **argv)
+{
+  TEST_COMPARE_STRING (argv[0], "test-argv0");
+  return 0;
+}
+
+#define TEST_FUNCTION_ARGV do_test
+#include <support/test-driver.c>