uname: Add Emulator specific name 01/24401/3
authorMunkyu Im <munkyu.im@samsung.com>
Fri, 11 Jul 2014 11:56:55 +0000 (20:56 +0900)
committerMunkyu Im <munkyu.im@samsung.com>
Mon, 14 Jul 2014 09:49:21 +0000 (18:49 +0900)
To distinguish between real device and emulator,
add "_emulated" postfix into machine hardware name.

Change-Id: I0a801a127d0fb62314d6d30cac03febfd6d49801
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
kernel/sys.c

index c18ecca..96fa989 100644 (file)
@@ -1123,12 +1123,23 @@ static int override_release(char __user *release, size_t len)
 SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
 {
        int errno = 0;
+#ifdef CONFIG_MARU
+       struct new_utsname u;
 
        down_read(&uts_sem);
+       memcpy(&u, utsname(), sizeof *name);
+       up_read(&uts_sem);
+
+       strcat(u.machine, "_emulated");
+
+       if (copy_to_user(name, &u, sizeof *name))
+               errno = -EFAULT;
+#else
+       down_read(&uts_sem);
        if (copy_to_user(name, utsname(), sizeof *name))
                errno = -EFAULT;
        up_read(&uts_sem);
-
+#endif
        if (!errno && override_release(name->release, sizeof(name->release)))
                errno = -EFAULT;
        if (!errno && override_architecture(name))