]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" This file is derived from unlink.2, which has the following copyright: |
2 | .\" | |
3 | .\" --snip-- | |
4 | .\" This manpage is Copyright (C) 1992 Drew Eckhardt; | |
5 | .\" 1993 Ian Jackson. | |
6 | .\" | |
7 | .\" Permission is granted to make and distribute verbatim copies of this | |
8 | .\" manual provided the copyright notice and this permission notice are | |
9 | .\" preserved on all copies. | |
10 | .\" | |
11 | .\" Permission is granted to copy and distribute modified versions of this | |
12 | .\" manual under the conditions for verbatim copying, provided that the | |
13 | .\" entire resulting derived work is distributed under the terms of a | |
14 | .\" permission notice identical to this one. | |
15 | .\" | |
16 | .\" Since the Linux kernel and libraries are constantly changing, this | |
17 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
18 | .\" responsibility for errors or omissions, or for damages resulting from | |
19 | .\" the use of the information contained herein. The author(s) may not | |
20 | .\" have taken the same level of care in the production of this manual, | |
21 | .\" which is licensed free of charge, as they might when working | |
22 | .\" professionally. | |
23 | .\" | |
24 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
25 | .\" the source, must acknowledge the copyright and authors of this work. | |
26 | .\" --snip-- | |
27 | .\" | |
28 | .\" Edited into remove.3 shape by: | |
29 | .\" Graeme W. Wilford (G.Wilford@ee.surrey.ac.uk) on 13th July 1994 | |
30 | .\" | |
31 | .TH REMOVE 3 1994-07-13 Linux "GNU" | |
32 | .SH NAME | |
33 | remove \- delete a name and possibly the file it refers to | |
34 | .SH SYNOPSIS | |
35 | .B #include <stdio.h> | |
36 | .sp | |
37 | .BI "int remove(const char *" pathname ); | |
38 | .SH DESCRIPTION | |
e511ffb6 | 39 | .BR remove () |
fea681da MK |
40 | deletes a name from the filesystem. |
41 | It calls | |
31e9a9ec | 42 | .BR unlink () |
fea681da | 43 | for files, and |
31e9a9ec | 44 | .BR rmdir () |
fea681da MK |
45 | for directories. |
46 | ||
47 | If the removed name was the | |
48 | last link to a file and no processes have the file open the file is | |
49 | deleted and the space it was using is made available for reuse. | |
50 | ||
51 | If the name was the last link to a file but any processes still have | |
52 | the file open the file will remain in existence until the last file | |
53 | descriptor referring to it is closed. | |
54 | ||
55 | If the name referred to a symbolic link the link is removed. | |
56 | ||
57 | If the name referred to a socket, fifo or device the name for it is | |
58 | removed but processes which have the object open may continue to use | |
59 | it. | |
60 | .SH "RETURN VALUE" | |
61 | On success, zero is returned. On error, \-1 is returned, and | |
62 | .I errno | |
63 | is set appropriately. | |
64 | .SH ERRORS | |
65 | The errors that occur are those for | |
66 | .BR unlink (2) | |
67 | and | |
68 | .BR rmdir (2). | |
69 | .SH "CONFORMING TO" | |
b14d4aa5 | 70 | ANSI C, SVID, AT&T, POSIX, X/OPEN, 4.3BSD |
fea681da MK |
71 | .SH BUGS |
72 | Infelicities in the protocol underlying NFS can cause the unexpected | |
73 | disappearance of files which are still being used. | |
74 | .SH NOTE | |
75 | Under libc4 and libc5, | |
e511ffb6 | 76 | .BR remove () |
e1d6264d MK |
77 | was an alias for |
78 | .BR unlink () | |
79 | (and hence would not remove directories). | |
fea681da MK |
80 | .SH "SEE ALSO" |
81 | .BR rm (1), | |
82 | .BR link (2), | |
83 | .BR mknod (2), | |
84 | .BR open (2), | |
85 | .BR rename (2), | |
86 | .BR rmdir (2), | |
87 | .BR unlink (2), | |
88 | .BR mkfifo (3), | |
89 | .BR unlink (8) |