Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!brunix!rcb From: rcb@cs.brown.edu (Robert Boyer) Newsgroups: comp.os.mach Subject: Need help with load interface Message-ID: <54925@brunix.UUCP> Date: 31 Oct 90 03:13:57 GMT Sender: news@brunix.UUCP Reply-To: rcb@cs.brown.edu (Robert Boyer) Organization: Brown University Department of Computer Science Lines: 42 I'm having some trouble getting the programmable loader interface working on our pmax OSF/1 (snapshot 5) system. No matter what I try, the "load" system call always returns with 0 and EINVAL in errno. As far as I can tell, I am following almost exactly the example in section 3.3.1 of the "OSF/1 Applications Programmer's Guide - SNAPSHOT 5". here is the code fragment that fails: int load_it() { ldr_module_t hdl; ldr_load_flags_t flags=0; void (*p)(); if ( (hdl = load( "./foo",flags)) <= 0 ) { perror("load error"); return -1; } else { p = ldr_lookup(hdl, "foobar" ); (*p)(); return 0; } } "./foo" was compiled with -mpic as follows: cc -mpic -c foo.c as: Flag option -G has already been seen! ld -warn_nopic -o foo foo.o The module foo.c is: foobar() { return 1; } Any help would be greatly appreciated.