svr4_sysvec.c (99669) | svr4_sysvec.c (100384) |
---|---|
1/* 2 * Copyright (c) 1998 Mark Newton 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * | 1/* 2 * Copyright (c) 1998 Mark Newton 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * |
30 * $FreeBSD: head/sys/compat/svr4/svr4_sysvec.c 99669 2002-07-09 14:59:27Z robert $ | 30 * $FreeBSD: head/sys/compat/svr4/svr4_sysvec.c 100384 2002-07-20 02:56:12Z peter $ |
31 */ 32 33/* XXX we use functions that might not exist. */ 34#include "opt_compat.h" 35 36#ifndef COMPAT_43 37#error "Unable to compile SVR4-emulator due to missing COMPAT_43 option!" 38#endif --- 135 unchanged lines hidden (view full) --- 174 bsd_to_svr4_errno, 175 0, 176 svr4_fixup, 177 svr4_sendsig, 178 svr4_sigcode, 179 &svr4_szsigcode, 180 NULL, 181 "SVR4", | 31 */ 32 33/* XXX we use functions that might not exist. */ 34#include "opt_compat.h" 35 36#ifndef COMPAT_43 37#error "Unable to compile SVR4-emulator due to missing COMPAT_43 option!" 38#endif --- 135 unchanged lines hidden (view full) --- 174 bsd_to_svr4_errno, 175 0, 176 svr4_fixup, 177 svr4_sendsig, 178 svr4_sigcode, 179 &svr4_szsigcode, 180 NULL, 181 "SVR4", |
182 elf_coredump, | 182 elf32_coredump, |
183 NULL, 184 SVR4_MINSIGSTKSZ 185}; 186 187Elf32_Brandinfo svr4_brand = { 188 ELFOSABI_SYSV, | 183 NULL, 184 SVR4_MINSIGSTKSZ 185}; 186 187Elf32_Brandinfo svr4_brand = { 188 ELFOSABI_SYSV, |
189 EM_386, /* XXX only implemented for x86 so far. */ |
|
189 "SVR4", 190 svr4_emul_path, 191 "/lib/libc.so.1", 192 &svr4_sysvec 193}; 194 195const char svr4_emul_path[] = "/compat/svr4"; 196 --- 174 unchanged lines hidden (view full) --- 371svr4_elf_modevent(module_t mod, int type, void *data) 372{ 373 int error; 374 375 error = 0; 376 377 switch(type) { 378 case MOD_LOAD: | 190 "SVR4", 191 svr4_emul_path, 192 "/lib/libc.so.1", 193 &svr4_sysvec 194}; 195 196const char svr4_emul_path[] = "/compat/svr4"; 197 --- 174 unchanged lines hidden (view full) --- 372svr4_elf_modevent(module_t mod, int type, void *data) 373{ 374 int error; 375 376 error = 0; 377 378 switch(type) { 379 case MOD_LOAD: |
379 if (elf_insert_brand_entry(&svr4_brand) < 0) | 380 if (elf32_insert_brand_entry(&svr4_brand) < 0) |
380 error = EINVAL; 381 if (error) 382 printf("cannot insert svr4 elf brand handler\n"); 383 else if (bootverbose) 384 printf("svr4 ELF exec handler installed\n"); 385 break; 386 case MOD_UNLOAD: 387 /* Only allow the emulator to be removed if it isn't in use. */ | 381 error = EINVAL; 382 if (error) 383 printf("cannot insert svr4 elf brand handler\n"); 384 else if (bootverbose) 385 printf("svr4 ELF exec handler installed\n"); 386 break; 387 case MOD_UNLOAD: 388 /* Only allow the emulator to be removed if it isn't in use. */ |
388 if (elf_brand_inuse(&svr4_brand) != 0) { | 389 if (elf32_brand_inuse(&svr4_brand) != 0) { |
389 error = EBUSY; | 390 error = EBUSY; |
390 } else if (elf_remove_brand_entry(&svr4_brand) < 0) { | 391 } else if (elf32_remove_brand_entry(&svr4_brand) < 0) { |
391 error = EINVAL; 392 } 393 394 if (error) 395 printf("Could not deinstall ELF interpreter entry (error %d)\n", 396 error); 397 else if (bootverbose) 398 printf("svr4 ELF exec handler removed\n"); --- 14 unchanged lines hidden --- | 392 error = EINVAL; 393 } 394 395 if (error) 396 printf("Could not deinstall ELF interpreter entry (error %d)\n", 397 error); 398 else if (bootverbose) 399 printf("svr4 ELF exec handler removed\n"); --- 14 unchanged lines hidden --- |