Date: Mon, 2 Aug 2004 20:07:51 -0700 From: Sam Leffler <sam@errno.com> To: Don Lewis <truckman@FreeBSD.org> Cc: markm@FreeBSD.org Subject: Re: cvs commit: src/sys/alpha/alpha mem.c src/sys/alpha/conf GENERIC src/sys/alpha/include memdev.h src/sys/amd64/amd64 io.c mem.c src/sys/amd64/conf GENERIC NOTES src/sys/amd64/include iodev.h memdev.h src/sys/conf NOTES files files.alpha files.amd64 ... Message-ID: <200408022007.51603.sam@errno.com> In-Reply-To: <200408030254.i732sBtS077748@gw.catspoiler.org> References: <200408030254.i732sBtS077748@gw.catspoiler.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 02 August 2004 07:54 pm, Don Lewis wrote: > On 3 Aug, Alexey Dokuchaev wrote: > > On Mon, Aug 02, 2004 at 04:00:00PM -0400, John Baldwin wrote: > >> Why in the world are /dev/null and /dev/zero optional? /dev/[k]mem > >> and /dev/io I can accept for those with uber-high security paranoia, but > >> I can't think of any good reason to have a kernel without /dev/null and > >> /dev/zero. To me it seems that this creates way more foot shooting > >> potential than benefit. It's one thing to have device drivers for > >> hardware that may or may not be present optional, but /dev/null and > >> /dev/zero do not fall into that case. > > > > OTOH, if someone wants to build mega-tight kernel image with everything > > possible taken out by modules, modularizing /dev/null and /dev/zero > > might make some sence. We already have /dev/random as a module anyways. > > You might have trouble doing anything useful on the system without > /dev/null. For instance /bin/sh won't be able to run background jobs, > /bin/csh will close stdin of any background jobs (which might cause > wierd things to happen), users of daemon(3) won't properly disconnect > from the tty which started them, and there are a number of references to > /dev/null in the /etc and /etc/rc.d scripts. > > In the case of i386, the size of the text+data size of null.ko is a > little over 2K. From a quick look at the source, it looks like at least > half of this is the module support code. > > BTW, I think daemon(3) and /bin/csh should check the return value when > they attempt to open(_PATH_DEVNULL, ...). I'd be very surprised if you could do anything useful with a system w/o /dev/null. /dev/zero is getting to be like that too. Folks promoting this for embedded purposes have not tried to squeeze a running system into a few meg (i.e. this change is meaningless in terms of what needs to be done). Sam
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408022007.51603.sam>