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 le system. The mkdir() function cannot create a directory named
lost+found in the root directory of an OSS leset. 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 le 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
elds of the directory for update and marks the st_ctime and st_mtime elds of the new
directorys parent directory for update.
Use on Guardian Objects
The mkdir() function succeeds within /G (the Guardian le 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 le type ags that can be logically ORed into the value specied in the mode parameter are
as follows:
S_IFDIR Directory in the OSS le system or empty subvolume in /G, the Guardian le
system.
S_ISVTX Sticky bit; used only for directories (cannot be used for les in /G, the Guardian
le system).
When set, a user can remove les from the directory only if the user either:
Has write permission for the directory and is the owner of either the
directory or the le being removed
Has appropriate privileges
S_NONSTOP Directory in the OSS le system protected by disk process checkpointing. (Files
in /G cannot have this ag set.)
When set, this ag 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 le-system data caching is disabled for write operations on les for which
this ag is set. Performance is slower than when caching is used, but data
integrity protection increases. Performance is faster than when the O_SYNC
ag in the oag 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 rst of
them is called from the Guardian environment:
Two Guardian le system le numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These le numbers cannot
be closed by calling the Guardian FILE_CLOSE_ procedure.
527186-003 Hewlett-Packard Company 423