From owner-freebsd-hackers Fri Nov 13 14:58:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA15594 for freebsd-hackers-outgoing; Fri, 13 Nov 1998 14:58:32 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA15582 for ; Fri, 13 Nov 1998 14:58:30 -0800 (PST) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id OAA15598; Fri, 13 Nov 1998 14:57:01 -0800 (PST) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpdj15594; Fri Nov 13 22:56:57 1998 Date: Fri, 13 Nov 1998 14:56:19 -0800 (PST) From: Julian Elischer To: zhihuizhang cc: Archie Cobbs , freebsd-hackers@FreeBSD.ORG Subject: Re: More questions on DEVFS In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 13 Nov 1998, zhihuizhang wrote: > > > > (1) As I understand it, special files can be created only by superuser via > > > mknod and file systems can only be mounted by superuser. I do not see any > > > reason why the superuser will mount the device file system multiple times > > > and possibly at different mount points. > > > > You might want to create a chroot()'d sub-space of your filesystem, > > and put devices in there for example.. > > > After thinking for quite a while, I still have two confusions: > > (1) I read the source code of chroot() in file vfs_syscalls.c. It takes a > path and change the fd_rdir (root directory) of the calling process. How > can the superuser process change the root directory of any other process? Chroot is only valid for your own process, and its descendants > > (2) By saying "put devices in there..", I guess it means that the > superuser mount the special device at some directory under the new root. > If we set up root directories for several processes, then we may need to > mount a certain device used by these processes several times. DEVFS can > be mounted multiple times to achieve this. However, multiple mounts of > a normal file system are NOT allowed. Am I right? That is correct though I think possibly multiple /proc filesystems might be ok.. > > Thanks for your response. > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message