34 #if defined(LIBC_SCCS) && !defined(lint) 35 static char sccsid[] =
"@(#)rec_close.c 8.6 (Berkeley) 8/18/94";
38 #include <sys/types.h> 47 #include "../include/db.h" 121 if (t->bt_pinned !=
NULL) {
137 if (lseek(t->bt_rfd, (off_t)0, SEEK_SET) != 0)
141 scursor = t->bt_cursor.rcursor;
152 status = (dbp->seq)(dbp, &key, &data,
R_FIRST);
154 if ((
size_t) write(t->bt_rfd, data.
data, data.
size) != data.
size)
156 status = (dbp->seq)(dbp, &key, &data,
R_NEXT);
159 iov[1].iov_base = &t->bt_bval;
162 status = (dbp->seq)(dbp, &key, &data,
R_FIRST);
164 iov[0].iov_base = data.
data;
165 iov[0].iov_len = data.
size;
166 if ((
size_t) writev(t->bt_rfd, iov, 2) != data.
size + 1)
168 status = (dbp->seq)(dbp, &key, &data,
R_NEXT);
173 t->bt_cursor.rcursor = scursor;
177 if ((off = lseek(t->bt_rfd, (off_t)0, SEEK_CUR)) == -1)
179 if (ftruncate(t->bt_rfd, off))
int mpool_put(MPOOL *mp, void *page, u_int flags)
int __bt_sync(DB *dbp, u_int flags) const
int __rec_sync(DB *dbp, u_int flags) const