lkml.org 
[lkml]   [1996]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: unlink system call on directories - Bug + fix
From
Date

"Andrew M. Bishop" <amb@gedanken.demon.co.uk> writes:

> The manual page for unlink() and the actual behaviour do not match
> when the file to be unlinked is a directory.
>
>
> The manual page says that unlink() returns EISDIR when the pathname
> refers to a directory. But the kernel returns EPERM for minix and
> derivatives ext,ext2 etc., see the file namei.c in those directories.
>
> The fix for these is trivial (if I understand correctly how the kernel
> handles the unlink command) and left as an exercise to the reader.

Yes, editing manpages is easy :-). From section 5.5.1.4 of the 1996
edition of the POSIX.1 spec:

[EPERM] The file named by _path_ is a directory, and either the
calling process does not hae appropriate privileges or the
implementation prohibits using unlink() on directories.

--
Aaron M. Ucko (amu@mit.edu) | For Geek Code, PGP public key, and other info,
finger amu@monk.mit.edu. | "Kids! Bringing about Armageddon can be dangerous.
Do not attempt it in your home." -- T. Pratchett & N. Gaiman, _Good Omens_

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