Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ unlink(2) — Ultrix-11 3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rm(1)

close(2)

link(2)

unlink(2)

NAME

unlink − remove directory entry

SYNTAX

int unlink(name)
char *name;

DESCRIPTION

The unlink system call removes the entry for the file pointed to by name from its directory.  The specified name points to a null-terminated string.  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. 

DIAGNOSTICS

The unlink call will fail if:

[EACCES] Search permission is denied for a component of the path prefix. 

[EACCES] Write permission is denied on the directory containing the link to be removed. 

[EBUSY] The entry to be unlinked is the mount point for a mounted file system. 

[EFAULT] The specified name points to an address outside the process’s allocated address space. 

[ENFILE] There is insufficient system space to contain the inode. 

[ENOENT] Either the named file or an element within the named file does not exist. 

[ENOTDIR] A component of the path prefix is not a directory. 

[EPERM] The named file is a directory, and the process’s effective user ID is not the superuser. 

[EROFS] The named file resides on a read-only file system. 

[ETXTBSY] The file is a pure procedure (shared text) file that is currently open for reading or writing by some process. 

ASSEMBLER

(unlink = 10.) 
sys unlink; name

SEE ALSO

rm(1), close(2), link(2)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026