summaryrefslogtreecommitdiffstats
path: root/lib/csu
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-02-07 13:27:29 +0000
committerjkh <jkh@FreeBSD.org>1995-02-07 13:27:29 +0000
commitdcc217c4ac70cb9d56b6c2c8c16d0153da9746e3 (patch)
tree1a033a5adefeaef27ee04189bb869edb37eacaea /lib/csu
parent2bc5b1e7005d25be2e8653dc7a75626b9454a31f (diff)
downloadFreeBSD-src-dcc217c4ac70cb9d56b6c2c8c16d0153da9746e3.zip
FreeBSD-src-dcc217c4ac70cb9d56b6c2c8c16d0153da9746e3.tar.gz
Support for more Sun compatible dlopen() and friends. Also added proper error
handling. Reviewed by: gj Submitted by: Mark Diekhans <markd@grizzly.com>
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/i386/Makefile3
-rw-r--r--lib/csu/i386/crt0.c17
2 files changed, 11 insertions, 9 deletions
diff --git a/lib/csu/i386/Makefile b/lib/csu/i386/Makefile
index 9b860b2..dfdbc38 100644
--- a/lib/csu/i386/Makefile
+++ b/lib/csu/i386/Makefile
@@ -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}
diff --git a/lib/csu/i386/crt0.c b/lib/csu/i386/crt0.c
index f0ed885..26592ba 100644
--- a/lib/csu/i386/crt0.c
+++ b/lib/csu/i386/crt0.c
@@ -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
*/
OpenPOWER on IntegriCloud