Home | History | Annotate | Line # | Download | only in tty
t_pr.c revision 1.4
      1 /*	$NetBSD: t_pr.c,v 1.4 2011/04/09 06:36:03 martin Exp $	*/
      2 
      3 #include <sys/types.h>
      4 #include <sys/ioctl.h>
      5 #include <sys/tty.h>
      6 
      7 #include <atf-c.h>
      8 #include <fcntl.h>
      9 
     10 #include <rump/rump.h>
     11 #include <rump/rump_syscalls.h>
     12 
     13 ATF_TC(ptyioctl);
     14 ATF_TC_HEAD(ptyioctl, tc)
     15 {
     16 
     17 	atf_tc_set_md_var(tc, "descr", "ioctl on pty");
     18 }
     19 
     20 ATF_TC_BODY(ptyioctl, tc)
     21 {
     22 	struct termios tio;
     23 	int fd;
     24 
     25 	rump_init();
     26 	fd = rump_sys_open("/dev/ptyp1", O_RDWR);
     27 	ATF_CHECK(fd != -1);
     28 
     29 	/*
     30 	 * This used to die with null deref under ptcwakeup()
     31 	 * atf_tc_expect_signal(-1, "PR kern/40688");
     32 	 */
     33 	rump_sys_ioctl(fd, TIOCGETA, &tio);
     34 }
     35 
     36 ATF_TP_ADD_TCS(tp)
     37 {
     38 
     39 	ATF_TP_ADD_TC(tp, ptyioctl);
     40 
     41 	return atf_no_error();
     42 }
     43