From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 26 13:56:53 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BB9C106568E for ; Wed, 26 Aug 2009 13:56:53 +0000 (UTC) (envelope-from bertwiley@gmail.com) Received: from mail-gx0-f227.google.com (mail-gx0-f227.google.com [209.85.217.227]) by mx1.freebsd.org (Postfix) with ESMTP id DC5588FC39 for ; Wed, 26 Aug 2009 13:56:52 +0000 (UTC) Received: by gxk27 with SMTP id 27so195478gxk.12 for ; Wed, 26 Aug 2009 06:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=3bz1XQgsKHbA7c7ceJzi284kyl/oGFEPYsZBHK5itwk=; b=FRLimwwDQxnkVgK2xCJGH6P7glIjvRqqFWL3J92oiUeyei8Gsb1JkblLr8Ozu8hyVH VkLGku57rWlY3XBHEaELHR3oWybsBnQU9DvyP5kzkcxHC0lA+IC63fa08UQ2oQPBsVTO XU31h2fhZL0g0AiE2lWklAm8a5m02bS/FGMXQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=fgQ/2AJTs0dobtd3T9fiQ1vd/3ty/+OfXuYTMfucsUXlomDII2jnF/rSTnjd7jDMRP rZ5U7Xsx/fwVSSeAAJVFG9WNUFBT7kDXt3RFYoihPO5FFtPrcMPUAUgY3VfPZOToCg3A 3DPezSCkv0YxSdGHFGXnJesvn2IMMBqfKbhhc= MIME-Version: 1.0 Received: by 10.91.26.7 with SMTP id d7mr6088667agj.1.1251295010826; Wed, 26 Aug 2009 06:56:50 -0700 (PDT) Date: Wed, 26 Aug 2009 09:56:50 -0400 Message-ID: <9527461a0908260656w570f6cdha72e92b267e5354f@mail.gmail.com> From: bert wiley To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Need some help understanding a jail system call. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2009 13:56:53 -0000 Hello I found this code under a project called jailNG which has some system calls for doing jail stuff. Im still new to freebsd and im stumped on what this code is actually doing. In the source from the project there are few function calls that look like it creates and access the jail layer. Here is an example #define JAIL_CREATE 1 #define JAIL_DESTROY 2 #define JAIL_JOIN 3 extern char *environ[]; static void usage(void) { fprintf(stderr, "usage:\n"); fprintf(stderr, " jailctl create [jailname]\n"); fprintf(stderr, " jailctl destroy [jailname]\n"); fprintf(stderr, " jailctl join [jailname] [-c chrootpath] [path] " "[cmd] [args...]\n"); exit(-1); } static int jail_create(int argc, char *argv[]) { int error; if (argc < 2) usage(); error = syscall(375, JAIL_CREATE, argv[1]); if (error) perror("jailconf().create"); return (error); } No where in the code do i ever see any access to the jail.h type systems calls, so does the syscall(375, JAIL_CREATE, argv[1]); actually access the jail subsystem and create a jail? Here is the link i used to find this code http://www.watson.org/~robert/freebsd/jailng/ Any help on this question is appreciated thanks.