Skip to contentSkip to conversation

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

PATCH Applied Helge Deller 2 participants 3 messages Apr 24, 2020 – May 27, 2020

lore
Share & tools
lore
#0 lore raw

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

Return target error codes instead of host error codes.

linux-user/syscall.c +2 -2
index 05f03919ff..655a86fa45 100644
@@ -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 on v1 1/1
#1 lore raw

Le 25/04/2020 à 00:00, Helge Deller a écrit :

Quoted 19 lines

Return target error codes instead of host error codes.

linux-user/syscall.c +1 -1
index 05f03919ff..655a86fa45 100644
@@ -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 ||

linux-user/syscall.c static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) · line 5862

Quoted 8 lines
linux-user/syscall.c +1 -1
@@ -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)
#2 lore raw
In reply to Helge Deller

Le 25/04/2020 à 00:00, Helge Deller a écrit :

Quoted 19 lines

Return target error codes instead of host error codes.

linux-user/syscall.c +1 -1
index 05f03919ff..655a86fa45 100644
@@ -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 ||

linux-user/syscall.c static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) · line 5862

Quoted 8 lines
linux-user/syscall.c +1 -1
@@ -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