Skip to contentSkip to conversation

linux-user: add comments for TARGET_NR_[gs]etgroups{,32}

PATCH New Michael Tokarev 1 participant 1 message Jun 3, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: add comments for TARGET_NR_[gs]etgroups{,32}

There are 2 paits of identical code (with different types) for TARGET_NR_setgroups and TARGET_NR_setgroups32, and for TARGET_NR_getgroups and TARGET_NR_getgroups32. Add comments stating this fact, so that further modifications are done in two places.

---
Please excuse me for double send, - I mistyped the qemu-devel@ address.

 linux-user/syscall.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
linux-user/syscall.c +4 -4
index 333e6b7026..a88493d51c 100644
@@ -11472,7 +11472,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
     case TARGET_NR_setregid:
         return get_errno(setregid(low2highgid(arg1), low2highgid(arg2)));
     case TARGET_NR_getgroups:
-        {
+        { /* the same code as for TARGET_NR_getgroups32 */
             int gidsetsize = arg1;
             target_id *target_grouplist;
             g_autofree gid_t *grouplist = NULL;
@@ -11503,7 +11503,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
             return ret;
         }
     case TARGET_NR_setgroups:
-        {
+        { /* the same code as for TARGET_NR_setgroups32 */
             int gidsetsize = arg1;
             target_id *target_grouplist;
             g_autofree gid_t *grouplist = NULL;
@@ -11808,7 +11808,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_getgroups32
     case TARGET_NR_getgroups32:
-        {
+        { /* the same code as for TARGET_NR_getgroups */
             int gidsetsize = arg1;
             uint32_t *target_grouplist;
             g_autofree gid_t *grouplist = NULL;
@@ -11840,7 +11840,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_setgroups32
     case TARGET_NR_setgroups32:
-        {
+        { /* the same code as for TARGET_NR_setgroups */
             int gidsetsize = arg1;
             uint32_t *target_grouplist;
             g_autofree gid_t *grouplist = NULL;
Signature · 1 line
2.39.2