Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Sep 2000 17:18:34 -0400 (EDT)
From:      Adrian Filipi-Martin <adrian@ubergeeks.com>
To:        Ben Smithurst <ben@FreeBSD.ORG>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, Peter Pentchev <roam@orbitel.bg>, Julian Elischer <julian@elischer.org>, Chris Costello <chris@calldei.com>, hackers@FreeBSD.ORG, current@FreeBSD.ORG
Subject:   Re: Fdescfs updates--coming to a devfs near you!
Message-ID:  <Pine.BSF.4.10.10009171709380.24360-100000@lorax.ubergeeks.com>
In-Reply-To: <20000914115342.I77593@strontium.scientia.demon.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 14 Sep 2000, Ben Smithurst wrote:

> Poul-Henning Kamp wrote:
> 
> > I must admit that I think in general that /dev/std{in,out,err} and /dev/fd
> > is bogus.  It looks like something which happened "because we can" more
> > than something which has a legitimate need.
> 
> You think adding a hack to every program to support "-" to mean
> stdout/stdin is better?  It seems to be that saying "/dev/stdin" when
> you mean stdin is better than saying "-" and hoping the application
> handles that correctly.  Of course many programs will read stdin by
> default, and write stdout by default, but that doesn't help when you
> want to read more than one file, one of which is stdin.
> 
> > If anything I would propose we ditch it...
> 
> And break loads of scripts at the same time?

	I recently ran into revelant problem with /dev/stdout, while
working on some software under linux that expected /dev/stdout as an
argument instead of using stdout.

	Using the device file breaks, if the process is suid to a non-root
user.  This is because it cannot open /dev/stdout, which is owned by your
UID and not the EUID of the process to which the device was passed.  My
solution was to add the "-" hack and use the existing open descriptor.

	Still, I don't think /dev/stdout and friends are such bad things
that they should be abandoned.  They are present in other OS's and it does
help avoid making named pipes and the such when you need the behavior the
special devices provide.  I think it would simple create minor poratability
issues for third party software.

	Adrian
--
[ adrian@ubergeeks.com -- Ubergeeks Consulting -- http://www.ubergeeks.com/ ]



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10009171709380.24360-100000>