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.c7
-rw-r--r--lib/libc/db/hash/hash_buf.c3
-rw-r--r--lib/libc/db/hash/hash_page.c6
-rw-r--r--lib/libc/db/mpool/mpool.c4
-rw-r--r--lib/libc/db/recno/rec_close.c4
-rw-r--r--lib/libc/db/recno/rec_open.c4
8 files changed, 27 insertions, 11 deletions
diff --git a/lib/libc/db/btree/bt_close.c b/lib/libc/db/btree/bt_close.c
index c5e0d52..878c4c4 100644
--- a/lib/libc/db/btree/bt_close.c
+++ b/lib/libc/db/btree/bt_close.c
@@ -40,6 +40,7 @@
static char sccsid[] = "@(#)bt_close.c 8.7 (Berkeley) 8/17/94";
#endif /* LIBC_SCCS and not lint */
+#include "namespace.h"
#include <sys/param.h>
#include <errno.h>
@@ -47,6 +48,7 @@ static char sccsid[] = "@(#)bt_close.c 8.7 (Berkeley) 8/17/94";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "un-namespace.h"
#include <db.h>
#include "btree.h"
diff --git a/lib/libc/db/btree/bt_open.c b/lib/libc/db/btree/bt_open.c
index d3c353f..e2e9a24 100644
--- a/lib/libc/db/btree/bt_open.c
+++ b/lib/libc/db/btree/bt_open.c
@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)bt_open.c 8.10 (Berkeley) 8/17/94";
* is wholly independent of the Postgres code.
*/
+#include "namespace.h"
#include <sys/param.h>
#include <sys/stat.h>
@@ -59,6 +60,7 @@ static char sccsid[] = "@(#)bt_open.c 8.10 (Berkeley) 8/17/94";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "un-namespace.h"
#include <db.h>
#include "btree.h"
@@ -217,7 +219,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
if (_fcntl(t->bt_fd, F_SETFD, 1) == -1)
goto err;
- if (fstat(t->bt_fd, &sb))
+ if (_fstat(t->bt_fd, &sb))
goto err;
if (sb.st_size) {
if ((nr = _read(t->bt_fd, &m, sizeof(BTMETA))) < 0)
@@ -399,10 +401,10 @@ tmp()
sizeof(path), "%s/bt.XXXXXXXXXX", envtmp ? envtmp : "/tmp");
(void)sigfillset(&set);
- (void)sigprocmask(SIG_BLOCK, &set, &oset);
+ (void)_sigprocmask(SIG_BLOCK, &set, &oset);
if ((fd = mkstemp(path)) != -1)
(void)unlink(path);
- (void)sigprocmask(SIG_SETMASK, &oset, NULL);
+ (void)_sigprocmask(SIG_SETMASK, &oset, NULL);
return(fd);
}
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index dcef5df..34fe4ad 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -40,6 +40,7 @@
static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94";
#endif /* LIBC_SCCS and not lint */
+#include "namespace.h"
#include <sys/param.h>
#include <sys/stat.h>
@@ -52,6 +53,7 @@ static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94";
#ifdef DEBUG
#include <assert.h>
#endif
+#include "un-namespace.h"
#include <db.h>
#include "hash.h"
@@ -136,7 +138,7 @@ __hash_open(file, flags, mode, info, dflags)
/* if the .db file is empty, and we had permission to create
a new .db file, then reinitialize the database */
if ((flags & O_CREAT) &&
- fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
+ _fstat(hashp->fp, &statbuf) == 0 && statbuf.st_size == 0)
new_table = 1;
(void)_fcntl(hashp->fp, F_SETFD, 1);
@@ -562,7 +564,8 @@ hash_put(dbp, key, data, flag)
hashp = (HTAB *)dbp->internal;
if (flag && flag != R_NOOVERWRITE) {
- hashp->error = errno = EINVAL;
+ hashp->error = EINVAL;
+ errno = EINVAL;
return (ERROR);
}
if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c
index 92e1f93..afa9164 100644
--- a/lib/libc/db/hash/hash_buf.c
+++ b/lib/libc/db/hash/hash_buf.c
@@ -32,6 +32,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
@@ -56,7 +58,6 @@ static char sccsid[] = "@(#)hash_buf.c 8.5 (Berkeley) 7/15/94";
#include <sys/param.h>
-#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c
index 30445e4..dd042c8 100644
--- a/lib/libc/db/hash/hash_page.c
+++ b/lib/libc/db/hash/hash_page.c
@@ -56,6 +56,7 @@ static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94";
* open_temp
*/
+#include "namespace.h"
#include <sys/types.h>
#include <errno.h>
@@ -68,6 +69,7 @@ static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94";
#ifdef DEBUG
#include <assert.h>
#endif
+#include "un-namespace.h"
#include <db.h>
#include "hash.h"
@@ -866,12 +868,12 @@ open_temp(hashp)
/* Block signals; make sure file goes away at process exit. */
(void)sigfillset(&set);
- (void)sigprocmask(SIG_BLOCK, &set, &oset);
+ (void)_sigprocmask(SIG_BLOCK, &set, &oset);
if ((hashp->fp = mkstemp(namestr)) != -1) {
(void)unlink(namestr);
(void)_fcntl(hashp->fp, F_SETFD, 1);
}
- (void)sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);
+ (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 a4ab912..303d8c0 100644
--- a/lib/libc/db/mpool/mpool.c
+++ b/lib/libc/db/mpool/mpool.c
@@ -37,6 +37,7 @@
static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94";
#endif /* LIBC_SCCS and not lint */
+#include "namespace.h"
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/stat.h>
@@ -46,6 +47,7 @@ static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "un-namespace.h"
#include <db.h>
@@ -76,7 +78,7 @@ mpool_open(key, fd, pagesize, maxcache)
* XXX
* We don't currently handle pipes, although we should.
*/
- if (fstat(fd, &sb))
+ if (_fstat(fd, &sb))
return (NULL);
if (!S_ISREG(sb.st_mode)) {
errno = ESPIPE;
diff --git a/lib/libc/db/recno/rec_close.c b/lib/libc/db/recno/rec_close.c
index 25d01de..1f19bd3 100644
--- a/lib/libc/db/recno/rec_close.c
+++ b/lib/libc/db/recno/rec_close.c
@@ -37,6 +37,7 @@
static char sccsid[] = "@(#)rec_close.c 8.6 (Berkeley) 8/18/94";
#endif /* LIBC_SCCS and not lint */
+#include "namespace.h"
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/mman.h>
@@ -45,6 +46,7 @@ static char sccsid[] = "@(#)rec_close.c 8.6 (Berkeley) 8/18/94";
#include <limits.h>
#include <stdio.h>
#include <unistd.h>
+#include "un-namespace.h"
#include <db.h>
#include "recno.h"
@@ -165,7 +167,7 @@ __rec_sync(dbp, flags)
while (status == RET_SUCCESS) {
iov[0].iov_base = data.data;
iov[0].iov_len = data.size;
- if (writev(t->bt_rfd, iov, 2) != data.size + 1)
+ if (_writev(t->bt_rfd, iov, 2) != data.size + 1)
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 eaeacc5..4098b18 100644
--- a/lib/libc/db/recno/rec_open.c
+++ b/lib/libc/db/recno/rec_open.c
@@ -40,6 +40,7 @@
static char sccsid[] = "@(#)rec_open.c 8.10 (Berkeley) 9/1/94";
#endif /* LIBC_SCCS and not lint */
+#include "namespace.h"
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
@@ -50,6 +51,7 @@ static char sccsid[] = "@(#)rec_open.c 8.10 (Berkeley) 9/1/94";
#include <stddef.h>
#include <stdio.h>
#include <unistd.h>
+#include "un-namespace.h"
#include <db.h>
#include "recno.h"
@@ -146,7 +148,7 @@ slow: if ((t->bt_rfp = fdopen(rfd, "r")) == NULL)
goto einval;
}
- if (fstat(rfd, &sb))
+ if (_fstat(rfd, &sb))
goto err;
/*
* Kluge -- we'd like to test to see if the file is too
OpenPOWER on IntegriCloud