Support for more Sun compatible dlopen() and friends. Also added proper error

handling.
Reviewed by:    gj
Submitted by:   Mark Diekhans <markd@grizzly.com>
This commit is contained in:
Jordan K. Hubbard 1995-02-07 13:27:29 +00:00
parent efa6e5fa69
commit 38f4fb1525
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6233
2 changed files with 11 additions and 9 deletions

View File

@ -1,9 +1,10 @@
# from: @(#)Makefile 5.6 (Berkeley) 5/22/91
# $Id: Makefile,v 1.10 1994/08/22 15:13:41 bde Exp $
# $Id: Makefile,v 1.12 1994/09/19 02:00:18 ache Exp $
CFLAGS+= -DLIBC_SCCS -DDYNAMIC
OBJS= crt0.o gcrt0.o c++rt0.o
CLEANFILES+= a.out
MAN3+= dlopen.3
all: ${OBJS}

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: crt0.c,v 1.13 1994/09/19 02:00:21 ache Exp $
* $Id: crt0.c,v 1.14 1994/09/24 16:01:30 ache Exp $
*/
@ -47,6 +47,7 @@ extern void _startup_setlocale __P((int, const char *));
#include <sys/types.h>
#include <sys/syscall.h>
#include <a.out.h>
#include <string.h>
#ifndef N_GETMAGIC
#define N_GETMAGIC(x) ((x).a_magic)
#endif
@ -117,7 +118,7 @@ char *__progname = empty;
#endif
#define _FATAL(str) \
write(2, str, sizeof(str)), \
write(2, str, sizeof(str) - 1), \
_exit(1);
@ -303,17 +304,17 @@ char *name;
return (ld_entry->dlsym)(fd, name);
}
int
dlctl(fd, cmd, arg)
void *fd, *arg;
int cmd;
char *
dlerror()
{
if (ld_entry == NULL)
return -1;
return "Service unavailable";
return (ld_entry->dlctl)(fd, cmd, arg);
return (ld_entry->dlerror)();
}
/*
* Support routines
*/