/* ???? Copyright 2002 Johan Rydberg, jrydberg@rtmk.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include "nova-intern.h" /* Since we do not want to depend on the structure that the C library supplys for us we define it here. */ #define _UTSNAME_LENGTH 48 /* Structure describing the system and machine. */ struct utsname { char sysname[_UTSNAME_LENGTH]; char nodename[_UTSNAME_LENGTH]; char release[_UTSNAME_LENGTH]; char version[_UTSNAME_LENGTH]; char machine[_UTSNAME_LENGTH]; }; /* Get name and information about current kernel. *BUF_LENGTH must be sizeof (struct utsname) - otherwise EFAULT is returned. */ int nova_S_proc_uname (struct proc *p, char *buf, int *buf_length) { struct utsname *utsname = (struct utsname *) buf; if (*buf_length != sizeof (struct utsname)) return EFAULT; strncpy (utsname->sysname, PACKAGE, sizeof utsname->sysname); strncpy (utsname->release, VERSION, sizeof utsname->release); strncpy (utsname->version, __DATE__, sizeof utsname->version); /* Currently unknown fields. */ strncpy (utsname->machine, "i686", sizeof utsname->machine); strncpy (utsname->nodename, "unknown", sizeof utsname->nodename); return 0; }