lkml.org 
[lkml]   [1999]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: rmdir of one's pwd (was Re: rmdir of a busy directory)
In article <7a46jv$3r09s@fido.engr.sgi.com>, you write:
|> From: Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|>
|> Linus Torvalds wrote:
|>
|> > Show me POSIX or other standards that say that you can't do it, and I
|> > guess I have to work around a standards problem, but right now I say that
|> > if programs ask for 'rmdir(".")', then they had better get it. I don't
|> > think the OS should second-guess anybody.
|>
|> I don't know about a formal standard, either.
|>
|> Nevertheless, in my initial post, I wasn't talking about rmdir (2), I was
|> talking about rmdir(1)'s behaviour on linux-2.[12].x breaking gcc/fixincludes
|> for building cross-compilers.
|>
|> A formal standard for rmdir(1) can be found in POSIX.2
|> (I have the 1993-12-22 edition here).
|> It says:
|>
|> "The rmdir utility shall remove the directory entry specified by each operand,
|> which shall refer to an empty directory."

However, it defers to the definition of rmdir(2) in Posix 1003.1 for
conditions and errors.

|>
|> No exception is made for ".".
|> Thus, gcc/fixincludes needs fixing.

Both Posix 1003.2 and the Single Unix Specification state
that many commands are implemented in terms of an interface and all restrictions
of the interface apply, XPG4.2 goes on to state:

(XCU4.2, p. 11)
... The treatment of errors and intermediate results from
the individual functions cited are generally not specified by
this document.

(XCU4.2, p. 615 (rmdir(1)))

SEE ALSO:
rm in XCU
remove(), rmdir() and unlink() in XSH

XCU (commands and utilities) defers to XSH (System Interfaces
and Headers) where appropriate, such as rmdir, and both XSH and
XCU are derived from Posix (posix can be considered a proper
subset of the SUS/XPG/XSH,XCU,XBD) [see XCU4.2 p 7, section 1.6].

scott lurndal
(slurn@engr.sgi.com)

(btw: Posix also states that opendir(".") after rmdir(".")
shall fail with ENOENT).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.174 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site