Deleted Added
full compact
hash_page.c (254289) hash_page.c (287292)
1/*-
2 * Copyright (c) 1990, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Margo Seltzer.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94";
35#endif /* LIBC_SCCS and not lint */
36#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1990, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Margo Seltzer.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94";
35#endif /* LIBC_SCCS and not lint */
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/lib/libc/db/hash/hash_page.c 254289 2013-08-13 19:20:50Z jilles $");
37__FBSDID("$FreeBSD: head/lib/libc/db/hash/hash_page.c 287292 2015-08-29 14:25:01Z kib $");
38
39/*
40 * PACKAGE: hashing
41 *
42 * DESCRIPTION:
43 * Page manipulation for hashing package.
44 *
45 * ROUTINES:

--- 15 unchanged lines hidden (view full) ---

61#include <stdio.h>
62#include <stdlib.h>
63#include <string.h>
64#include <unistd.h>
65#ifdef DEBUG
66#include <assert.h>
67#endif
68#include "un-namespace.h"
38
39/*
40 * PACKAGE: hashing
41 *
42 * DESCRIPTION:
43 * Page manipulation for hashing package.
44 *
45 * ROUTINES:

--- 15 unchanged lines hidden (view full) ---

61#include <stdio.h>
62#include <stdlib.h>
63#include <string.h>
64#include <unistd.h>
65#ifdef DEBUG
66#include <assert.h>
67#endif
68#include "un-namespace.h"
69#include "libc_private.h"
69
70#include <db.h>
71#include "hash.h"
72#include "page.h"
73#include "extern.h"
74
75static u_int32_t *fetch_bitmap(HTAB *, int);
76static u_int32_t first_free(u_int32_t);

--- 779 unchanged lines hidden (view full) ---

856 sizeof(path), "%s/_hash.XXXXXX", envtmp ? envtmp : "/tmp");
857 if (len < 0 || len >= (int)sizeof(path)) {
858 errno = ENAMETOOLONG;
859 return (-1);
860 }
861
862 /* Block signals; make sure file goes away at process exit. */
863 (void)sigfillset(&set);
70
71#include <db.h>
72#include "hash.h"
73#include "page.h"
74#include "extern.h"
75
76static u_int32_t *fetch_bitmap(HTAB *, int);
77static u_int32_t first_free(u_int32_t);

--- 779 unchanged lines hidden (view full) ---

857 sizeof(path), "%s/_hash.XXXXXX", envtmp ? envtmp : "/tmp");
858 if (len < 0 || len >= (int)sizeof(path)) {
859 errno = ENAMETOOLONG;
860 return (-1);
861 }
862
863 /* Block signals; make sure file goes away at process exit. */
864 (void)sigfillset(&set);
864 (void)_sigprocmask(SIG_BLOCK, &set, &oset);
865 (void)__libc_sigprocmask(SIG_BLOCK, &set, &oset);
865 if ((hashp->fp = mkostemp(path, O_CLOEXEC)) != -1)
866 (void)unlink(path);
866 if ((hashp->fp = mkostemp(path, O_CLOEXEC)) != -1)
867 (void)unlink(path);
867 (void)_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);
868 (void)__libc_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);
868 return (hashp->fp != -1 ? 0 : -1);
869}
870
871/*
872 * We have to know that the key will fit, but the last entry on the page is
873 * an overflow pair, so we need to shift things.
874 */
875static void

--- 59 unchanged lines hidden ---
869 return (hashp->fp != -1 ? 0 : -1);
870}
871
872/*
873 * We have to know that the key will fit, but the last entry on the page is
874 * an overflow pair, so we need to shift things.
875 */
876static void

--- 59 unchanged lines hidden ---