summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/string/t_strlen.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-01-09 12:07:59 -0200
committerRenato Botelho <renato@netgate.com>2017-01-09 12:07:59 -0200
commitbaeac042059786f1ed0cca7ca4a4a32721362cab (patch)
tree3b848bddaf0f478d0c0651c8ee62129d3d9bacf5 /contrib/netbsd-tests/lib/libc/string/t_strlen.c
parent1af1408e09373ae856cfef567d79849c7e7e0d25 (diff)
parentf91948fdd5322d9aae1e8785976df69612c1999f (diff)
downloadFreeBSD-src-baeac042059786f1ed0cca7ca4a4a32721362cab.zip
FreeBSD-src-baeac042059786f1ed0cca7ca4a4a32721362cab.tar.gz
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/string/t_strlen.c')
-rw-r--r--contrib/netbsd-tests/lib/libc/string/t_strlen.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/string/t_strlen.c b/contrib/netbsd-tests/lib/libc/string/t_strlen.c
index 66158fd..7483dc6 100644
--- a/contrib/netbsd-tests/lib/libc/string/t_strlen.c
+++ b/contrib/netbsd-tests/lib/libc/string/t_strlen.c
@@ -40,6 +40,9 @@ ATF_TC_HEAD(strlen_basic, tc)
ATF_TC_BODY(strlen_basic, tc)
{
+#ifdef __FreeBSD__
+ void *dl_handle;
+#endif
/* try to trick the compiler */
size_t (*strlen_fn)(const char *);
@@ -107,7 +110,12 @@ ATF_TC_BODY(strlen_basic, tc)
* During testing it is useful have the rest of the program
* use a known good version!
*/
+#ifdef __FreeBSD__
+ dl_handle = dlopen(NULL, RTLD_LAZY);
+ strlen_fn = dlsym(dl_handle, "test_strlen");
+#else
strlen_fn = dlsym(dlopen(NULL, RTLD_LAZY), "test_strlen");
+#endif
if (!strlen_fn)
strlen_fn = strlen;
@@ -134,6 +142,9 @@ ATF_TC_BODY(strlen_basic, tc)
}
}
}
+#ifdef __FreeBSD__
+ (void)dlclose(dl_handle);
+#endif
}
ATF_TC(strlen_huge);
OpenPOWER on IntegriCloud