1RMDIR(2) 386BSD Programmer's Manual RMDIR(2) 2 3NNAAMMEE 4 rrmmddiirr - remove a directory file 5 6SSYYNNOOPPSSIISS 7 ##iinncclluuddee <<uunniissttdd..hh>> 8 9 _i_n_t 10 rrmmddiirr(_c_o_n_s_t _c_h_a_r *_p_a_t_h) 11 12DDEESSCCRRIIPPTTIIOONN 13 RRmmddiirr() removes a directory file whose name is given by _p_a_t_h. The 14 directory must not have any entries other than `.' and `..'. 15 16RREETTUURRNN VVAALLUUEESS 17 A 0 is returned if the remove succeeds; otherwise a -1 is returned and an 18 error code is stored in the global location _e_r_r_n_o. 19 20EERRRROORRSS 21 The named file is removed unless: 22 23 [ENOTDIR] A component of the path is not a directory. 24 25 [EINVAL] The pathname contains a character with the high-order bit 26 set. 27 28 [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an 29 entire path name exceeded 1023 characters. 30 31 [ENOENT] The named directory does not exist. 32 33 [ELOOP] Too many symbolic links were encountered in translating 34 the pathname. 35 36 [ENOTEMPTY] The named directory contains files other than `.' and 37 `..' in it. 38 39 [EACCES] Search permission is denied for a component of the path 40 prefix. 41 42 [EACCES] Write permission is denied on the directory containing 43 the link to be removed. 44 45 [EPERM] The directory containing the directory to be removed is 46 marked sticky, and neither the containing directory nor 47 the directory to be removed are owned by the effective 48 user ID. 49 50 [EBUSY] The directory to be removed is the mount point for a 51 mounted file system. 52 53 [EIO] An I/O error occurred while deleting the directory entry 54 or deallocating the inode. 55 56 [EROFS] The directory entry to be removed resides on a read-only 57 file system. 58 59 [EFAULT] _P_a_t_h points outside the process's allocated address 60 space. 61 62SSEEEE AALLSSOO 63 mkdir(2), unlink(2) 64 65HHIISSTTOORRYY 66 The rrmmddiirr function call appeared in 4.2BSD. 67