From owner-freebsd-jail@freebsd.org Sat May 21 14:53:41 2016 Return-Path: Delivered-To: freebsd-jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76F1AB44740 for ; Sat, 21 May 2016 14:53:41 +0000 (UTC) (envelope-from freekai@outlook.com) Received: from BLU004-OMC3S12.hotmail.com (blu004-omc3s12.hotmail.com [65.55.116.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38BD31FC7 for ; Sat, 21 May 2016 14:53:40 +0000 (UTC) (envelope-from freekai@outlook.com) Received: from BLU403-EAS386 ([65.55.116.74]) by BLU004-OMC3S12.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sat, 21 May 2016 07:52:33 -0700 X-TMN: [2EiiGhL2YI2YyVf7hSD9x0MNZ9AYNCoL9uy1QJ517C8=] X-Originating-Email: [freekai@outlook.com] Message-ID: From: =?UTF-8?B?5qKF5Yex?= To: Subject: cannot freebsd jail by c Date: Sat, 21 May 2016 22:52:30 +0800 MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: zh-cn Thread-Index: AdGzb2ogor8UkAw8S6+GQ3gxLe0POQ== X-OriginalArrivalTime: 21 May 2016 14:52:33.0908 (UTC) FILETIME=[685CDB40:01D1B370] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 14:53:41 -0000 This is my part c code: =20 11 int main() 12 { 13 in_addr_t addr_t=3Dinet_addr("192.168.2.1"); 14=20 15 struct in_addr in_addr=3Dinet_makeaddr(addr_t,AF_INET); 16=20 17=20 18 struct jail j=3D{ 19 .version=3DJAIL_API_VERSION, 20 .path=3D"./jail_test", 21 .hostname=3D"myjail", 22 .ip4s=3Daddr_t, 23 .ip6s=3D0, 24 .ip4=3D&in_addr, 25 .ip6=3DNULL 26 }; 27=20 28 errno=3D0; 29 int rs=3Djail(&j); 30 if(0=3D=3Drs){ 31 printf("create jail ok!!!\r\n"); 32 return 0; 33 } 34=20 35 switch(errno){ 36 case EPERM: 37 printf("eperm\r\n"); 38 break; 39 case EFAULT: 40 printf("efault\r\n"); 41 break; 42 case EINVAL: 43 printf("einval\r\n"); 44 break; 45 case EAGAIN: 46 printf("eagain\r\n"); 47 break; 48 default: 49 printf("---------------\r\n"); 50 break; 51 } 52 return 0; 53 } Unfortunately,the errno return EINVAL,it means =E2=80=9CThe version = number of the argument is not correct.=E2=80=9D,why?