Home | History | Annotate | Line # | Download | only in tty
t_pr.c revision 1.1
      1 /*	$NetBSD: t_pr.c,v 1.1 2010/06/28 19:04:00 pooka 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 	atf_tc_set_md_var(tc, "xfail", "PR kern/40688");
     19 }
     20 
     21 ATF_TC_BODY(ptyioctl, tc)
     22 {
     23 	struct termios tio;
     24 	int fd;
     25 
     26 	rump_init();
     27 	fd = rump_sys_open("/dev/ptyp1", O_RDWR);
     28 	if (fd == -1)
     29 		err(1, "open");
     30 
     31 	/* boom, dies with null deref under ptcwakeup() */
     32 	rump_sys_ioctl(fd, TIOCGETA, &tio);
     33 }
     34 
     35 ATF_TP_ADD_TCS(tp)
     36 {
     37 
     38 	ATF_TP_ADD_TC(tp, ptyioctl);
     39 
     40 	return atf_no_error();
     41 }
     42