diff mbox

[PULL,04/14] linux-user: Add support for SCM_CREDENTIALS.

Message ID 4bc2975698773afdca2f79ebcff9f3b588f646fc.1399057853.git.riku.voipio@linaro.org
State Accepted
Commit 4bc2975698773afdca2f79ebcff9f3b588f646fc
Headers show

Commit Message

Riku Voipio May 2, 2014, 7:15 p.m. UTC
From: Huw Davies <huw@codeweavers.com>

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/syscall.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 52bd000..27073b1 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1269,6 +1269,17 @@  static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh,
                 target_tv->tv_usec = tswapal(tv->tv_usec);
                 break;
             }
+            case SCM_CREDENTIALS:
+            {
+                struct ucred *cred = (struct ucred *)data;
+                struct target_ucred *target_cred =
+                    (struct target_ucred *)target_data;
+
+                __put_user(cred->pid, &target_cred->pid);
+                __put_user(cred->uid, &target_cred->uid);
+                __put_user(cred->gid, &target_cred->gid);
+                break;
+            }
             default:
                 goto unimplemented;
             }