diff options
author | 2015-07-16 04:27:33 +0000 | |
---|---|---|
committer | 2015-07-16 04:27:33 +0000 | |
commit | 8f7652afeffc80bc034f7cc806cf127a5401a8cb (patch) | |
tree | fa0f0f7079b79e218b84b461595318a6b7dc1398 /lib | |
parent | After reading a password with terminal echo off, restore the terminal to (diff) | |
download | wireguard-openbsd-8f7652afeffc80bc034f7cc806cf127a5401a8cb.tar.xz wireguard-openbsd-8f7652afeffc80bc034f7cc806cf127a5401a8cb.zip |
remove the stubby not working mmaped file support. ok sthen (long ago)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/db/btree/btree.h | 3 | ||||
-rw-r--r-- | lib/libc/db/recno/rec_close.c | 4 | ||||
-rw-r--r-- | lib/libc/db/recno/rec_open.c | 31 |
3 files changed, 3 insertions, 35 deletions
diff --git a/lib/libc/db/btree/btree.h b/lib/libc/db/btree/btree.h index cab3d5d6d75..57ef9fc1696 100644 --- a/lib/libc/db/btree/btree.h +++ b/lib/libc/db/btree/btree.h @@ -1,4 +1,4 @@ -/* $OpenBSD: btree.h,v 1.6 2003/06/02 20:18:33 millert Exp $ */ +/* $OpenBSD: btree.h,v 1.7 2015/07/16 04:27:33 tedu Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -367,7 +367,6 @@ typedef struct _btree { #define R_CLOSEFP 0x00040 /* opened a file pointer */ #define R_EOF 0x00100 /* end of input file reached. */ #define R_FIXLEN 0x00200 /* fixed length records */ -#define R_MEMMAPPED 0x00400 /* memory mapped file. */ #define R_INMEM 0x00800 /* in-memory file */ #define R_MODIFIED 0x01000 /* modified file */ #define R_RDONLY 0x02000 /* read-only file */ diff --git a/lib/libc/db/recno/rec_close.c b/lib/libc/db/recno/rec_close.c index dae2dc2ee40..4afc2b153eb 100644 --- a/lib/libc/db/recno/rec_close.c +++ b/lib/libc/db/recno/rec_close.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rec_close.c,v 1.11 2005/08/05 13:03:00 espie Exp $ */ +/* $OpenBSD: rec_close.c,v 1.12 2015/07/16 04:27:33 tedu Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -69,8 +69,6 @@ __rec_close(DB *dbp) /* Committed to closing. */ status = RET_SUCCESS; - if (F_ISSET(t, R_MEMMAPPED) && munmap(t->bt_smap, t->bt_msize)) - status = RET_ERROR; if (!F_ISSET(t, R_INMEM)) { if (F_ISSET(t, R_CLOSEFP)) { diff --git a/lib/libc/db/recno/rec_open.c b/lib/libc/db/recno/rec_open.c index 02005cae25f..b8e688f9cef 100644 --- a/lib/libc/db/recno/rec_open.c +++ b/lib/libc/db/recno/rec_open.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rec_open.c,v 1.11 2005/08/05 13:03:00 espie Exp $ */ +/* $OpenBSD: rec_open.c,v 1.12 2015/07/16 04:27:33 tedu Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -138,39 +138,10 @@ slow: if ((t->bt_rfp = fdopen(rfd, "r")) == NULL) if (fstat(rfd, &sb)) goto err; - /* - * Kluge -- we'd like to test to see if the file is too - * big to mmap. Since, we don't know what size or type - * off_t's or size_t's are, what the largest unsigned - * integral type is, or what random insanity the local - * C compiler will perpetrate, doing the comparison in - * a portable way is flatly impossible. Hope that mmap - * fails if the file is too large. - */ if (sb.st_size == 0) F_SET(t, R_EOF); else { -#ifdef MMAP_NOT_AVAILABLE - /* - * XXX - * Mmap doesn't work correctly on many current - * systems. In particular, it can fail subtly, - * with cache coherency problems. Don't use it - * for now. - */ - t->bt_msize = sb.st_size; - if ((t->bt_smap = mmap(NULL, t->bt_msize, - PROT_READ, MAP_FILE | MAP_PRIVATE, rfd, - (off_t)0)) == MAP_FAILED) - goto slow; - t->bt_cmap = t->bt_smap; - t->bt_emap = t->bt_smap + sb.st_size; - t->bt_irec = F_ISSET(t, R_FIXLEN) ? - __rec_fmap : __rec_vmap; - F_SET(t, R_MEMMAPPED); -#else goto slow; -#endif } } } |