Update.
[glibc.git] / stdio-common / temptest.c
blob71868174db8dcc9dcf3eca666bd87a41b1cb5090
1 #include <stdio.h>
2 #include <string.h>
4 char *files[500];
6 int
7 main (int argc, char *argv[])
9 char buf[FILENAME_MAX];
10 char *fn;
11 FILE *fp;
12 int i;
14 for (i = 0; i < 500; i++) {
15 fn = __stdio_gen_tempname(buf, sizeof (buf), (const char *) NULL,
16 "file", 0, (size_t *) NULL, (FILE **) NULL);
17 if (fn == NULL) {
18 printf ("__stdio_gen_tempname failed\n");
19 exit (1);
21 files[i] = strdup (fn);
22 printf ("file: %s\n", fn);
23 fp = fopen (fn, "w");
24 fclose (fp);
27 for (i = 0; i < 500; i++)
28 remove (files[i]);
30 exit (0);