Lines Matching refs:tty
16 static bool tty_valid(char *tty)
18 if (strlen(tty) < MIN_TTY_PATH_LEN)
21 if (strncmp(tty, "/dev/tty", MIN_TTY_PATH_LEN) == 0 ||
22 strncmp(tty, "/dev/pts", MIN_TTY_PATH_LEN) == 0)
33 f = fopen("/dev/tty", "r+");
48 char tty[PATH_MAX] = {};
54 r = readlink("/proc/self/fd/0", tty, PATH_MAX);
58 if (!tty_valid(tty))
59 ksft_exit_skip("invalid tty path '%s'\n", tty);
61 r = stat(tty, &st1);
63 ksft_exit_fail_msg("stat failed on tty path '%s': %m\n", tty);
71 ksft_exit_fail_msg("failed to write to /dev/tty: %s\n",
74 r = stat(tty, &st2);
76 ksft_exit_fail_msg("stat failed on tty path '%s': %m\n", tty);
81 ksft_test_result_fail("tty timestamps not updated\n");
86 "timestamps of terminal '%s' updated after write to /dev/tty\n", tty);