|
|
1.1 ! root 1: .\" Copyright (c) 1980 Regents of the University of California. ! 2: .\" All rights reserved. The Berkeley software License Agreement ! 3: .\" specifies the terms and conditions for redistribution. ! 4: .\" ! 5: .\" @(#)mknod.2 6.4 (Berkeley) 5/23/86 ! 6: .\" ! 7: .TH MKNOD 2 "May 23, 1986" ! 8: .UC 4 ! 9: .SH NAME ! 10: mknod \- make a special file ! 11: .SH SYNOPSIS ! 12: .nf ! 13: .ft B ! 14: mknod(path, mode, dev) ! 15: char *path; ! 16: int mode, dev; ! 17: .fi ! 18: .ft R ! 19: .SH DESCRIPTION ! 20: .I Mknod ! 21: creates a new file ! 22: whose name is ! 23: .I path. ! 24: The mode of the new file ! 25: (including special file bits) ! 26: is initialized from ! 27: .IR mode . ! 28: (The protection part of the mode ! 29: is modified by the process's mode mask (see ! 30: .IR umask (2))). ! 31: The first block pointer of the i-node ! 32: is initialized from ! 33: .I dev ! 34: and is used to specify which device the special file ! 35: refers to. ! 36: .PP ! 37: If mode indicates a block or character special file, ! 38: .I dev ! 39: is a configuration dependent specification of a character or block ! 40: I/O device. If ! 41: .I mode ! 42: does not indicate a block special or character special device, ! 43: .I dev ! 44: is ignored. ! 45: .PP ! 46: .I Mknod ! 47: may be invoked only by the super-user. ! 48: .SH "RETURN VALUE ! 49: Upon successful completion a value of 0 is returned. ! 50: Otherwise, a value of \-1 is returned and \fIerrno\fP ! 51: is set to indicate the error. ! 52: .SH ERRORS ! 53: .I Mknod ! 54: will fail and the file mode will be unchanged if: ! 55: .TP 15 ! 56: [ENOTDIR] ! 57: A component of the path prefix is not a directory. ! 58: .TP 15 ! 59: [EINVAL] ! 60: The pathname contains a character with the high-order bit set. ! 61: .TP 15 ! 62: [ENAMETOOLONG] ! 63: A component of a pathname exceeded 255 characters, ! 64: or an entire path name exceeded 1023 characters. ! 65: .TP 15 ! 66: [ENOENT] ! 67: A component of the path prefix does not exist. ! 68: .TP 15 ! 69: [EACCES] ! 70: Search permission is denied for a component of the path prefix. ! 71: .TP 15 ! 72: [ELOOP] ! 73: Too many symbolic links were encountered in translating the pathname. ! 74: .TP 15 ! 75: [EPERM] ! 76: The process's effective user ID is not super-user. ! 77: .TP 15 ! 78: [EPERM] ! 79: The pathname contains a character with the high-order bit set. ! 80: .TP 15 ! 81: [EIO] ! 82: An I/O error occurred while making the directory entry or allocating the inode. ! 83: .TP 15 ! 84: [ENOSPC] ! 85: The directory in which the entry for the new node is being placed ! 86: cannot be extended because there is no space left on the file ! 87: system containing the directory. ! 88: .TP 15 ! 89: [ENOSPC] ! 90: There are no free inodes on the file system on which the ! 91: node is being created. ! 92: .TP 15 ! 93: [EDQUOT] ! 94: The directory in which the entry for the new node ! 95: is being placed cannot be extended because the ! 96: user's quota of disk blocks on the file system ! 97: containing the directory has been exhausted. ! 98: .TP 15 ! 99: [EDQUOT] ! 100: The user's quota of inodes on the file system on ! 101: which the node is being created has been exhausted. ! 102: .TP 15 ! 103: [EROFS] ! 104: The named file resides on a read-only file system. ! 105: .TP 15 ! 106: [EEXIST] ! 107: The named file exists. ! 108: .TP 15 ! 109: [EFAULT] ! 110: .I Path ! 111: points outside the process's allocated address space. ! 112: .SH "SEE ALSO" ! 113: chmod(2), stat(2), umask(2)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.