1MKNOD(2) 386BSD Programmer's Manual MKNOD(2) 2 3NNAAMMEE 4 mmkknnoodd - make a special file node 5 6SSYYNNOOPPSSIISS 7 ##iinncclluuddee <<uunniissttdd..hh>> 8 9 _i_n_t 10 mmkknnoodd(_c_o_n_s_t _c_h_a_r *_p_a_t_h, _m_o_d_e__t _m_o_d_e, _d_e_v__t _d_e_v) 11 12DDEESSCCRRIIPPTTIIOONN 13 The device special file _p_a_t_h is created with the major and minor device 14 numbers extracted from _m_o_d_e. The access permissions of _p_a_t_h are 15 descendant from the umask(2) of the parent process. 16 17 If _m_o_d_e indicates a block or character special file, _d_e_v is a 18 configuration dependent specification of a character or block I/O device 19 and the superblock of the device. If _m_o_d_e does not indicate a block 20 special or character special device, _d_e_v is ignored. 21 22 MMkknnoodd() requires super-user privileges. 23 24RREETTUURRNN VVAALLUUEESS 25 Upon successful completion a value of 0 is returned. Otherwise, a value 26 of -1 is returned and _e_r_r_n_o is set to indicate the error. 27 28EERRRROORRSS 29 MMkknnoodd() will fail and the file will be not created if: 30 31 [ENOTDIR] A component of the path prefix is not a directory. 32 33 [EINVAL] The pathname contains a character with the high-order bit 34 set. 35 36 [ENAMETOOLONG] 37 A component of a pathname exceeded 255 characters, or an 38 entire path name exceeded 1023 characters. 39 40 [ENOENT] A component of the path prefix does not exist. 41 42 [EACCES] Search permission is denied for a component of the path 43 prefix. 44 45 [ELOOP] Too many symbolic links were encountered in translating the 46 pathname. 47 48 [EPERM] The process's effective user ID is not super-user. 49 50 [EPERM] The pathname contains a character with the high-order bit 51 set. 52 53 [EIO] An I/O error occurred while making the directory entry or 54 allocating the inode. 55 56 [ENOSPC] The directory in which the entry for the new node is being 57 placed cannot be extended because there is no space left on 58 the file system containing the directory. 59 60 [ENOSPC] There are no free inodes on the file system on which the 61 node is being created. 62 63 [EDQUOT] The directory in which the entry for the new node is being 64 placed cannot be extended because the user's quota of disk 65 blocks on the file system containing the directory has been 66 67 exhausted. 68 69 [EDQUOT] The user's quota of inodes on the file system on which the 70 node is being created has been exhausted. 71 72 [EROFS] The named file resides on a read-only file system. 73 74 [EEXIST] The named file exists. 75 76 [EFAULT] _P_a_t_h points outside the process's allocated address space. 77 78SSEEEE AALLSSOO 79 chmod(2), stat(2), umask(2) 80 81HHIISSTTOORRYY 82 A mmkknnoodd function call appeared in Version 6 AT&T UNIX. 83 844th Berkeley Distribution March 10, 1991 2 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133