diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-10-24 20:28:32 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-23 12:15:05 -0800 |
commit | acde97a39d35bfb03af2614c68176ad9afb71f53 (patch) | |
tree | 4be7a9b6e868020d725765df425882df1cd1c6a3 /include/os.h | |
parent | ed38c2648cf7cc04c1d03f8d14375815f6cf536e (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/os.h')
-rw-r--r-- | include/os.h | 4 |
1 files changed, 4 insertions, 0 deletions
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, |