Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lmdb-sys/lmdb/libraries/liblmdb/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ static NtCloseFunc *NtClose;
# define SSIZE_MAX INT_MAX
# endif
#endif
#define MDB_OFF_T int64_t
#else
#include <sys/types.h>
#include <sys/stat.h>
Expand All @@ -108,6 +109,7 @@ static NtCloseFunc *NtClose;
#include <sys/file.h>
#endif
#include <fcntl.h>
#define MDB_OFF_T off_t
#endif

#if defined(__mips) && defined(__linux)
Expand Down Expand Up @@ -1507,7 +1509,7 @@ struct MDB_env {
MDB_txn *me_txn; /**< current write transaction */
MDB_txn *me_txn0; /**< prealloc'd write transaction */
mdb_size_t me_mapsize; /**< size of the data memory map */
off_t me_size; /**< current file size */
MDB_OFF_T me_size; /**< current file size */
pgno_t me_maxpg; /**< me_mapsize / me_psize */
MDB_dbx *me_dbxs; /**< array of static DB info */
uint16_t *me_dbflags; /**< array of flags from MDB_db.md_flags */
Expand Down Expand Up @@ -3668,15 +3670,15 @@ mdb_page_flush(MDB_txn *txn, int keep)
unsigned psize = env->me_psize, j;
int i, pagecount = dl[0].mid, rc;
size_t size = 0;
off_t pos = 0;
MDB_OFF_T pos = 0;
pgno_t pgno = 0;
MDB_page *dp = NULL;
#ifdef _WIN32
OVERLAPPED ov;
#else
struct iovec iov[MDB_COMMIT_PAGES];
ssize_t wsize = 0, wres;
off_t wpos = 0, next_pos = 1; /* impossible pos, so pos != next_pos */
MDB_OFF_T wpos = 0, next_pos = 1; /* impossible pos, so pos != next_pos */
int n = 0;
#endif

Expand Down Expand Up @@ -4240,7 +4242,7 @@ mdb_env_write_meta(MDB_txn *txn)
MDB_meta meta, metab, *mp;
unsigned flags;
mdb_size_t mapsize;
off_t off;
MDB_OFF_T off;
int rc, len, toggle;
char *ptr;
HANDLE mfd;
Expand Down Expand Up @@ -5229,7 +5231,7 @@ mdb_env_setup_locks(MDB_env *env, MDB_name *fname, int mode, int *excl)
union semun semu;
#endif
int rc;
off_t size, rsize;
MDB_OFF_T size, rsize;

rc = mdb_fopen(env, fname, MDB_O_LOCKS, mode, &env->me_lfd);
if (rc) {
Expand Down Expand Up @@ -6097,7 +6099,7 @@ mdb_rpage_get(MDB_txn *txn, pgno_t pg0, MDB_page **ret)
len, &off, &len, ViewUnmap, (env->me_flags & MDB_RDONLY) ? 0 : MEM_RESERVE, PAGE_READONLY); \
if (rc) rc = mdb_nt2win32(rc)
#else
off_t off;
MDB_OFF_T off;
size_t len;
#define SET_OFF(off,val) off = val
#define MAP(rc,env,addr,len,off) \
Expand Down
Loading