summaryrefslogtreecommitdiffstats
path: root/testutil/get-error.c
diff options
context:
space:
mode:
Diffstat (limited to 'testutil/get-error.c')
-rw-r--r--testutil/get-error.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/testutil/get-error.c b/testutil/get-error.c
new file mode 100644
index 0000000..8f066d7
--- /dev/null
+++ b/testutil/get-error.c
@@ -0,0 +1,27 @@
+/* See LICENSE file for copyright and license details. */
+#include "../libsyscalls.h"
+
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+
+
+int
+main(int argc, char *argv[])
+{
+ int i;
+
+ for (i = 1; i < argc; i++) {
+#define X(N, S)\
+ if (!strcmp(argv[i], #N))\
+ printf("%s\n", S)
+ LIBSYSCALLS_LIST_ERRORS(X, ;);
+#undef X
+ }
+
+ if (fflush(stdout) || fclose(stdout)) {
+ perror(NULL);
+ return 1;
+ }
+ return 0;
+}