2
* See the file LICENSE for redistribution information.
4
* Copyright (c) 1997-2002
5
* Sleepycat Software. All rights reserved.
11
static const char revid[] = "$Id: os_unlink.c,v 11.24 2002/07/12 18:56:53 bostic Exp $";
14
#ifndef NO_SYSTEM_INCLUDES
15
#include <sys/types.h>
24
* __os_region_unlink --
25
* Remove a shared memory object file.
27
* PUBLIC: int __os_region_unlink __P((DB_ENV *, const char *));
30
__os_region_unlink(dbenv, path)
38
if ((ret = __os_shmname(dbenv, path, &newname)) != 0)
41
if ((ret = shm_unlink(newname)) != 0) {
42
ret = __os_get_errno();
44
__db_err(dbenv, "shm_unlink: %s: %s",
45
newname, strerror(ret));
49
__os_free(dbenv, newname);
52
if (F_ISSET(dbenv, DB_ENV_OVERWRITE))
53
(void)__db_overwrite(dbenv, path);
55
return (__os_unlink(dbenv, path));
63
* PUBLIC: int __os_unlink __P((DB_ENV *, const char *));
66
__os_unlink(dbenv, path)
72
retry: ret = DB_GLOBAL(j_unlink) != NULL ?
73
DB_GLOBAL(j_unlink)(path) :
80
if ((ret = __os_get_errno()) == EINTR)
84
* We really shouldn't be looking at this value ourselves,
85
* but ENOENT usually signals that a file is missing, and
86
* we attempt to unlink things (such as v. 2.x environment
87
* regions, in DB_ENV->remove) that we're expecting not to
88
* be there. Reporting errors in these cases is annoying.
93
* The results of unlink are file system driver specific
94
* on VxWorks. In the case of removing a file that did
95
* not exist, some, at least, return an error, but with
96
* an errno of 0, not ENOENT.
98
* Code below falls through to original if-statement only
99
* we didn't get a "successful" error.
105
__db_err(dbenv, "unlink: %s: %s", path, strerror(ret));