man(1) Manual page archive


     UNLINK(2)                                               UNLINK(2)

     NAME
          unlink - remove directory entry

     SYNOPSIS
          int unlink(name)
          char *name;

     DESCRIPTION
          Unlink removes the entry for the file pointed to by name
          from its directory.  If this entry was the last link to the
          file, the contents of the file are freed and the file is
          destroyed.  If, however, the file was open in any process,
          the actual destruction is delayed until it is closed, even
          though the directory entry has disappeared.

          Only the super-user can unlink a directory, but see rmdir in
          mkdir(2).

     SEE ALSO
          rm(1), link(2), mkdir(2)

     DIAGNOSTICS
          EFAULT, EIO, ELOOP, ENOENT, ENOTDIR, EROFS