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