diff options
Diffstat (limited to 'lib/libc/db/hash')
-rw-r--r-- | lib/libc/db/hash/hash.c | 12 | ||||
-rw-r--r-- | lib/libc/db/hash/hash_page.c | 14 |
2 files changed, 12 insertions, 14 deletions
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); |