summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorjmc <jmc@NetBSD.org>2004-06-20 22:20:14 +0000
committerjmc <jmc@NetBSD.org>2004-06-20 22:20:14 +0000
commitb2f782612fe8c90c33dbac39f46b984e155e9d35 (patch)
tree621fd229ae597b565c516ab4afd72b041cdfa672 /lib/libc
parentfa985b27a7846ade156387f98a002515d72661d9 (diff)
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of NetBSD harder, not easier (and also makes the resulting tools 'different') Wrap all required code with the inclusion of nbtool_config.h, attempt to only use POSIX code in all places (or when reasonable test w. configure and provide definitions: ala u_int, etc). Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86 NetBSD current (x86 and amd64) and Solaris 9. Fixes PR's: PR#17762 PR#25944
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/db/btree/bt_conv.c8
-rw-r--r--lib/libc/db/btree/bt_debug.c8
-rw-r--r--lib/libc/db/btree/bt_utils.c8
-rw-r--r--lib/libc/db/hash/hash_bigkey.c8
-rw-r--r--lib/libc/db/hash/hash_buf.c8
-rw-r--r--lib/libc/db/hash/hash_func.c8
-rw-r--r--lib/libc/db/hash/hash_log2.c8
-rw-r--r--lib/libc/db/recno/rec_utils.c8
-rw-r--r--lib/libc/gen/__fts13.c8
-rw-r--r--lib/libc/gen/pwcache.c6
-rw-r--r--lib/libc/stdio/fparseln.c6
-rw-r--r--lib/libc/stdlib/getopt_long.c12
-rw-r--r--lib/libc/string/strmode.c6
13 files changed, 74 insertions, 28 deletions
diff --git a/lib/libc/db/btree/bt_conv.c b/lib/libc/db/btree/bt_conv.c
index 80a5ea3c24a..395e011149c 100644
--- a/lib/libc/db/btree/bt_conv.c
+++ b/lib/libc/db/btree/bt_conv.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bt_conv.c,v 1.10 2003/08/07 16:42:40 agc Exp $ */
+/* $NetBSD: bt_conv.c,v 1.11 2004/06/20 22:20:14 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,12 +32,16 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)bt_conv.c 8.5 (Berkeley) 8/17/94";
#else
-__RCSID("$NetBSD: bt_conv.c,v 1.10 2003/08/07 16:42:40 agc Exp $");
+__RCSID("$NetBSD: bt_conv.c,v 1.11 2004/06/20 22:20:14 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
diff --git a/lib/libc/db/btree/bt_debug.c b/lib/libc/db/btree/bt_debug.c
index f9290cb562c..23b489a4f77 100644
--- a/lib/libc/db/btree/bt_debug.c
+++ b/lib/libc/db/btree/bt_debug.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bt_debug.c,v 1.10 2003/08/07 16:42:40 agc Exp $ */
+/* $NetBSD: bt_debug.c,v 1.11 2004/06/20 22:20:14 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,12 +32,16 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)bt_debug.c 8.5 (Berkeley) 8/17/94";
#else
-__RCSID("$NetBSD: bt_debug.c,v 1.10 2003/08/07 16:42:40 agc Exp $");
+__RCSID("$NetBSD: bt_debug.c,v 1.11 2004/06/20 22:20:14 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
diff --git a/lib/libc/db/btree/bt_utils.c b/lib/libc/db/btree/bt_utils.c
index 53bef9acbd0..0d8ab1f75e3 100644
--- a/lib/libc/db/btree/bt_utils.c
+++ b/lib/libc/db/btree/bt_utils.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bt_utils.c,v 1.9 2003/08/07 16:42:41 agc Exp $ */
+/* $NetBSD: bt_utils.c,v 1.10 2004/06/20 22:20:14 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,12 +32,16 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)bt_utils.c 8.8 (Berkeley) 7/20/94";
#else
-__RCSID("$NetBSD: bt_utils.c,v 1.9 2003/08/07 16:42:41 agc Exp $");
+__RCSID("$NetBSD: bt_utils.c,v 1.10 2004/06/20 22:20:14 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
diff --git a/lib/libc/db/hash/hash_bigkey.c b/lib/libc/db/hash/hash_bigkey.c
index 76f03d2dacf..1dac3c7c41e 100644
--- a/lib/libc/db/hash/hash_bigkey.c
+++ b/lib/libc/db/hash/hash_bigkey.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hash_bigkey.c,v 1.17 2003/08/07 16:42:42 agc Exp $ */
+/* $NetBSD: hash_bigkey.c,v 1.18 2004/06/20 22:20:14 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,12 +32,16 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)hash_bigkey.c 8.3 (Berkeley) 5/31/94";
#else
-__RCSID("$NetBSD: hash_bigkey.c,v 1.17 2003/08/07 16:42:42 agc Exp $");
+__RCSID("$NetBSD: hash_bigkey.c,v 1.18 2004/06/20 22:20:14 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c
index 8d4f054652b..ecad70f634e 100644
--- a/lib/libc/db/hash/hash_buf.c
+++ b/lib/libc/db/hash/hash_buf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hash_buf.c,v 1.10 2003/08/07 16:42:42 agc Exp $ */
+/* $NetBSD: hash_buf.c,v 1.11 2004/06/20 22:20:14 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,12 +32,16 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)hash_buf.c 8.5 (Berkeley) 7/15/94";
#else
-__RCSID("$NetBSD: hash_buf.c,v 1.10 2003/08/07 16:42:42 agc Exp $");
+__RCSID("$NetBSD: hash_buf.c,v 1.11 2004/06/20 22:20:14 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
diff --git a/lib/libc/db/hash/hash_func.c b/lib/libc/db/hash/hash_func.c
index 512c200633d..3ce7653a97c 100644
--- a/lib/libc/db/hash/hash_func.c
+++ b/lib/libc/db/hash/hash_func.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hash_func.c,v 1.9 2003/08/07 16:42:42 agc Exp $ */
+/* $NetBSD: hash_func.c,v 1.10 2004/06/20 22:20:14 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -32,12 +32,16 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)hash_func.c 8.2 (Berkeley) 2/21/94";
#else
-__RCSID("$NetBSD: hash_func.c,v 1.9 2003/08/07 16:42:42 agc Exp $");
+__RCSID("$NetBSD: hash_func.c,v 1.10 2004/06/20 22:20:14 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
diff --git a/lib/libc/db/hash/hash_log2.c b/lib/libc/db/hash/hash_log2.c
index 5d0892cc6ac..8c494f5f45d 100644
--- a/lib/libc/db/hash/hash_log2.c
+++ b/lib/libc/db/hash/hash_log2.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hash_log2.c,v 1.8 2003/08/07 16:42:42 agc Exp $ */
+/* $NetBSD: hash_log2.c,v 1.9 2004/06/20 22:20:14 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -32,12 +32,16 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)hash_log2.c 8.2 (Berkeley) 5/31/94";
#else
-__RCSID("$NetBSD: hash_log2.c,v 1.8 2003/08/07 16:42:42 agc Exp $");
+__RCSID("$NetBSD: hash_log2.c,v 1.9 2004/06/20 22:20:14 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
diff --git a/lib/libc/db/recno/rec_utils.c b/lib/libc/db/recno/rec_utils.c
index a61b2ebf36f..8a7527d2e48 100644
--- a/lib/libc/db/recno/rec_utils.c
+++ b/lib/libc/db/recno/rec_utils.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rec_utils.c,v 1.9 2003/08/07 16:42:44 agc Exp $ */
+/* $NetBSD: rec_utils.c,v 1.10 2004/06/20 22:20:14 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -29,12 +29,16 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)rec_utils.c 8.6 (Berkeley) 7/16/94";
#else
-__RCSID("$NetBSD: rec_utils.c,v 1.9 2003/08/07 16:42:44 agc Exp $");
+__RCSID("$NetBSD: rec_utils.c,v 1.10 2004/06/20 22:20:14 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
diff --git a/lib/libc/gen/__fts13.c b/lib/libc/gen/__fts13.c
index f87d730064f..beb10c0e309 100644
--- a/lib/libc/gen/__fts13.c
+++ b/lib/libc/gen/__fts13.c
@@ -1,4 +1,4 @@
-/* $NetBSD: __fts13.c,v 1.42 2003/10/27 00:12:42 lukem Exp $ */
+/* $NetBSD: __fts13.c,v 1.43 2004/06/20 22:20:14 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -29,12 +29,16 @@
* SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#else
-__RCSID("$NetBSD: __fts13.c,v 1.42 2003/10/27 00:12:42 lukem Exp $");
+__RCSID("$NetBSD: __fts13.c,v 1.43 2004/06/20 22:20:14 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c
index fa707384937..157010a84cc 100644
--- a/lib/libc/gen/pwcache.c
+++ b/lib/libc/gen/pwcache.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pwcache.c,v 1.28 2004/06/18 20:34:58 thorpej Exp $ */
+/* $NetBSD: pwcache.c,v 1.29 2004/06/20 22:20:14 jmc Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -81,7 +81,7 @@
#if 0
static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pwcache.c,v 1.28 2004/06/18 20:34:58 thorpej Exp $");
+__RCSID("$NetBSD: pwcache.c,v 1.29 2004/06/20 22:20:14 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -111,7 +111,7 @@ __weak_alias(pwcache_userdb,_pwcache_userdb)
__weak_alias(pwcache_groupdb,_pwcache_groupdb)
#endif
-#if !HAVE_PWCACHE_USERDB
+#if !HAVE_PWCACHE_USERDB || HAVE_NBTOOL_CONFIG_H
#include "pwcache.h"
/*
diff --git a/lib/libc/stdio/fparseln.c b/lib/libc/stdio/fparseln.c
index 9373d78c34d..af28131e1c2 100644
--- a/lib/libc/stdio/fparseln.c
+++ b/lib/libc/stdio/fparseln.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fparseln.c,v 1.4 2004/05/11 17:31:04 drochner Exp $ */
+/* $NetBSD: fparseln.c,v 1.5 2004/06/20 22:20:15 jmc Exp $ */
/*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fparseln.c,v 1.4 2004/05/11 17:31:04 drochner Exp $");
+__RCSID("$NetBSD: fparseln.c,v 1.5 2004/06/20 22:20:15 jmc Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -56,7 +56,7 @@ __weak_alias(fparseln,_fparseln)
#define FUNLOCKFILE(fp)
#endif
-#ifdef _REENTRANT
+#if defined(_REENTRANT) && !HAVE_NBTOOL_CONFIG_H
#define __fgetln(f, l) __fgetstr(f, l, '\n')
#else
#define __fgetln(f, l) fgetln(f, l)
diff --git a/lib/libc/stdlib/getopt_long.c b/lib/libc/stdlib/getopt_long.c
index 201ec142a80..4956ddc2cb1 100644
--- a/lib/libc/stdlib/getopt_long.c
+++ b/lib/libc/stdlib/getopt_long.c
@@ -1,4 +1,4 @@
-/* $NetBSD: getopt_long.c,v 1.16 2003/10/27 00:12:42 lukem Exp $ */
+/* $NetBSD: getopt_long.c,v 1.17 2004/06/20 22:20:15 jmc Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,9 +36,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getopt_long.c,v 1.16 2003/10/27 00:12:42 lukem Exp $");
+__RCSID("$NetBSD: getopt_long.c,v 1.17 2004/06/20 22:20:15 jmc Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -46,7 +50,11 @@ __RCSID("$NetBSD: getopt_long.c,v 1.16 2003/10/27 00:12:42 lukem Exp $");
#include <assert.h>
#include <err.h>
#include <errno.h>
+#if HAVE_NBTOOL_CONFIG_H
+#include "compat_getopt.h"
+#else
#include <getopt.h>
+#endif
#include <stdlib.h>
#include <string.h>
diff --git a/lib/libc/string/strmode.c b/lib/libc/string/strmode.c
index 1aa7e4be764..9bf1dadfb80 100644
--- a/lib/libc/string/strmode.c
+++ b/lib/libc/string/strmode.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strmode.c,v 1.15 2003/08/07 16:43:51 agc Exp $ */
+/* $NetBSD: strmode.c,v 1.16 2004/06/20 22:20:15 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)strmode.c 8.3 (Berkeley) 8/15/94";
#else
-__RCSID("$NetBSD: strmode.c,v 1.15 2003/08/07 16:43:51 agc Exp $");
+__RCSID("$NetBSD: strmode.c,v 1.16 2004/06/20 22:20:15 jmc Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -80,9 +80,11 @@ strmode(mode, p)
case S_IFLNK: /* symbolic link */
*p++ = 'l';
break;
+#ifdef S_IFSOCK
case S_IFSOCK: /* socket */
*p++ = 's';
break;
+#endif
#ifdef S_IFIFO
case S_IFIFO: /* fifo */
*p++ = 'p';