h_df_1_noopen.c revision 1.3
11.1Sskrll/*- 21.1Sskrll * Copyright (c) 2010 The NetBSD Foundation, Inc. 31.1Sskrll * All rights reserved. 41.1Sskrll * 51.1Sskrll * This code is derived from software contributed to The NetBSD Foundation 61.2Sskrll * by Nick Hudson. 71.1Sskrll * 81.1Sskrll * Redistribution and use in source and binary forms, with or without 91.1Sskrll * modification, are permitted provided that the following conditions 101.1Sskrll * are met: 111.1Sskrll * 1. Redistributions of source code must retain the above copyright 121.1Sskrll * notice, this list of conditions and the following disclaimer. 131.1Sskrll * 2. Redistributions in binary form must reproduce the above copyright 141.1Sskrll * notice, this list of conditions and the following disclaimer in the 151.1Sskrll * documentation and/or other materials provided with the distribution. 161.1Sskrll * 171.1Sskrll * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 181.1Sskrll * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 191.1Sskrll * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 201.1Sskrll * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 211.1Sskrll * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 221.1Sskrll * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 231.1Sskrll * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 241.1Sskrll * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 251.1Sskrll * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 261.1Sskrll * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 271.1Sskrll * POSSIBILITY OF SUCH DAMAGE. 281.1Sskrll */ 291.1Sskrll 301.1Sskrll#include <stdio.h> 311.1Sskrll#include <dlfcn.h> 321.1Sskrll#include <err.h> 331.1Sskrll#include <unistd.h> 341.1Sskrll 351.1Sskrllint 361.1Sskrllmain(void) 371.1Sskrll{ 381.1Sskrll void *handle; 391.1Sskrll 401.1Sskrll handle = dlopen("libpthread.so", RTLD_NOLOAD); 411.1Sskrll if (handle == NULL) 421.3Sjoerg errx(1, "%s", dlerror()); 431.1Sskrll 441.1Sskrll printf("libpthread loaded successfully\n"); 451.1Sskrll return 0; 461.1Sskrll} 47