func TestDlOpenLibc(t *testing.T) { lib, err := dl.Open(libc_name, dl.Now) if err != nil { t.Errorf("%v", err) } err = lib.Close() if err != nil { t.Errorf("%v", err) } }
func TestDlSymLibm(t *testing.T) { lib, err := dl.Open(libm_name, dl.Now) if err != nil { t.Errorf("%v", err) } _, err = lib.Symbol("fabs") if err != nil { t.Errorf("%v", err) } err = lib.Close() if err != nil { t.Errorf("%v", err) } }
// NewLibrary takes the library filename and returns a handle towards it. func NewLibrary(libname string) (lib Library, err error) { //libname = get_lib_arch_name(libname) lib.handle, err = dl.Open(libname, dl.Now) return }