/* * This file implements the uname system call. It stores information about the * kernel to a buffer for userspace to read. */ #include #include #include #include static const char *SYSNAME = "Nucleus"; static const char *RELEASE = "0.9.4"; static const char *VERSION = "SMP PREEMPT "__DATE__" "__TIME__; static const char *MACHINE = "x86"; /* Get information about current kernel */ int uname(struct utsname *buf) { if (!buf || !verify_access(buf, sizeof(struct utsname), PROT_WRITE)) return -EFAULT; strcpy(buf->sysname, SYSNAME); strcpy(buf->release, RELEASE); strcpy(buf->version, VERSION); strcpy(buf->machine, MACHINE); return 0; }