diff options
author | 2012-04-26 01:22:31 +0000 | |
---|---|---|
committer | 2012-04-26 01:22:31 +0000 | |
commit | f264d37a76a66df5ed1577b60dd0ddcee93d28ce (patch) | |
tree | a4459dd35078ead0aa2f6ad3804bea0e34c3fcb2 /lib/libc | |
parent | Skip cache flushes in pmap_zero_page() and pmap_copy_page() on systems (diff) | |
download | wireguard-openbsd-f264d37a76a66df5ed1577b60dd0ddcee93d28ce.tar.xz wireguard-openbsd-f264d37a76a66df5ed1577b60dd0ddcee93d28ce.zip |
Add strnlen() to libkern.
ok deraadt
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/Makefile.inc | 6 | ||||
-rw-r--r-- | lib/libc/string/strnlen.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/libc/Makefile.inc b/lib/libc/Makefile.inc index 69d1c5c330c..98d9599c58e 100644 --- a/lib/libc/Makefile.inc +++ b/lib/libc/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.16 2010/09/24 13:33:00 matthew Exp $ +# $OpenBSD: Makefile.inc,v 1.17 2012/04/26 01:22:31 matthew Exp $ # # This file contains make rules used to build libc # @@ -61,8 +61,8 @@ CFLAGS+=-DNLS LIBKERN= ${LIBCSRCDIR}/../../sys/lib/libkern -KSRCS= bcmp.c bzero.c ffs.c strcat.c strcmp.c strcpy.c strlen.c strncmp.c \ - strncpy.c htonl.c htons.c ntohl.c ntohs.c timingsafe_bcmp.c +KSRCS= bcmp.c bzero.c ffs.c strcat.c strcmp.c strcpy.c strlen.c strncmp.c \ + strncpy.c strnlen.c htonl.c htons.c ntohl.c ntohs.c timingsafe_bcmp.c .if (${MACHINE_CPU} != "alpha") KSRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \ lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \ 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) |