[will@localhost DynamicLibrary]$ cat dl.test.c
#include <dlfcn.h>
#include <stdio.h>
main ()
{
void *libc;
void (*printf_call) ();
if (libc = dlopen ("/lib/libc.so.6", RTLD_LAZY))
{
printf_call = dlsym (libc, "printf");
(*printf_call) ("hello, world\n");
}
dlclose (libc);
}
[will@localhost DynamicLibrary]$
沒有留言:
張貼留言