summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-12-08 21:04:24 +0000
committerkib <kib@FreeBSD.org>2008-12-08 21:04:24 +0000
commit2e6f1edb43215ac92a1504930980b99efb13ee7b (patch)
treed222119fdf25f6e509a03e165fe282bb307b8a27
parent2491570a9d7a97a5c127953203f037ececfce486 (diff)
downloadFreeBSD-src-2e6f1edb43215ac92a1504930980b99efb13ee7b.zip
FreeBSD-src-2e6f1edb43215ac92a1504930980b99efb13ee7b.tar.gz
Add strndup(3) prototype to string.h.
This change was erronously ommitted from the r185690, and attempt to simply add the prototype to string.h has revealed that several contributed programs defined local prototypes for strndup(), controlled by autoconfed config.h. So, manually change #undef HAVE_STRNDUP to #define HAVE_STRNDUP 1. Next import of the corresponding program would regenerate config.h, overriding the changes in this commit. No objections from: kan
-rw-r--r--gnu/usr.bin/cc/libiberty/config.h2
-rw-r--r--gnu/usr.bin/sort/config.h2
-rw-r--r--include/string.h1
-rw-r--r--kerberos5/include/config.h2
-rw-r--r--lib/bind/bind/port_after.h2
-rw-r--r--lib/libmagic/config.h2
-rw-r--r--usr.bin/file/config.h2
7 files changed, 7 insertions, 6 deletions
diff --git a/gnu/usr.bin/cc/libiberty/config.h b/gnu/usr.bin/cc/libiberty/config.h
index 0fc8ed6..236e076 100644
--- a/gnu/usr.bin/cc/libiberty/config.h
+++ b/gnu/usr.bin/cc/libiberty/config.h
@@ -235,7 +235,7 @@
#define HAVE_STRNCASECMP 1
/* Define to 1 if you have the `strndup' function. */
-/* #undef HAVE_STRNDUP */
+#define HAVE_STRNDUP 1
/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1
diff --git a/gnu/usr.bin/sort/config.h b/gnu/usr.bin/sort/config.h
index 44f944c..601b368 100644
--- a/gnu/usr.bin/sort/config.h
+++ b/gnu/usr.bin/sort/config.h
@@ -759,7 +759,7 @@
#define HAVE_STRNCASECMP 1
/* Define to 1 if you have the `strndup' function. */
-/* #undef HAVE_STRNDUP */
+#define HAVE_STRNDUP 1
/* Define to 1 if you have the `strpbrk' function. */
#define HAVE_STRPBRK 1
diff --git a/include/string.h b/include/string.h
index 1b6e184..32a9ad3 100644
--- a/include/string.h
+++ b/include/string.h
@@ -96,6 +96,7 @@ char *strncat(char * __restrict, const char * __restrict, size_t);
int strncmp(const char *, const char *, size_t) __pure;
char *strncpy(char * __restrict, const char * __restrict, size_t);
#if __BSD_VISIBLE
+char *strndup(const char *, size_t);
char *strnstr(const char *, const char *, size_t) __pure;
#endif
char *strpbrk(const char *, const char *) __pure;
diff --git a/kerberos5/include/config.h b/kerberos5/include/config.h
index 4484060..f4b6d1e 100644
--- a/kerberos5/include/config.h
+++ b/kerberos5/include/config.h
@@ -785,7 +785,7 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg }
#define HAVE_STRNCASECMP 1
/* Define if you have the function `strndup'. */
-/* #undef HAVE_STRNDUP */
+#define HAVE_STRNDUP 1
/* Define if you have the function `strnlen'. */
/* #undef HAVE_STRNLEN */
diff --git a/lib/bind/bind/port_after.h b/lib/bind/bind/port_after.h
index 38335d6..f0b7f82 100644
--- a/lib/bind/bind/port_after.h
+++ b/lib/bind/bind/port_after.h
@@ -30,7 +30,7 @@
#undef HAS_IN_ADDR6
#define HAVE_SOCKADDR_STORAGE 1
#undef NEED_GETTIMEOFDAY
-#undef HAVE_STRNDUP
+#define HAVE_STRNDUP 1
#undef USE_FIONBIO_IOCTL
#undef USE_SYSERROR_LIST
#undef INNETGR_ARGS
diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h
index 65e4a6a..4f8a99f 100644
--- a/lib/libmagic/config.h
+++ b/lib/libmagic/config.h
@@ -77,7 +77,7 @@
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strndup' function. */
-/* #undef HAVE_STRNDUP */
+#define HAVE_STRNDUP 1
/* Define to 1 if you have the `strtof' function. */
#define HAVE_STRTOF 1
diff --git a/usr.bin/file/config.h b/usr.bin/file/config.h
index 65e4a6a..4f8a99f 100644
--- a/usr.bin/file/config.h
+++ b/usr.bin/file/config.h
@@ -77,7 +77,7 @@
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strndup' function. */
-/* #undef HAVE_STRNDUP */
+#define HAVE_STRNDUP 1
/* Define to 1 if you have the `strtof' function. */
#define HAVE_STRTOF 1
OpenPOWER on IntegriCloud