Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 05 Nov 2009 02:17:15 +0100 (CET)
From:      Alexander Best <alexbestms@math.uni-muenster.de>
To:        <freebsd-hackers@FreeBSD.org>
Subject:   rmdir(2) and mkdir(2) both return EISDIR for argument "/"
Message-ID:  <permail-2009110501171580e26a0b00006a75-a_best01@message-id.uni-muenster.de>

next in thread | raw e-mail | index | archive | help
hi there,

i dug up this old pr http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/59739 and
was surprised it still remains valid for 9-CURRENT. indeed running the
following code:

#include <sys/stat.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>

main() {
    rmdir("/");
    printf("rmdir errno: %d\n", errno);
    mkdir("/", 511);
    printf("mkdir errno: %d\n", errno);
}

returns:

rmdir errno: 21
mkdir errno: 21

which is EISDIR. as the pr already said EISDIR isn't mentioned at all in
mkdir(2) or rmdir(2). so i guess this should either get fixed or we add a
"BUGS" section to both manuals where this problem gets mentioned.

alex



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-2009110501171580e26a0b00006a75-a_best01>