Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (k - m) mkdir(2)
The mkdir() function cannot create a directory named /dev, /dev/tty,or/dev/null in the root
directory of the OSS file system. The mkdir() function cannot create a directory named
lost+found in the root directory of an OSS fileset. If these directories are missing from the sys-
tem, such a function call fails and sets errno to the value [EPERM]. When these directories
already exist (the normal case), errno is set to [EEXIST].
If bits in the mode parameter other than the file permission bits, S_ISVTX, S_IFDIR,or
S_NONSTOP are set, mkdir() fails and sets errno to [EINVAL].
Upon successful completion, the mkdir() function marks the st_atime, st_ctime, and st_mtime
fields of the directory for update and marks the st_ctime and st_mtime fields of the new
directory’s parent directory for update.
Use on Guardian Objects
The mkdir() function succeeds within /G (the Guardian file system) only when creating a Guar-
dian subvolume that is exactly three directories under the root (for example, /G/vol/subvol). This
Guardian subvolume must be empty. If the subvolume is not empty, errno is set to [EEXIST].
When the call succeeds, the resulting directory (subvolume) is owned by the super ID.
File Type Flags
The file type flags that can be logically ORed into the value specified in the mode parameter are
as follows:
S_IFDIR Directory in the OSS file system or empty subvolume in /G, the Guardian file
system.
S_ISVTX Sticky bit; used only for directories (cannot be used for files in /G, the Guardian
file system).
When set, a user can remove files from the directory only if the user either:
• Has write permission for the directory and is the owner of either the
directory or the file being removed
• Has appropriate privileges
S_NONSTOP Directory in the OSS file system protected by disk process checkpointing. (Files
in /G cannot have this flag set.)
When set, this flag indicates that return from a write operation does not occur
until both the primary and backup disk processes have the data (thereby protect-
ing the data against a single point of failure).
OSS file-system data caching is disabled for write operations on files for which
this flag is set. Performance is slower than when caching is used, but data
integrity protection increases. Performance is faster than when the O_SYNC
flag in the oflag parameter of the open() function is used, but data integrity pro-
tection is less than that provided by O_SYNC use.
Use From the Guardian Environment
The mkdir() function is one of a set of functions that have the following effects when the first of
them is called from the Guardian environment:
• Two Guardian file system file numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These file numbers cannot
be closed by calling the Guardian FILE_CLOSE_ procedure.
527186-003 Hewlett-Packard Company 4−23