source: trunk/minix/man/man2/unlink.2@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 2.0 KB
Line 
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.\" @(#)unlink.2 6.2 (Berkeley) 5/22/85
6.\"
7.TH UNLINK 2 "May 22, 1985"
8.UC 4
9.SH NAME
10unlink \- remove directory entry
11.SH SYNOPSIS
12.nf
13.ft B
14#include <unistd.h>
15
16int unlink(const char *path)
17.fi
18.ft R
19.SH DESCRIPTION
20.B Unlink
21removes the entry for the file
22.I path
23from its directory.
24If this entry was the last link to the file,
25and no process has the file open, then
26all resources associated with the file are reclaimed.
27If, however, the file was open in any process, the actual
28resource reclamation is delayed until it is closed,
29even though the directory entry has disappeared.
30.SH "RETURN VALUE
31Upon successful completion, a value of 0 is returned.
32Otherwise, a value of \-1 is returned and
33.B errno
34is set to indicate the error.
35.SH "ERRORS
36The \fIunlink\fP succeeds unless:
37.TP 15
38[ENOTDIR]
39A component of the path prefix is not a directory.
40.TP 15
41[ENAMETOOLONG]
42The path name exceeds PATH_MAX characters.
43.TP 15
44[ENOENT]
45The named file does not exist.
46.TP 15
47[EACCES]
48Search permission is denied for a component of the path prefix.
49.TP 15
50[EACCES]
51Write permission is denied on the directory containing the link
52to be removed.
53.TP 15
54[ELOOP]
55Too many symbolic links were encountered in translating the pathname.
56(Minix-vmd)
57.TP 15
58[EPERM]
59The named file is a directory.
60.TP 15
61[EPERM]
62The directory containing the file is marked sticky,
63and neither the containing directory nor the file to be removed
64are owned by the effective user ID.
65(Minix-vmd)
66.TP 15
67[EBUSY]
68The entry to be unlinked is the mount point for a
69mounted file system.
70.TP 15
71[EIO]
72An I/O error occurred while deleting the directory entry
73or deallocating the inode.
74.TP 15
75[EROFS]
76The named file resides on a read-only file system.
77.TP 15
78[EFAULT]
79.I Path
80points outside the process's allocated address space.
81.SH "SEE ALSO"
82.BR close (2),
83.BR link (2),
84.BR rmdir (2).
Note: See TracBrowser for help on using the repository browser.