2 Copyright (C) Nalin Dahyabhai <nalin@redhat.com> 2003
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
19 /* Simple program to see if dlopen() would succeed. */
20 int main(int argc, char **argv)
29 for (i = 1; i < argc; i++) {
30 if (dlopen(argv[i], RTLD_NOW)) {
31 fprintf(stdout, "dlopen() of \"%s\" succeeded.\n",
34 snprintf(buf, sizeof(buf), "./%s", argv[i]);
35 if ((stat(buf, &st) == 0) && dlopen(buf, RTLD_NOW)) {
36 fprintf(stdout, "dlopen() of \"./%s\" "
37 "succeeded.\n", argv[i]);
39 fprintf(stdout, "dlopen() of \"%s\" failed: "
40 "%s\n", argv[i], dlerror());