1 /* $NetBSD: t_raw.c,v 1.2 2017/01/13 21:30:42 christos Exp $ */ 2 3 #include <sys/socket.h> 4 #include <sys/stat.h> 5 6 #include <string.h> 7 #include <stdio.h> 8 #include <stdlib.h> 9 10 #include <rump/rump.h> 11 #include <rump/rump_syscalls.h> 12 13 #include <atf-c.h> 14 15 #include "h_macros.h" 16 17 ATF_TC(PRU_SENSE); 18 ATF_TC_HEAD(PRU_SENSE, tc) 19 { 20 21 atf_tc_set_md_var(tc, "descr", "Biglock leak with PRU_SENSE on " 22 "raw sockets (PR kern/44369)"); 23 } 24 25 ATF_TC_BODY(PRU_SENSE, tc) 26 { 27 struct stat sb; 28 int s; 29 30 rump_init(); 31 RL(s = rump_sys_socket(PF_ROUTE, SOCK_RAW, 0)); 32 /* call PRU_SENSE. unfixed bug causes panic in rump_unschedule() */ 33 RL(rump_sys_fstat(s, &sb)); 34 } 35 36 ATF_TP_ADD_TCS(tp) 37 { 38 39 ATF_TP_ADD_TC(tp, PRU_SENSE); 40 return atf_no_error(); 41 } 42