.Nm mkdir
.Nd make a directory file
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
.Fd #include <sys/stat.h>
.Ft int
-.Fn mkdir "const char *path" "mode_t mode"
+.Fo mkdir
+.Fa "const char *path"
+.Fa "mode_t mode"
+.Fc
.Sh DESCRIPTION
The directory
.Fa path
.Fn Mkdir
will fail and no directory will be created if:
.Bl -tag -width Er
-.It Bq Er ENOTDIR
-A component of the path prefix is not a directory.
-.It Bq Er ENAMETOOLONG
-A component of a pathname exceeded
-.Dv {NAME_MAX}
-characters, or an entire path name exceeded
-.Dv {PATH_MAX}
-characters.
-.It Bq Er ENOENT
-A component of the path prefix does not exist.
+.\" ==========
.It Bq Er EACCES
Search permission is denied for a component of the path prefix.
-.It Bq Er ELOOP
-Too many symbolic links were encountered in translating the pathname.
-.It Bq Er EROFS
-The named file resides on a read-only file system.
-.It Bq Er EEXIST
-The named file exists.
-.It Bq Er ENOSPC
-The new directory cannot be created because there is no space left
-on the file system that will contain the directory.
-.It Bq Er ENOSPC
-There are no free inodes on the file system on which the
-directory is being created.
+.\" ==========
+.It Bq Er EACCES
+Write permission is denied for the parent directory.
+.\" ==========
.It Bq Er EDQUOT
The new directory cannot be created because the user's
quota of disk blocks on the file system that will
contain the directory has been exhausted.
+.\" ==========
.It Bq Er EDQUOT
The user's quota of inodes on the file system on
which the directory is being created has been exhausted.
-.It Bq Er EIO
-An I/O error occurred while making the directory entry or allocating the inode.
-.It Bq Er EIO
-An I/O error occurred while reading from or writing to the file system.
+.\" ==========
+.It Bq Er EEXIST
+The named file exists.
+.\" ==========
.It Bq Er EFAULT
.Fa Path
points outside the process's allocated address space.
+.\" ==========
+.It Bq Er EIO
+An I/O error occurred while making the directory entry
+or allocating the inode.
+.\" ==========
+.It Bq Er EIO
+An I/O error occurred while reading from or writing to the file system.
+.\" ==========
+.It Bq Er ELOOP
+Too many symbolic links were encountered in translating the pathname.
+This is taken to be indicative of a looping symbolic link.
+.\" ==========
+.It Bq Er EMLINK
+The parent directory already has {LINK_MAX} links.
+.\" ==========
+.It Bq Er ENAMETOOLONG
+A component of a pathname exceeded
+.Dv {NAME_MAX}
+characters, or an entire path name exceeded
+.Dv {PATH_MAX}
+characters.
+.\" ==========
+.It Bq Er ENOENT
+A component of the path prefix does not exist
+or path is an empty string.
+.It Bq Er ENOSPC
+The new directory cannot be created because there is no space left
+on the file system that would contain it.
+.\" ==========
+.It Bq Er ENOSPC
+There are no free inodes on the file system on which the
+directory is being created.
+.\" ==========
+.It Bq Er ENOTDIR
+A component of the path prefix is not a directory.
+.\" ==========
+.It Bq Er EROFS
+The parent directory resides on a read-only file system.
.El
+.Sh LEGACY SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/stat.h>
+.Pp
+The include file
+.In sys/types.h
+is necessary.
.Sh SEE ALSO
.Xr chmod 2 ,
.Xr stat 2 ,
-.Xr umask 2
+.Xr umask 2 ,
+.Xr compat 5
.Sh STANDARDS
The
.Fn mkdir