From owner-freebsd-fs Thu Jun 7 14: 3:16 2001 Delivered-To: freebsd-fs@freebsd.org Received: from mail-out1.apple.com (mail-out1.apple.com [17.254.0.52]) by hub.freebsd.org (Postfix) with ESMTP id 33CEB37B401; Thu, 7 Jun 2001 14:03:08 -0700 (PDT) (envelope-from pwd@apple.com) Received: from apple.com (A17-129-100-225.apple.com [17.129.100.225]) by mail-out1.apple.com (8.9.3/8.9.3) with ESMTP id OAA27219; Thu, 7 Jun 2001 14:03:07 -0700 (PDT) Received: from scv2.apple.com (scv2.apple.com) by apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id ; Thu, 7 Jun 2001 14:03:07 -0700 Received: from thunder (thunder.apple.com [17.202.40.76]) by scv2.apple.com (8.11.3/8.11.3) with ESMTP id f57L37l26327; Thu, 7 Jun 2001 14:03:07 -0700 (PDT) Message-Id: <200106072103.f57L37l26327@scv2.apple.com> Date: Thu, 7 Jun 2001 14:03:06 -0700 Content-Type: text/plain; format=flowed; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v388) From: "Patrick W. Penzias Dirks" To: FreeBSD-FS@freebsd.org, FreeBSD-Arch@freebsd.org X-Mailer: Apple Mail (2.388) Content-Transfer-Encoding: 7bit Subject: Support for pivot_root-like system call? Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, I'm the filesystems tech lead in Apple's Mac OS X Core OS group. Prompted by the needs of, among others, virus protection software developers who want to be able to mount "on" the root directory to intercept ALL filesystem calls in the system, I'm contemplating implementation of a new system call in Mac OS X to do something like Linux's pivot_root system call: int pivot_root(const char *new_root, const char *put_old); (which basically installs "new_root" as the new "/" [root_vnode] in the system and transfers the current root directory to the pathname specified my "put_old") I'm not up on the latest discussions in the Linux world around this functionality (which I gather is pretty recent) and the Linux man page for pivot_root is deliberately vague about defining details of its semantics. There's no explicit guarantee that existing process's root vnode or current directory will or will not get switched, for instance. I thought some options might be appropriate to specify that kind of detail and I'm currently thinking of implementing a new switch_root(2): int switch_root(const char *new_root, const char *put_old, unsigned long flags); with the same basic functionality as pivot_root, and options to either insist on updating root and/or current directory for existing processes, possibly excluding system processes, for instance. I want to avoid implementing something that might for some reason clash horribly with either present FreeBSD designs or planned future developments. Any comments would be most welcome. Thanks in advance, -Pat Dirks. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message