|
|
HP-UX Reference > Mmknod(2)HP-UX 11i Version 2: December 2007 Update |
|
NAMEmknod() — make directory, special, or ordinary file DESCRIPTIONThe mknod() system call creates a new file named by the path name pointed to by path. The mode of the new file is specified by the mode argument. Symbolic constants that define the file type and file access permission bits are found in the <sys/stat.h> header file and are used to construct the mode argument. The value of the mode argument should be the bit-wise inclusive OR of the values of the desired file type, miscellaneous mode bits, and access permissions. See stat(5) for a description of the components of the file mode. The owner ID of the file is set to the effective-user-ID of the process. If the set-group-ID bit of the parent directory is set, the new file's group ID is set to the group ID of the parent directory. Otherwise, the new file's group ID is set to the effective-group-ID of the process. The file access permission bits of mode are modified by the process's file mode creation mask: for each bit set in the process's file mode creation mask, the corresponding bit in the file's mode is cleared (see umask(2)). In HFS file systems, the new file is created with three base access-control-list (ACL) entries, corresponding to the file access permission bits (see acl(5)). On JFS file systems that support access control lists, when creating a directory or regular file, optional ACL entries are created corresponding to the parent directory's default ACL entries (see aclv(5)). When creating a directory, the parent's default ACL entries are also copied as the new directory's default ACL entries. The dev argument is meaningful only if mode indicates a block or character special file, and is ignored otherwise. It is an implementation- and configuration-dependent specification of a character or block I/O device. The value of dev is created by using the makedev() macro defined in <sys/mknod.h>. The makedev() macro takes as arguments the major and minor device numbers, and returns a device identification number which is of type dev_t. The value and interpretation of the major and minor device numbers are implementation-dependent. For more information, see mknod(5) and the System Administration manuals for your system. Only users having appropriate privileges can invoke mknod() for file types other than FIFO files. RETURN VALUEmknod() returns the following values:
ERRORSIf mknod() fails, errno is set to one of the following values.
|
|