s4:torture/smb2: we only support 64KB reads/writes for now
[Samba.git] / testsuite / nsswitch / pam_winbind_syms.c
blob1264bdb23e24b672939a6e660c1ba346c8191442
1 /*
2 * Test required functions are exported from the pam_winbind.so library
3 */
5 #include <stdio.h>
6 #include <dlfcn.h>
8 /* Symbol list to check */
10 static char *symlist[] = {
11 "pam_sm_acct_mgmt",
12 "pam_sm_authenticate",
13 "pam_sm_setcred",
14 NULL
17 /* Main function */
19 int main(int argc, char **argv)
21 void *handle, *sym;
22 int i, y;
24 /* Open library */
26 if (argc != 2) {
27 printf("FAIL: usage '%s sharedlibname'\n", argv[0]);
28 return 1;
31 handle = dlopen(argv[1], RTLD_NOW);
33 if (handle == NULL) {
34 printf("FAIL: could not dlopen library: %s\n", dlerror());
35 return 1;
38 /* Read symbols */
40 for (i = 0; symlist[i] != NULL; i++) {
41 sym = dlsym(handle, symlist[i]);
42 if (sym == NULL) {
43 printf("FAIL: could not resolve symbol '%s': %s\n",
44 symlist[i], dlerror());
45 return 1;
46 } else {
47 printf("loaded symbol '%s' ok\n", symlist[i]);
51 /* Clean up */
53 dlclose(handle);
54 return 0;