summaryrefslogblamecommitdiffstats
path: root/testutil/perror-all.c
blob: d7ee45b027905617ac89a03f0bda7455b6672b26 (plain) (tree)
1
2
3
4
5
6
7
8
9
10





                                                         



                                                                                         

   
                           


                        



                                                 









                                                                       
/* See LICENSE file for copyright and license details. */
#include "../libsyscalls.h"

#include <stddef.h>
#include <stdio.h>

#if defined(__clang__)
# pragma clang diagnostic ignored "-Wunsafe-buffer-usage" /* clang is just being silly */
#endif


int
main(int argc, char **argv)
{
	size_t i, count;

	if (argc < 1 || argc > 2) {
		fprintf(stderr, "usage error\n");
		return 3;
	}

#define X(...) 1
	count = (LIBSYSCALLS_LIST_ERRORS(X, +));
#undef X

	for (i = 0; i < count; i++)
		libsyscalls_perror(argv[1], (enum libsyscalls_error)i);

	return fflush(stderr) || fclose(stderr);
}