kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for
argument "/"
Alexander Best
alexbestms at math.uni-muenster.de
Fri Nov 6 16:10:06 UTC 2009
The following reply was made to PR kern/59739; it has been noted by GNATS.
From: Alexander Best <alexbestms at math.uni-muenster.de>
To: <bug-followup at FreeBSD.org>,
<asf at boinkor.net>
Cc:
Subject: Re: kern/59739: [libc] rmdir(2) and mkdir(2) both return EISDIR for
argument "/"
Date: Fri, 06 Nov 2009 17:08:08 +0100 (CET)
This is a MIME encoded multipart message.
--+permail-2009110616080880e26a0b000067d5-a_best01+
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
this problem still exists under 9-current.
the following test app:
#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);
}
produces this output:
rmdir errno: 21
mkdir errno: 21
which is EISDIR (as reported by Andreas Fuchs).
could somebody please check if the attached patch is sufficient to solve this
problem? with the patch the test app now outputs:
rmdir errno: 16
mkdir errno: 17
16 being EBUSY and 17 being EEXIST. this is what Andreas Fuchs suggested.
cheers.
alex
--+permail-2009110616080880e26a0b000067d5-a_best01+
Content-Type: text/plain
Content-Transfer-Encoding: Base64
Content-Disposition: attachment; filename="vfslookup.c.patch.txt"
LS0tIHZmc19sb29rdXAuYwkyMDA5LTExLTA2IDE2OjE0OjQxLjAwMDAwMDAwMCArMDEwMAorKysg
L3Vzci9zcmMvc3lzL2tlcm4vdmZzX2xvb2t1cC5jCTIwMDktMTEtMDYgMTY6MTM6MTkuMDAwMDAw
MDAwICswMTAwCkBAIC0zNSw3ICszNSw3IEBACiAgKi8KIAogI2luY2x1ZGUgPHN5cy9jZGVmcy5o
PgotX19GQlNESUQoIiRGcmVlQlNEJCIpOworX19GQlNESUQoIiRGcmVlQlNEOiBoZWFkL3N5cy9r
ZXJuL3Zmc19sb29rdXAuYyAxOTU5MzkgMjAwOS0wNy0yOSAwNzo0NDo0M1ogcndhdHNvbiAkIik7
CiAKICNpbmNsdWRlICJvcHRfa2R0cmFjZS5oIgogI2luY2x1ZGUgIm9wdF9rdHJhY2UuaCIKQEAg
LTU2Myw4ICs1NjMsMTIgQEAKIAkJCWVycm9yID0gRU5PVERJUjsKIAkJCWdvdG8gYmFkOwogCQl9
Ci0JCWlmIChjbnAtPmNuX25hbWVpb3AgIT0gTE9PS1VQKSB7Ci0JCQllcnJvciA9IEVJU0RJUjsK
KwkJaWYgKGNucC0+Y25fbmFtZWlvcCAhPSBMT09LVVAgJiYgY25wLT5jbl9uYW1laW9wID09IERF
TEVURSkgeworCQkJZXJyb3IgPSBFQlVTWTsKKwkJCWdvdG8gYmFkOworCQl9CisJCWlmIChjbnAt
PmNuX25hbWVpb3AgIT0gTE9PS1VQICYmIGNucC0+Y25fbmFtZWlvcCA9PSBDUkVBVEUpIHsKKwkJ
CWVycm9yID0gRUVYSVNUOwogCQkJZ290byBiYWQ7CiAJCX0KIAkJaWYgKHdhbnRwYXJlbnQpIHsK
--+permail-2009110616080880e26a0b000067d5-a_best01+--
More information about the freebsd-bugs
mailing list