2 * Copyright (c) 1990 The Regents of the University of California.
5 * Redistribution and use in source and binary forms are permitted
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * and/or other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 <<remove>>---delete a file's name
29 int remove(char *<[filename]>);
31 int _remove_r(struct _reent *<[reent]>, char *<[filename]>);
34 Use <<remove>> to dissolve the association between a particular
35 filename (the string at <[filename]>) and the file it represents.
36 After calling <<remove>> with a particular filename, you will no
37 longer be able to open the file by that name.
39 In this implementation, you may use <<remove>> on an open file without
40 error; existing file descriptors for the file will continue to access
41 the file's data until the program using them closes the file.
43 The alternate function <<_remove_r>> is a reentrant version. The
44 extra argument <[reent]> is a pointer to a reentrancy structure.
47 <<remove>> returns <<0>> if it succeeds, <<-1>> if it fails.
50 ANSI C requires <<remove>>, but only specifies that the result on
51 failure be nonzero. The behavior of <<remove>> when you call it on an
52 open file may vary among implementations.
54 Supporting OS subroutine required: <<unlink>>.
62 _remove_r (struct _reent
*ptr
,
65 if (_unlink_r (ptr
, filename
) == -1)
74 remove (const char *filename
)
76 return _remove_r (_REENT
, filename
);