Commit a2f86d8e08b530679bdcf8662c51e21c2e9ad46e

Authored by balrog
1 parent 44696296

Use the host exit syscall for exiting (Lauro Ramos Venancio).

We can't call the libc _exit function because it calls the exit_group
host syscall. We must call directly the exit host syscall.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5561 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 1 deletions
linux-user/syscall.c
@@ -152,6 +152,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ @@ -152,6 +152,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \
152 } 152 }
153 153
154 154
  155 +#define __NR_sys_exit __NR_exit
155 #define __NR_sys_uname __NR_uname 156 #define __NR_sys_uname __NR_uname
156 #define __NR_sys_faccessat __NR_faccessat 157 #define __NR_sys_faccessat __NR_faccessat
157 #define __NR_sys_fchmodat __NR_fchmodat 158 #define __NR_sys_fchmodat __NR_fchmodat
@@ -193,6 +194,7 @@ static int gettid(void) { @@ -193,6 +194,7 @@ static int gettid(void) {
193 return -ENOSYS; 194 return -ENOSYS;
194 } 195 }
195 #endif 196 #endif
  197 +_syscall1(int,sys_exit,int,status)
196 _syscall1(int,sys_uname,struct new_utsname *,buf) 198 _syscall1(int,sys_uname,struct new_utsname *,buf)
197 #if defined(TARGET_NR_faccessat) && defined(__NR_faccessat) 199 #if defined(TARGET_NR_faccessat) && defined(__NR_faccessat)
198 _syscall4(int,sys_faccessat,int,dirfd,const char *,pathname,int,mode,int,flags) 200 _syscall4(int,sys_faccessat,int,dirfd,const char *,pathname,int,mode,int,flags)
@@ -3395,7 +3397,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, @@ -3395,7 +3397,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
3395 #endif 3397 #endif
3396 gdb_exit(cpu_env, arg1); 3398 gdb_exit(cpu_env, arg1);
3397 /* XXX: should free thread stack and CPU env */ 3399 /* XXX: should free thread stack and CPU env */
3398 - _exit(arg1); 3400 + sys_exit(arg1);
3399 ret = 0; /* avoid warning */ 3401 ret = 0; /* avoid warning */
3400 break; 3402 break;
3401 case TARGET_NR_read: 3403 case TARGET_NR_read: