7 static void do_prepare (void);
8 #define PREPARE(argc, argv) do_prepare ()
9 static int do_test (void);
10 #define TEST_FUNCTION do_test ()
11 #include <test-skeleton.c>
19 temp_fd
= create_temp_file ("tst-ttyname_r.", &temp_file
);
21 error (1, errno
, "cannot create temporary file");
28 char buf
[sysconf (_SC_TTY_NAME_MAX
) + 1];
29 int res
= ttyname_r (-1, buf
, sizeof (buf
));
32 printf ("1st ttyname_r returned with res %d\n", res
);
35 res
= ttyname_r (temp_fd
, buf
, sizeof (buf
));
38 printf ("2nd ttyname_r returned with res %d\n", res
);