Home | History | Annotate | Line # | Download | only in tty
t_pr.c revision 1.3
      1 /*	$NetBSD: t_pr.c,v 1.3 2010/11/03 16:10:20 christos 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 	/* boom, dies with null deref under ptcwakeup() */
     30 	atf_tc_expect_signal(-1, "PR kern/40688");
     31 	rump_sys_ioctl(fd, TIOCGETA, &tio);
     32 }
     33 
     34 ATF_TP_ADD_TCS(tp)
     35 {
     36 
     37 	ATF_TP_ADD_TC(tp, ptyioctl);
     38 
     39 	return atf_no_error();
     40 }
     41