summaryrefslogtreecommitdiffstats
path: root/lib/libc/string
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2012-04-26 01:22:31 +0000
committermatthew <matthew@openbsd.org>2012-04-26 01:22:31 +0000
commitf264d37a76a66df5ed1577b60dd0ddcee93d28ce (patch)
treea4459dd35078ead0aa2f6ad3804bea0e34c3fcb2 /lib/libc/string
parentSkip cache flushes in pmap_zero_page() and pmap_copy_page() on systems (diff)
downloadwireguard-openbsd-f264d37a76a66df5ed1577b60dd0ddcee93d28ce.tar.xz
wireguard-openbsd-f264d37a76a66df5ed1577b60dd0ddcee93d28ce.zip
Add strnlen() to libkern.
ok deraadt
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/strnlen.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/string/strnlen.c b/lib/libc/string/strnlen.c
index 2dc7b4fb326..a5e13ae04e2 100644
--- a/lib/libc/string/strnlen.c
+++ b/lib/libc/string/strnlen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strnlen.c,v 1.3 2010/06/02 12:58:12 millert Exp $ */
+/* $OpenBSD: strnlen.c,v 1.4 2012/04/26 01:22:31 matthew Exp $ */
/*
* Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -18,7 +18,11 @@
#include <sys/types.h>
+#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <string.h>
+#else
+#include <lib/libkern/libkern.h>
+#endif
size_t
strnlen(const char *str, size_t maxlen)