1 /* Check that TRT happens when error on too many opened files.
3 #sim: --sysroot=@exedir@
11 #include <sys/types.h>
16 int main (int argc
, char *argv
[])
24 filemax
= sysconf (_SC_OPEN_MAX
);
27 char *fn
= malloc (strlen (argv
[0]) + 2);
33 for (i
= 0; i
< filemax
+ 1; i
++)
35 if (open (fn
, O_RDONLY
) < 0)
37 /* Shouldn't happen too early. */
38 if (i
< filemax
- 3 - 1)
40 fprintf (stderr
, "i: %d\n", i
);