Exemple #1
0
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)
	}
}
Exemple #2
0
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)
	}
}
Exemple #3
0
// 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
}