Lines Matching full:ptm
52 ATF_TC(ptm);
54 ATF_TC_HEAD(ptm, tc) in ATF_TC_HEAD() argument
57 atf_tc_set_md_var(tc, "descr", "Checks /dev/ptm device"); in ATF_TC_HEAD()
60 ATF_TC_BODY(ptm, tc) in ATF_TC_BODY() argument
63 struct ptmget ptm; in ATF_TC_BODY() local
67 if ((fdm = open("/dev/ptm", O_RDWR)) == -1) { in ATF_TC_BODY()
69 atf_tc_skip("/dev/ptm: %s", strerror(errno)); in ATF_TC_BODY()
70 atf_tc_fail("/dev/ptm: %s", strerror(errno)); in ATF_TC_BODY()
75 REQUIRE_ERRNO(ioctl(fdm, TIOCPTMGET, &ptm), -1); in ATF_TC_BODY()
77 ATF_REQUIRE_MSG(strncmp(ptm.cn, "/dev/pty", 8) == 0 in ATF_TC_BODY()
78 || strncmp(ptm.cn, "/dev/null", 9) == 0, in ATF_TC_BODY()
79 "bad master name: %s", ptm.cn); in ATF_TC_BODY()
81 ATF_REQUIRE_MSG(strncmp(ptm.sn, "/dev/tty", 8) == 0 in ATF_TC_BODY()
82 || strncmp(ptm.sn, "/dev/pts/", 9) == 0, in ATF_TC_BODY()
83 "bad slave name: %s", ptm.sn); in ATF_TC_BODY()
85 if (strncmp(ptm.cn, "/dev/null", 9) != 0) { in ATF_TC_BODY()
86 REQUIRE_ERRNO(fstat(ptm.cfd, &stm), -1); in ATF_TC_BODY()
87 REQUIRE_ERRNO(stat(ptm.cn, &sts), -1); in ATF_TC_BODY()
91 REQUIRE_ERRNO(fstat(ptm.sfd, &stm), -1); in ATF_TC_BODY()
92 REQUIRE_ERRNO(stat(ptm.sn, &sts), -1); in ATF_TC_BODY()
101 (void)close(ptm.sfd); in ATF_TC_BODY()
102 (void)close(ptm.cfd); in ATF_TC_BODY()
170 ATF_TP_ADD_TC(tp, ptm); in ATF_TP_ADD_TCS()