rmdir(2) and mkdir(2) both return EISDIR for argument "/"

Alex Dupre ale at FreeBSD.org
Fri Nov 6 14:33:07 UTC 2009


Alexander Best ha scritto:
> i dug up this old pr http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/59739

I think the EISDIR error is coming from kern/vfs_lookup.c, lookup()
function with cn_nameptr = "":


        /*
         * Check for degenerate name (e.g. / or "")
         * which is a way of talking about a directory,
         * e.g. like "/." or ".".
         */
        if (cnp->cn_nameptr[0] == '\0') {
                ...
                if (cnp->cn_nameiop != LOOKUP) {
                        error = EISDIR;
                        goto bad;
                }
                ...

-- 
Alex Dupre


More information about the freebsd-hackers mailing list