Changeset 1476

Show
Ignore:
Timestamp:
12/02/07 22:44:27 (9 months ago)
Author:
common
Message:

libemu

  • linux env, add exit(), reorder fork
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libemu/trunk/include/emu/environment/linux/env_linux_syscall_hooks.h

    r1469 r1476  
    2525 * 
    2626 *******************************************************************************/ 
     27 
     28/* 1 exit */ 
     29int32_t env_linux_hook_exit(struct emu_env_linux *env, struct emu_env_linux_syscall *syscall); 
    2730 
    2831/* 2 fork */ 
  • libemu/trunk/include/emu/environment/linux/env_linux_syscalls.h

    r1469 r1476  
    251251        { "dup2"                                , env_linux_hook_dup2}, 
    252252        { "execve"                              , env_linux_hook_execve}, 
    253         { "exit"                                , NULL}, 
     253        { "exit"                                , env_linux_hook_exit}, 
    254254        { "fchdir"                              , NULL}, 
    255255        { "fchmod"                              , NULL}, 
  • libemu/trunk/src/environment/linux/env_linux_syscall_hooks.c

    r1469 r1476  
    4040 
    4141#include "emu/environment/linux/emu_env_linux.h" 
     42 
     43int32_t env_linux_hook_exit(struct emu_env_linux *env, struct emu_env_linux_syscall *syscall) 
     44{ 
     45        printf("sys_exit(2)\n"); 
     46        struct emu_cpu *c = emu_cpu_get(env->emu); 
     47        emu_cpu_reg32_set(c, eax, 0); 
     48        return 0; 
     49} 
     50 
     51int32_t env_linux_hook_fork(struct emu_env_linux *env, struct emu_env_linux_syscall *syscall) 
     52{ 
     53        printf("sys_fork(2)\n"); 
     54        struct emu_cpu *c = emu_cpu_get(env->emu); 
     55        emu_cpu_reg32_set(c, eax, 4711); 
     56        return 0; 
     57} 
    4258 
    4359int32_t env_linux_hook_execve(struct emu_env_linux *env, struct emu_env_linux_syscall *syscall) 
     
    186202} 
    187203 
    188 int32_t env_linux_hook_fork(struct emu_env_linux *env, struct emu_env_linux_syscall *syscall) 
    189 
    190         printf("sys_fork(2)\n"); 
    191         struct emu_cpu *c = emu_cpu_get(env->emu); 
    192         emu_cpu_reg32_set(c, eax, 4711); 
    193         return 0; 
    194 
     204