#include #include #include #include #include static struct spinlock uname_lock = {}; static struct utsname uname_buf = { .sysname = "Zinnia", .release = ZINNIA_VERSION, .version = CONFIG_KERNEL_FLAVOR, .nodename = "localhost", .machine = ZINNIA_ARCH, }; struct syscall_ret sys_getuname(__user struct utsname* ptr) { struct syscall_ret ret = {}; if (!ptr) { ret.errno = EINVAL; return ret; } spin_lock(&uname_lock); if (!usercopy_write(ptr, &uname_buf, sizeof(uname_buf))) ret.errno = EFAULT; spin_unlock(&uname_lock); return ret; }