Fork me on GitHub

root/kernel/syscalls/uname.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. sys_uname

   1 /*
   2  * fiwix/kernel/syscalls/uname.c
   3  *
   4  * Copyright 2018, Jordi Sanfeliu. All rights reserved.
   5  * Distributed under the terms of the Fiwix License.
   6  */
   7 
   8 #include <fiwix/fs.h>
   9 #include <fiwix/utsname.h>
  10 #include <fiwix/string.h>
  11 
  12 #ifdef __DEBUG__
  13 #include <fiwix/stdio.h>
  14 #include <fiwix/process.h>
  15 #endif /*__DEBUG__ */
  16 
  17 int sys_uname(struct old_utsname *uname)
  18 {
  19         int errno;
  20 
  21 #ifdef __DEBUG__
  22         printk("(pid %d) sys_uname(0x%08x) -> returning ", current->pid, (unsigned int)uname);
  23 #endif /*__DEBUG__ */
  24 
  25         if((errno = check_user_area(VERIFY_WRITE, uname, sizeof(struct old_utsname)))) {
  26                 return errno;
  27         }
  28         memcpy_b(&uname->sysname, &sys_utsname.sysname, sizeof(sys_utsname.sysname));
  29         memcpy_b(&uname->nodename, &sys_utsname.nodename, sizeof(sys_utsname.nodename));
  30         memcpy_b(&uname->release, &sys_utsname.release, sizeof(sys_utsname.release));
  31         memcpy_b(&uname->version, &sys_utsname.version, sizeof(sys_utsname.version));
  32         memcpy_b(&uname->machine, &sys_utsname.machine, sizeof(sys_utsname.machine));
  33         return 0;
  34 }

/* [previous][next][first][last][top][bottom][index][help] */