Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jun 1999 22:07:55 +0200
From:      Marcel Moolenaar <marcel@scc.nl>
To:        emulation@FreeBSD.ORG
Subject:   Re: Bug in linux fcntl syscall? (DUH)
Message-ID:  <3762BE1B.24EE2D48@scc.nl>
References:  <199906120956.LAA13361@freebsd.dk>, <37627BEA.9687CA5@scc.nl>

next in thread | previous in thread | raw e-mail | index | archive | help

This is a multi-part message in MIME format.
--------------B1CA2654AC2CA165CC62B905
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Marcel Moolenaar wrote:

[see previous post]

Here's the patchfile corresponding to (A)

-- 
Marcel Moolenaar                                  mailto:marcel@scc.nl
SCC Internetworking & Databases                     http://www.scc.nl/
Amsterdam, The Netherlands                         tel: +31 20 4200655
--------------B1CA2654AC2CA165CC62B905
Content-Type: text/plain; charset=us-ascii;
 name="linux.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="linux.patch"

--- ./sys/i386/linux/linux_misc.c.orig	Sat Jun 12 12:55:46 1999
+++ ./sys/i386/linux/linux_misc.c	Sat Jun 12 13:08:02 1999
@@ -868,11 +868,11 @@
     printf("Linux-emul(%d): newuname(*)\n", p->p_pid);
 #endif
     bzero(&linux_newuname, sizeof(struct linux_newuname_t));
-    strncpy(linux_newuname.sysname, ostype,
+    strncpy(linux_newuname.sysname, "Linux",
 	sizeof(linux_newuname.sysname) - 1);
     strncpy(linux_newuname.nodename, hostname,
 	sizeof(linux_newuname.nodename) - 1);
-    strncpy(linux_newuname.release, osrelease,
+    strncpy(linux_newuname.release, "2.0.36",
 	sizeof(linux_newuname.release) - 1);
     strncpy(linux_newuname.version, version,
 	sizeof(linux_newuname.version) - 1);
--- ./sys/kern/imgact_elf.c.orig	Sat Jun 12 12:55:51 1999
+++ ./sys/kern/imgact_elf.c	Sat Jun 12 13:12:10 1999
@@ -436,7 +436,8 @@
 	/*
 	 * Do we have a valid ELF header ?
 	 */
-	if (elf_check_header(hdr) != 0 || hdr->e_type != ET_EXEC)
+	if (elf_check_header(hdr) != 0 ||
+	    (hdr->e_type != ET_EXEC && hdr->e_type != ET_REL))
 		return -1;
 
 	/*
@@ -584,12 +585,15 @@
 
 	imgp->proc->p_sysent = brand_info->sysvec;
 	if (interp != NULL) {
-		snprintf(path, sizeof(path), "%s%s",
-		    brand_info->emul_path, interp);
+	        snprintf(path, sizeof(path), "%s%s",
+			 brand_info->emul_path, interp);
                 if ((error = elf_load_file(imgp->proc, path, &addr,
-		    &imgp->entry_addr)) != 0) {
-                        uprintf("ELF interpreter %s not found\n", path);
-                        goto fail;
+					   &imgp->entry_addr)) != 0) {
+		      if ((error = elf_load_file(imgp->proc, interp, &addr,
+						 &imgp->entry_addr)) != 0) {
+                            uprintf("ELF interpreter %s not found\n", path);
+			    goto fail;
+                      }
                 }
 	}
 

--------------B1CA2654AC2CA165CC62B905--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3762BE1B.24EE2D48>