docs/161673: mkdir(2) doesn't discuss EISDIR

Jeremy Huddleston jeremyhu at apple.com
Fri Oct 14 23:30:04 UTC 2011


>Number:         161673
>Category:       docs
>Synopsis:       mkdir(2) doesn't discuss EISDIR
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 14 23:30:03 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy Huddleston
>Release:        8.1
>Organization:
Apple Inc
>Environment:
FreeBSD freebsd8.apple.com 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010     root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
mkdir(2) can set errno to EISDIR, but the man page does not discuss this.  You can use mkdir(1) to see this:

$ mkdir /
mkdir: /: Is a directory
$ mkdir /var
mkdir: /var: File exists

>How-To-Repeat:
$ mkdir /
mkdir: /: Is a directory
$ mkdir /var
mkdir: /var: File exists

>Fix:
I would expect EEXIST to be returned for /, but EISDIR was set instead.  I guess either update documentation or change the syscall to return EEXIST instead.

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list