Fork me on GitHub

root/kernel/syscalls/getcwd.c

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

DEFINITIONS

This source file includes following definitions.
  1. sys_getcwd

   1 /*
   2  * fiwix/kernel/syscalls/getcwd.c
   3  *
   4  * Copyright 2018, Jordi Sanfeliu. All rights reserved.
   5  * Distributed under the terms of the Fiwix License.
   6  */
   7 
   8 #include <fiwix/types.h>
   9 #include <fiwix/fs.h>
  10 #include <fiwix/errno.h>
  11 
  12 #ifdef __DEBUG__
  13 #include <fiwix/stdio.h>
  14 #include <fiwix/process.h>
  15 #endif /*__DEBUG__ */
  16 
  17 int sys_getcwd(char *buf, __size_t size)
  18 {
  19         int errno;
  20 
  21 #ifdef __DEBUG__
  22         printk("(pid %d) sys_getcwd(0x%08x, %d)\n", current->pid, (unsigned int)buf, size);
  23 #endif /*__DEBUG__ */
  24 
  25         if((errno = check_user_area(VERIFY_WRITE, buf, size))) {
  26                 return errno;
  27         }
  28         return -ENOSYS;
  29 }

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