12#if (!defined(NO_DLFCN) && !defined(_BGL) && !defined(_BGP))
24 test_fail(__FILE__, __LINE__,
"PAPI_get_shared_lib_info", 1);
28 printf(
"Library: %s\n", map->
name );
29 printf(
"Text start: %p, Text end: %p\n", map->
text_start,
31 printf(
"Data start: %p, Data end: %p\n", map->
data_start,
35 if ( strlen( &(map->
name[0]) ) == 0 )
36 test_fail( __FILE__, __LINE__,
"PAPI_get_shared_lib_info", 1 );
39 test_fail( __FILE__, __LINE__,
"PAPI_get_shared_lib_info", 1 );
59 printf(
"%1d", (msg[
i] ? 1 : 0) );
65main(
int argc,
char **argv )
80 test_skip( __FILE__, __LINE__,
"PAPI_get_shared_lib_info", 1 );
83 if ( ( shinfo->
count == 0 ) && ( shinfo->
map ) ) {
84 test_fail( __FILE__, __LINE__,
"PAPI_get_shared_lib_info", 1 );
96 const char *_libname =
"libcrypt.so";
98 void ( *setkey) (
const char *
key);
99 void ( *encrypt) (
char block[64],
int edflag);
101 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
102 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
103 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
104 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
111 handle = dlopen( _libname, RTLD_NOW );
113 printf(
"dlopen: %s\n", dlerror( ) );
114 if (!
quiet) printf(
"Did you forget to set the environmental "
115 "variable LIBPATH (in AIX) or "
116 "LD_LIBRARY_PATH (in linux) ?\n" );
117 test_fail( __FILE__, __LINE__,
"dlopen", 1 );
120 setkey = dlsym(
handle,
"setkey" );
121 encrypt = dlsym(
handle,
"encrypt" );
122 if ( setkey == NULL || encrypt == NULL) {
123 if (!
quiet) printf(
"dlsym: %s\n", dlerror( ) );
124 test_fail( __FILE__, __LINE__,
"dlsym", 1 );
139 printf(
"encrypted ");
143 if (!memcmp(txt,orig,64)) {
144 test_fail( __FILE__, __LINE__,
"encode", 1 );
150 printf(
"decrypted ");
154 if (memcmp(txt,orig,64)) {
155 test_fail( __FILE__, __LINE__,
"decode", 1 );
158 oldcount = shinfo->
count;
161 test_fail( __FILE__, __LINE__,
"PAPI_get_shared_lib_info", 1 );
168 if ( ( shinfo->
count == 0 ) && ( shinfo->
map ) ) {
169 test_fail( __FILE__, __LINE__,
"PAPI_get_shared_lib_info", 1 );
172 if ( shinfo->
count <= oldcount ) {
173 test_fail( __FILE__, __LINE__,
"PAPI_get_shared_lib_info", 1 );
static papi_handle_t handle
Get address info about the shared libraries used by the process.
initialize the PAPI library.
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
void print_shlib_info_map(const PAPI_shlib_info_t *shinfo, int quiet)
get the executable's address space info
char name[PAPI_HUGE_STR_LEN]