delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/01/10/05:22:00

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3E1E11A7.821B54ED@phekda.freeserve.co.uk>
Date: Fri, 10 Jan 2003 00:19:51 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: /dev/zero & /dev/full support - open, link and unlink fixes [PATCH]
References: <200301092238 DOT h09Mc2V23447 AT brother DOT ludd DOT luth DOT se>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Martin Str|mberg wrote:
> 
> According to Richard Dawe:
> > Below is a patch fixing bugs in the /dev/zero and /dev/full support.
> > The bugs fixed are:
> >
> > * open: Don't decide we're emulating until we've checked that /dev/zero
> >   or /dev/full (as appropriate) have been installed.
> >
> > * link: Don't allow linking to or from /dev/{zero,full}.
> 
> Why?

Because we don't support hardlinks. See:

    info libc alpha link

and/or:

    src/libc/posix/unistd/link.c

We "simulate" hardlinks by copying the source file to the destination, which
doesn't work for /dev/{zero,full}.
 
> > * unlink: Check the filenames. If we're not trying to remove
> >   /dev/{zero,full}, then pass it through.
> 
> This mean that "rm /dev/zero" can never be removed, right?

Yes. Is that a problem?
 
> Does that mean that when somebody codes support for /dev/hda (e. g.)
> he must add it to this list?

Which list? You'd have to write another FSEXT to handle /dev/hd[a-z][0-9a-f]?
or whatever.

The /dev/{zero,full} code only handles /dev/zero and /dev/full. It should pass
anything else through. The code in CVS is buggy, because it does not pass
things through, when it should. Hence the patch.

Bye, Rich =]

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019