1272343Sngie/*-
2272343Sngie * Copyright (c) 2010 The NetBSD Foundation, Inc.
3272343Sngie * All rights reserved.
4272343Sngie *
5272343Sngie * This code is derived from software contributed to The NetBSD Foundation
6272343Sngie * by Nick Hudson.
7272343Sngie *
8272343Sngie * Redistribution and use in source and binary forms, with or without
9272343Sngie * modification, are permitted provided that the following conditions
10272343Sngie * are met:
11272343Sngie * 1. Redistributions of source code must retain the above copyright
12272343Sngie *    notice, this list of conditions and the following disclaimer.
13272343Sngie * 2. Redistributions in binary form must reproduce the above copyright
14272343Sngie *    notice, this list of conditions and the following disclaimer in the
15272343Sngie *    documentation and/or other materials provided with the distribution.
16272343Sngie *
17272343Sngie * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18272343Sngie * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19272343Sngie * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20272343Sngie * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21272343Sngie * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22272343Sngie * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23272343Sngie * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24272343Sngie * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25272343Sngie * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26272343Sngie * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27272343Sngie * POSSIBILITY OF SUCH DAMAGE.
28272343Sngie */
29272343Sngie
30272343Sngie#include <stdio.h>
31272343Sngie#include <dlfcn.h>
32272343Sngie#include <err.h>
33272343Sngie#include <unistd.h>
34272343Sngie
35272343Sngieint
36272343Sngiemain(void)
37272343Sngie{
38272343Sngie	void *handle;
39272343Sngie
40272343Sngie	handle = dlopen("libpthread.so", RTLD_NOLOAD);
41272343Sngie	if (handle == NULL)
42272343Sngie		errx(1, "%s", dlerror());
43272343Sngie
44272343Sngie	printf("libpthread loaded successfully\n");
45272343Sngie	return 0;
46272343Sngie}
47