Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / kernel / linux_syscalls / fstat.c
1 #include <lwk/kernel.h>
2 #include <lwk/stat.h>
3 #include <arch/uaccess.h>
4
5 long
6 sys_fstat(unsigned int fd, struct stat __user *statbuf)
7 {
8         struct stat tmp;
9
10         /* For now only allow stat()'ing stdio */
11         if (fd != 1)
12                 return -EBADF;
13
14         /* TODO: Fix this! */
15         tmp.st_dev     = 11;
16         tmp.st_ino     = 9;
17         tmp.st_mode    = 0x2190;
18         tmp.st_nlink   = 1;
19         tmp.st_uid     = 0;
20         tmp.st_gid     = 0;
21         tmp.st_rdev    = 34823;
22         tmp.st_size    = 0;
23         tmp.st_blksize = 1024;
24         tmp.st_blocks  = 0;
25         tmp.st_atime   = 1204772189;
26         tmp.st_mtime   = 1204772189;
27         tmp.st_ctime   = 1204769465;
28         
29         return copy_to_user(statbuf, &tmp, sizeof(tmp)) ? -EFAULT : 0;
30 }
31