libcheck.c
int
check_sharedlibs(char *lib_name) {
    char *loader;
    void *shlib;

    loader = NULL;

    if (check_supportedlibs(lib_name) == 0) {
        loader = strdup(lib_name);
        if (loader == NULL)
            errx(ENOMEM, "malloc error");

        shlib = dlopen(loader, RTLD_LAZY);
        if (!shlib) {
            dlclose(loader);
            free(loader);
            return (1);
        } else
            return (0);
    }

    return (1);
}
/*
 * Check if the library is present in the system trying to open as a shared
 * library.
 */
Check if the library is present in the system trying to open as a shared
library.
Check if the library is present in the system trying to open as a shared library .
int
check_sharedlibs(char *lib_name) {
    char *loader;
    void *shlib;
    loader = NULL;
    if (check_supportedlibs(lib_name) == 0) {
        loader = strdup(lib_name);
        if (loader == NULL)
            errx(ENOMEM, "malloc error");
        shlib = dlopen(loader, RTLD_LAZY);
        if (!shlib) {
            dlclose(loader);
            free(loader);
            return (1);
        } else
            return (0);
    }
    return (1);
}
int check_sharedlibs ( char * lib_name ) { char * loader ; void * shlib ; loader = NULL ; if ( check_supportedlibs ( lib_name ) == 0 ) { loader = strdup ( lib_name ) ; if ( loader == NULL ) errx ( ENOMEM , " " ) ; shlib = dlopen ( loader , RTLD_LAZY ) ; if ( ! shlib ) { dlclose ( loader ) ; free ( loader ) ; return ( 1 ) ; } else return ( 0 ) ; } return ( 1 ) ; }
Check if the library is present in the system trying to open as a shared
 library.
Check if the library is present in the system trying to open as a shared library .