summaryrefslogtreecommitdiffstats
path: root/testutil/perror-bad.c
blob: 55d36d3dbc0280fe498e4d60d63e242af5093e12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* See LICENSE file for copyright and license details. */
#include "../libsyscalls.h"

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


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

	(void) argc;

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

	libsyscalls_perror(argv[1], (enum libsyscalls_error)-1);
	libsyscalls_perror(argv[1], (enum libsyscalls_error)count);

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