Deleted Added
full compact
imgact_linux.c (12130) imgact_linux.c (12458)
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Based heavily on /sys/kern/imgact_aout.c which is:
6 * Copyright (c) 1993, David Greenman
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Based heavily on /sys/kern/imgact_aout.c which is:
6 * Copyright (c) 1993, David Greenman
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * $Id: imgact_linux.c,v 1.2 1995/08/24 10:32:27 davidg Exp $
31 * $Id: imgact_linux.c,v 1.3 1995/11/06 12:52:23 davidg Exp $
32 */
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/resourcevar.h>
37#include <sys/exec.h>
38#include <sys/mman.h>
39#include <sys/imgact.h>
40#include <sys/imgact_aout.h>
41#include <sys/kernel.h>
42#include <sys/sysent.h>
43
44#include <vm/vm.h>
45#include <vm/vm_kern.h>
46
32 */
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/resourcevar.h>
37#include <sys/exec.h>
38#include <sys/mman.h>
39#include <sys/imgact.h>
40#include <sys/imgact_aout.h>
41#include <sys/kernel.h>
42#include <sys/sysent.h>
43
44#include <vm/vm.h>
45#include <vm/vm_kern.h>
46
47#include <i386/linux/sysproto.h>
48
49extern int exec_linux_imgact __P((struct image_params *iparams));
50
47int
48exec_linux_imgact(imgp)
49 struct image_params *imgp;
50{
51 struct exec *a_out = (struct exec *) imgp->image_header;
52 struct vmspace *vmspace = imgp->proc->p_vmspace;
53 unsigned long vmaddr, virtual_offset, file_offset;
54 unsigned long buffer, bss_size;
55 int error;
51int
52exec_linux_imgact(imgp)
53 struct image_params *imgp;
54{
55 struct exec *a_out = (struct exec *) imgp->image_header;
56 struct vmspace *vmspace = imgp->proc->p_vmspace;
57 unsigned long vmaddr, virtual_offset, file_offset;
58 unsigned long buffer, bss_size;
59 int error;
56 extern struct sysentvec linux_sysvec;
57
58 if (((a_out->a_magic >> 16) & 0xff) != 0x64)
59 return -1;
60
61 /*
62 * Set file/virtual offset based on a.out variant.
63 */
64 switch ((int)(a_out->a_magic & 0xffff)) {

--- 173 unchanged lines hidden ---
60
61 if (((a_out->a_magic >> 16) & 0xff) != 0x64)
62 return -1;
63
64 /*
65 * Set file/virtual offset based on a.out variant.
66 */
67 switch ((int)(a_out->a_magic & 0xffff)) {

--- 173 unchanged lines hidden ---