# include # include # include "os.h" //# ifdef SOLARIS # define libcpath "/usr/lib/libc.so" /*# else # define libcpath "/lib/libc.so.5" # endif*/ void *dlget (const char *name) { void *ret; void *handle = (void *) 0; if (!handle) { if (!(handle = dlopen (libcpath, RTLD_LAZY))) { perror ("dlopen:dlopen"); exit (1); } } if (!(ret = (void *) dlsym (handle, name))) { perror ("dlopen:dlsym:"); fprintf(stderr,"Name:%s\n",name); exit (1); } (void) dlclose (handle); handle = (void *) 0; return (ret); }