report user mode gdb exit codes (Paul Brook)
[qemu] / linux-user / syscall.c
index bb609de..0a4f07e 100644 (file)
@@ -264,7 +264,7 @@ void target_set_brk(char *new_brk)
     target_original_brk = new_brk;
 }
 
-static long do_brk(char *new_brk)
+long do_brk(char *new_brk)
 {
     char *brk_page;
     long mapped_addr;
@@ -577,7 +577,9 @@ static long do_setsockopt(int sockfd, int level, int optname,
         case SO_OOBINLINE:
         case SO_NO_CHECK:
         case SO_PRIORITY:
+#ifdef SO_BSDCOMPAT
         case SO_BSDCOMPAT:
+#endif
         case SO_PASSCRED:
         case SO_TIMESTAMP:
         case SO_RCVLOWAT:
@@ -1601,6 +1603,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
 #ifdef HAVE_GPROF
         _mcleanup();
 #endif
+        gdb_exit(cpu_env, arg1);
         /* XXX: should free thread stack and CPU env */
         _exit(arg1);
         ret = 0; /* avoid warning */
@@ -2407,6 +2410,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
 #ifdef __NR_exit_group
         /* new thread calls */
     case TARGET_NR_exit_group:
+        gdb_exit(cpu_env, arg1);
         ret = get_errno(exit_group(arg1));
         break;
 #endif