diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-01-02 06:01:06 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-01-02 06:01:06 +0000 |
commit | 8d6f1731fcd082e4f744ba9cb4bde4be7c08f1b3 (patch) | |
tree | 099a250d7366aef2ab028fdb24f0d692cd784b4a /db2/os/os_fid.c | |
parent | 9a6450d578556c11e7c173d2f28362345b8f1258 (diff) | |
download | glibc-8d6f1731fcd082e4f744ba9cb4bde4be7c08f1b3.tar.gz glibc-8d6f1731fcd082e4f744ba9cb4bde4be7c08f1b3.tar.xz glibc-8d6f1731fcd082e4f744ba9cb4bde4be7c08f1b3.zip |
Update.
* Makeconfig (all-subdirs): Remove db and db2. * db/*: Removed. * db2/*: Removed.
Diffstat (limited to 'db2/os/os_fid.c')
-rw-r--r-- | db2/os/os_fid.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/db2/os/os_fid.c b/db2/os/os_fid.c deleted file mode 100644 index 62da590611..0000000000 --- a/db2/os/os_fid.c +++ /dev/null @@ -1,76 +0,0 @@ -/*- - * See the file LICENSE for redistribution information. - * - * Copyright (c) 1996, 1997, 1998 - * Sleepycat Software. All rights reserved. - */ - -#include "config.h" - -#ifndef lint -static const char sccsid[] = "@(#)os_fid.c 10.12 (Sleepycat) 7/21/98"; -#endif /* not lint */ - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> -#include <sys/stat.h> - -#include <errno.h> -#include <string.h> -#include <time.h> -#endif - -#include "db_int.h" -#include "common_ext.h" - -/* - * __os_fileid -- - * Return a unique identifier for a file. - * - * PUBLIC: int __os_fileid __P((DB_ENV *, const char *, int, u_int8_t *)); - */ -int -__os_fileid(dbenv, fname, timestamp, fidp) - DB_ENV *dbenv; - const char *fname; - int timestamp; - u_int8_t *fidp; -{ - struct stat sb; - size_t i; - time_t now; - u_int8_t *p; - - /* Clear the buffer. */ - memset(fidp, 0, DB_FILE_ID_LEN); - - /* Check for the unthinkable. */ - if (sizeof(sb.st_ino) + - sizeof(sb.st_dev) + sizeof(time_t) > DB_FILE_ID_LEN) - return (EINVAL); - - /* On UNIX, use a dev/inode pair. */ - if (stat(fname, &sb)) { - __db_err(dbenv, "%s: %s", fname, strerror(errno)); - return (errno); - } - - /* - * Use the inode first and in reverse order, hopefully putting the - * distinguishing information early in the string. - */ - for (p = (u_int8_t *)&sb.st_ino + - sizeof(sb.st_ino), i = 0; i < sizeof(sb.st_ino); ++i) - *fidp++ = *--p; - for (p = (u_int8_t *)&sb.st_dev + - sizeof(sb.st_dev), i = 0; i < sizeof(sb.st_dev); ++i) - *fidp++ = *--p; - - if (timestamp) { - (void)time(&now); - for (p = (u_int8_t *)&now + - sizeof(now), i = 0; i < sizeof(now); ++i) - *fidp++ = *--p; - } - return (0); -} |