summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-10-24 20:28:32 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-23 12:15:05 -0800
commitacde97a39d35bfb03af2614c68176ad9afb71f53 (patch)
tree4be7a9b6e868020d725765df425882df1cd1c6a3 /include
parented38c2648cf7cc04c1d03f8d14375815f6cf536e (diff)
Add fallback implementation of strndup()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Linux test code fixed by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'include')
-rw-r--r--include/dix-config.h.in3
-rw-r--r--include/os.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 7d6cb966c..e1d3a9eaa 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -190,6 +190,9 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
+
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
diff --git a/include/os.h b/include/os.h
index 823fe5d29..df3580521 100644
--- a/include/os.h
+++ b/include/os.h
@@ -492,6 +492,10 @@ extern _X_EXPORT size_t strlcpy(char *dst, const char *src, size_t siz);
extern _X_EXPORT size_t strlcat(char *dst, const char *src, size_t siz);
#endif
+#ifndef HAVE_STRNDUP
+extern _X_EXPORT char * strndup(const char *str, size_t n);
+#endif
+
/* Logging. */
typedef enum _LogParameter {
XLOG_FLUSH,