lkml.org 
[lkml]   [1999]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subject[Research] unlink() not POSIX-conform?
I remember a discussion on linux-kernel@vger that unlink() may or may not
remove directories and if it does not, it has to return EPERM (and not
e.g. EISDIR) to be POSIX-compliant.

Test program (to be run as root :-):
--------------------------------------------------------------
#include <unistd.h>
main(){
unlink("/mnt");
unlink("/proc");
}
--------------------------------------------------------------

Return values for kernel 2.0.37pre11:
unlink("/mnt") = -1 EPERM (Operation not permitted)
unlink("/proc") = -1 EPERM (Operation not permitted)

Return values for kernel 2.2.7ac1:
unlink("/mnt") = -1 EISDIR (Is a directory)
unlink("/proc") = -1 ENOENT (No such file or directory)

The return value for /proc on a 2.2 kernel seems totally bogus. :-)
These are not critical bugs, but someone might clean this up for the
2.2/2.3 kernel...

Thanks a lot,

Florian La Roche


-
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:51    [W:0.024 / U:14.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site