delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/13/03:02:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: bug-coreutils AT gnu DOT org
Cc: ericblake AT comcast DOT net (Eric Blake), cygwin AT cygwin DOT com
Subject: Re: mkdir -p and EROFS
References: <101220051447 DOT 16978 DOT 434D21E5000D25EB0000425222007610640A050E040D0C079D0A AT comcast DOT net> <87br1ubpdn DOT fsf AT rho DOT meyering DOT net>
From: Paul Eggert <eggert AT CS DOT UCLA DOT EDU>
Date: Thu, 13 Oct 2005 00:02:06 -0700
In-Reply-To: <87br1ubpdn.fsf@rho.meyering.net> (Jim Meyering's message of "Wed, 12 Oct 2005 19:45:40 +0200")
Message-ID: <87irw199xt.fsf@penguin.cs.ucla.edu>
User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0

Jim Meyering <jim AT meyering DOT net> writes:

> Are there `real' environments that use a set-up like you describe,
> with a writable file system mounted inside a read-only one?

I vaguely recall doing this myself a while back, on a Solaris box.  I
made /usr read-only, but /usr/tmp was a writeable filesystem under
/usr.  I expect that others might do this sort of thing too -- with
NFS mounts on diskless systems, say.


> If mkdir-p.c were to handle Cygwin's EROFS like ENOSYS, we'd have to add
> code to distinguish a legitimate EROFS (because a missing destination
> directory cannot be created) from a cygwin-style should-be-EEXIST one.

I looked into the POSIX spec for mkdir(2), and it allows mkdir to
return whatever error code it likes when more than one error code
applies.  So, for example, if /usr is not writeable and /usr/bin
exists, then mkdir("/usr/bin", 0) is allowed to fail with
errno==EACCES.  My interpretation is that Cygwin is within its POSIX
rights to fail with errno==EROFS here.

Admittedly this is a bit weird, but it's not that hard to make the
coreutils code accommodate the POSIX-allowed behavior for mkdir(2),
and no extra system calls are needed in the usual case (as per my
proposed patch in
<http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00149.html>).


Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com> writes:

> I'm just wondering if there is some kind of official coreutils policy
> here.

Not for coreutils itself, no.  However, the GNU coding standards make
it clear that porting to systems like Cygwin is lower priority for the
GNU project than porting to GNU/Linux.  See
<http://www.gnu.org/prep/standards/html_node/System-Portability.html>.

That being said, I think the patch mentioned above should do the trick.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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