summaryrefslogtreecommitdiff
path: root/dynamic/test.c
blob: 35496fe46ce075a8935001cb3812fe800de9cec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>
#include <dlfcn.h>
#include <unistd.h>

#include <security/pam_appl.h>
#include <security/pam_misc.h>

int main(int argc, char **argv)
{
    void *handle;

    handle = dlopen("./pam.so", RTLD_NOW);
    if (handle == NULL) {
	fprintf(stderr, "failed to load pam.so: %s\n", dlerror());
	exit(1);
    }

    /* handle->XXX points to each of the PAM functions */
    
    
    if (dlclose(handle)) {
	fprintf(stderr, "failed to unload pam.so: %s\n", dlerror());
	exit(1);
    }

    exit(0);
}