diff mbox series

linux-user: return target error codes for socket() and prctl()

Message ID 20200424220033.GA28140@ls3530.fritz.box (mailing list archive)
State New, archived
Headers show
Series linux-user: return target error codes for socket() and prctl() | expand

Commit Message

Helge Deller April 24, 2020, 10 p.m. UTC
Return target error codes instead of host error codes.

Signed-off-by: Helge Deller <deller@gmx.de>

Comments

Laurent Vivier April 25, 2020, 8:09 a.m. UTC | #1
Le 25/04/2020 à 00:00, Helge Deller a écrit :
> Return target error codes instead of host error codes.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 05f03919ff..655a86fa45 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -2987,7 +2987,7 @@ static abi_long do_socket(int domain, int type, int protocol)
>  #endif
>           protocol == NETLINK_KOBJECT_UEVENT ||
>           protocol == NETLINK_AUDIT)) {
> -        return -EPFNOSUPPORT;
> +        return -TARGET_EPFNOSUPPORT;
>      }
> 
>      if (domain == AF_PACKET ||
> @@ -5856,7 +5856,7 @@ static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr)
> 
>  abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
>  {
> -    return -ENOSYS;
> +    return -TARGET_ENOSYS;
>  }
>  #else
>  abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Laurent Vivier May 27, 2020, 2:32 p.m. UTC | #2
Le 25/04/2020 à 00:00, Helge Deller a écrit :
> Return target error codes instead of host error codes.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 05f03919ff..655a86fa45 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -2987,7 +2987,7 @@ static abi_long do_socket(int domain, int type, int protocol)
>  #endif
>           protocol == NETLINK_KOBJECT_UEVENT ||
>           protocol == NETLINK_AUDIT)) {
> -        return -EPFNOSUPPORT;
> +        return -TARGET_EPFNOSUPPORT;
>      }
> 
>      if (domain == AF_PACKET ||
> @@ -5856,7 +5856,7 @@ static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr)
> 
>  abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
>  {
> -    return -ENOSYS;
> +    return -TARGET_ENOSYS;
>  }
>  #else
>  abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
> 

Applied to my linux-user branch.

Thanks,
Laurent
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 05f03919ff..655a86fa45 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2987,7 +2987,7 @@  static abi_long do_socket(int domain, int type, int protocol)
 #endif
          protocol == NETLINK_KOBJECT_UEVENT ||
          protocol == NETLINK_AUDIT)) {
-        return -EPFNOSUPPORT;
+        return -TARGET_EPFNOSUPPORT;
     }

     if (domain == AF_PACKET ||
@@ -5856,7 +5856,7 @@  static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr)

 abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
 {
-    return -ENOSYS;
+    return -TARGET_ENOSYS;
 }
 #else
 abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)