summaryrefslogtreecommitdiffstats
path: root/lib/libc/db
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/db')
-rw-r--r--lib/libc/db/btree/bt_close.c2
-rw-r--r--lib/libc/db/btree/bt_open.c8
-rw-r--r--lib/libc/db/hash/hash.c12
-rw-r--r--lib/libc/db/hash/hash_page.c14
-rw-r--r--lib/libc/db/mpool/mpool.c6
-rw-r--r--lib/libc/db/recno/rec_close.c4
-rw-r--r--lib/libc/db/recno/rec_open.c4
7 files changed, 24 insertions, 26 deletions
diff --git a/lib/libc/db/btree/bt_close.c b/lib/libc/db/btree/bt_close.c
index fbe6a21..c5e0d52 100644
--- a/lib/libc/db/btree/bt_close.c
+++ b/lib/libc/db/btree/bt_close.c
@@ -105,7 +105,7 @@ __bt_close(dbp)
fd = t->bt_fd;
free(t);
free(dbp);
- return (_libc_close(fd) ? RET_ERROR : RET_SUCCESS);
+ return (_close(fd) ? RET_ERROR : RET_SUCCESS);
}
/*
diff --git a/lib/libc/db/btree/bt_open.c b/lib/libc/db/btree/bt_open.c
index d306993..e838f25 100644
--- a/lib/libc/db/btree/bt_open.c
+++ b/lib/libc/db/btree/bt_open.c
@@ -203,7 +203,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
goto einval;
}
- if ((t->bt_fd = _libc_open(fname, flags, mode)) < 0)
+ if ((t->bt_fd = _open(fname, flags, mode)) < 0)
goto err;
} else {
@@ -214,13 +214,13 @@ __bt_open(fname, flags, mode, openinfo, dflags)
F_SET(t, B_INMEM);
}
- if (_libc_fcntl(t->bt_fd, F_SETFD, 1) == -1)
+ if (_fcntl(t->bt_fd, F_SETFD, 1) == -1)
goto err;
if (fstat(t->bt_fd, &sb))
goto err;
if (sb.st_size) {
- if ((nr = _libc_read(t->bt_fd, &m, sizeof(BTMETA))) < 0)
+ if ((nr = _read(t->bt_fd, &m, sizeof(BTMETA))) < 0)
goto err;
if (nr != sizeof(BTMETA))
goto eftype;
@@ -336,7 +336,7 @@ err: if (t) {
if (t->bt_dbp)
free(t->bt_dbp);
if (t->bt_fd != -1)
- (void)_libc_close(t->bt_fd);
+ (void)_close(t->bt_fd);
free(t);
}
return (NULL);
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index 0a2f3c6..dcef5df 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -130,7 +130,7 @@ __hash_open(file, flags, mode, info, dflags)
new_table = 1;
}
if (file) {
- if ((hashp->fp = _libc_open(file, flags, mode)) == -1)
+ if ((hashp->fp = _open(file, flags, mode)) == -1)
RETURN_ERROR(errno, error0);
/* if the .db file is empty, and we had permission to create
@@ -139,7 +139,7 @@ __hash_open(file, flags, mode, info, dflags)
fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
new_table = 1;
- (void)_libc_fcntl(hashp->fp, F_SETFD, 1);
+ (void)_fcntl(hashp->fp, F_SETFD, 1);
}
if (new_table) {
if (!(hashp = init_hash(hashp, file, (HASHINFO *)info)))
@@ -151,7 +151,7 @@ __hash_open(file, flags, mode, info, dflags)
else
hashp->hash = __default_hash;
- hdrsize = _libc_read(hashp->fp, &hashp->hdr, sizeof(HASHHDR));
+ hdrsize = _read(hashp->fp, &hashp->hdr, sizeof(HASHHDR));
#if BYTE_ORDER == LITTLE_ENDIAN
swap_header(hashp);
#endif
@@ -242,7 +242,7 @@ __hash_open(file, flags, mode, info, dflags)
error1:
if (hashp != NULL)
- (void)_libc_close(hashp->fp);
+ (void)_close(hashp->fp);
error0:
free(hashp);
@@ -440,7 +440,7 @@ hdestroy(hashp)
free(hashp->mapp[i]);
if (hashp->fp != -1)
- (void)_libc_close(hashp->fp);
+ (void)_close(hashp->fp);
free(hashp);
@@ -509,7 +509,7 @@ flush_meta(hashp)
swap_header_copy(&hashp->hdr, whdrp);
#endif
if ((lseek(fp, (off_t)0, SEEK_SET) == -1) ||
- ((wsize = _libc_write(fp, whdrp, sizeof(HASHHDR))) == -1))
+ ((wsize = _write(fp, whdrp, sizeof(HASHHDR))) == -1))
return (-1);
else
if (wsize != sizeof(HASHHDR)) {
diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c
index 7a204ab..30445e4 100644
--- a/lib/libc/db/hash/hash_page.c
+++ b/lib/libc/db/hash/hash_page.c
@@ -539,7 +539,7 @@ __get_page(hashp, p, bucket, is_bucket, is_disk, is_bitmap)
else
page = OADDR_TO_PAGE(bucket);
if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
- ((rsize = _libc_read(fd, p, size)) == -1))
+ ((rsize = _read(fd, p, size)) == -1))
return (-1);
bp = (u_int16_t *)p;
if (!rsize)
@@ -610,7 +610,7 @@ __put_page(hashp, p, bucket, is_bucket, is_bitmap)
else
page = OADDR_TO_PAGE(bucket);
if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
- ((wsize = _libc_write(fd, p, size)) == -1))
+ ((wsize = _write(fd, p, size)) == -1))
/* Errno is set */
return (-1);
if (wsize != size) {
@@ -714,8 +714,7 @@ overflow_page(hashp)
#define OVMSG "HASH: Out of overflow pages. Increase page size\n"
if (offset > SPLITMASK) {
if (++splitnum >= NCACHED) {
- (void)_libc_write(STDERR_FILENO, OVMSG, sizeof(OVMSG) -
- 1);
+ (void)_write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
return (0);
}
hashp->OVFL_POINT = splitnum;
@@ -728,8 +727,7 @@ overflow_page(hashp)
if (free_bit == (hashp->BSIZE << BYTE_SHIFT) - 1) {
free_page++;
if (free_page >= NCACHED) {
- (void)_libc_write(STDERR_FILENO, OVMSG, sizeof(OVMSG) -
- 1);
+ (void)_write(STDERR_FILENO, OVMSG, sizeof(OVMSG) - 1);
return (0);
}
/*
@@ -753,7 +751,7 @@ overflow_page(hashp)
offset++;
if (offset > SPLITMASK) {
if (++splitnum >= NCACHED) {
- (void)_libc_write(STDERR_FILENO, OVMSG,
+ (void)_write(STDERR_FILENO, OVMSG,
sizeof(OVMSG) - 1);
return (0);
}
@@ -871,7 +869,7 @@ open_temp(hashp)
(void)sigprocmask(SIG_BLOCK, &set, &oset);
if ((hashp->fp = mkstemp(namestr)) != -1) {
(void)unlink(namestr);
- (void)_libc_fcntl(hashp->fp, F_SETFD, 1);
+ (void)_fcntl(hashp->fp, F_SETFD, 1);
}
(void)sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);
return (hashp->fp != -1 ? 0 : -1);
diff --git a/lib/libc/db/mpool/mpool.c b/lib/libc/db/mpool/mpool.c
index 00d0740..29377d3 100644
--- a/lib/libc/db/mpool/mpool.c
+++ b/lib/libc/db/mpool/mpool.c
@@ -207,7 +207,7 @@ mpool_get(mp, pgno, flags)
off = mp->pagesize * pgno;
if (lseek(mp->fd, off, SEEK_SET) != off)
return (NULL);
- if ((nr = _libc_read(mp->fd, bp->page, mp->pagesize)) != mp->pagesize) {
+ if ((nr = _read(mp->fd, bp->page, mp->pagesize)) != mp->pagesize) {
if (nr >= 0)
errno = EFTYPE;
return (NULL);
@@ -299,7 +299,7 @@ mpool_sync(mp)
return (RET_ERROR);
/* Sync the file descriptor. */
- return (_libc_fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
+ return (_fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
}
/*
@@ -382,7 +382,7 @@ mpool_write(mp, bp)
off = mp->pagesize * bp->pgno;
if (lseek(mp->fd, off, SEEK_SET) != off)
return (RET_ERROR);
- if (_libc_write(mp->fd, bp->page, mp->pagesize) != mp->pagesize)
+ if (_write(mp->fd, bp->page, mp->pagesize) != mp->pagesize)
return (RET_ERROR);
bp->flags &= ~MPOOL_DIRTY;
diff --git a/lib/libc/db/recno/rec_close.c b/lib/libc/db/recno/rec_close.c
index d1f50938..25d01de 100644
--- a/lib/libc/db/recno/rec_close.c
+++ b/lib/libc/db/recno/rec_close.c
@@ -86,7 +86,7 @@ __rec_close(dbp)
if (fclose(t->bt_rfp))
status = RET_ERROR;
} else
- if (_libc_close(t->bt_rfd))
+ if (_close(t->bt_rfd))
status = RET_ERROR;
if (__bt_close(dbp) == RET_ERROR)
@@ -152,7 +152,7 @@ __rec_sync(dbp, flags)
*/
status = (dbp->seq)(dbp, &key, &data, R_FIRST);
while (status == RET_SUCCESS) {
- if (_libc_write(t->bt_rfd, data.data, data.size) !=
+ if (_write(t->bt_rfd, data.data, data.size) !=
data.size)
return (RET_ERROR);
status = (dbp->seq)(dbp, &key, &data, R_NEXT);
diff --git a/lib/libc/db/recno/rec_open.c b/lib/libc/db/recno/rec_open.c
index 55da040..eaeacc5 100644
--- a/lib/libc/db/recno/rec_open.c
+++ b/lib/libc/db/recno/rec_open.c
@@ -68,7 +68,7 @@ __rec_open(fname, flags, mode, openinfo, dflags)
int rfd, sverrno;
/* Open the user's file -- if this fails, we're done. */
- if (fname != NULL && (rfd = _libc_open(fname, flags, mode)) < 0)
+ if (fname != NULL && (rfd = _open(fname, flags, mode)) < 0)
return (NULL);
/* Create a btree in memory (backed by disk). */
@@ -215,7 +215,7 @@ err: sverrno = errno;
if (dbp != NULL)
(void)__bt_close(dbp);
if (fname != NULL)
- (void)_libc_close(rfd);
+ (void)_close(rfd);
errno = sverrno;
return (NULL);
}
OpenPOWER on IntegriCloud