X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=kitten%2Fkernel%2Flinux_syscalls%2Ffstat.c;fp=kitten%2Fkernel%2Flinux_syscalls%2Ffstat.c;h=9a6301c2aaa228e6afe3e1f23711da706d085910;hb=6299cb929a586fd8debcc316c1ede714d5b95979;hp=0000000000000000000000000000000000000000;hpb=e9e3ee43cb302909917b5919f6043347b73c6995;p=palacios-OLD.git diff --git a/kitten/kernel/linux_syscalls/fstat.c b/kitten/kernel/linux_syscalls/fstat.c new file mode 100644 index 0000000..9a6301c --- /dev/null +++ b/kitten/kernel/linux_syscalls/fstat.c @@ -0,0 +1,31 @@ +#include +#include +#include + +long +sys_fstat(unsigned int fd, struct stat __user *statbuf) +{ + struct stat tmp; + + /* For now only allow stat()'ing stdio */ + if (fd != 1) + return -EBADF; + + /* TODO: Fix this! */ + tmp.st_dev = 11; + tmp.st_ino = 9; + tmp.st_mode = 0x2190; + tmp.st_nlink = 1; + tmp.st_uid = 0; + tmp.st_gid = 0; + tmp.st_rdev = 34823; + tmp.st_size = 0; + tmp.st_blksize = 1024; + tmp.st_blocks = 0; + tmp.st_atime = 1204772189; + tmp.st_mtime = 1204772189; + tmp.st_ctime = 1204769465; + + return copy_to_user(statbuf, &tmp, sizeof(tmp)) ? -EFAULT : 0; +} +