summaryrefslogtreecommitdiff
path: root/kernel/syscalls.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-11-23 15:45:31 +0100
committerMichal Idziorek <m.i@gmx.at>2014-11-23 15:45:31 +0100
commit1d472bb0439a83191fcda5e7a778ff0f28a0b6e5 (patch)
treea2ef44129eddacc496f899e4fb6a9e85ce7d35ed /kernel/syscalls.c
parent6a3ef39feb635f529da9e36975ba77a26c1ff3b4 (diff)
adjusting syscalls
Diffstat (limited to 'kernel/syscalls.c')
-rw-r--r--kernel/syscalls.c49
1 files changed, 37 insertions, 12 deletions
diff --git a/kernel/syscalls.c b/kernel/syscalls.c
index 9f29750..9ad07e2 100644
--- a/kernel/syscalls.c
+++ b/kernel/syscalls.c
@@ -288,17 +288,6 @@ int syscall_close(int file,int none1,int none2)
}
-int syscall_fstat(int file, struct stat *st,int none)
-{
- #ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"fstat (file=%d,stat=0x%08X)", file,st);
- #endif
-
- st->st_mode = S_IFCHR;
- return 0;
-}
-
-
int syscall_isatty(int file,int none1,int none2)
{
#ifdef LOG_SYSCALLS
@@ -383,5 +372,41 @@ int syscall_exit(int ret, int none1, int none2)
#ifdef LOG_SYSCALLS
log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"exit (ret=%d)", ret);
#endif
- syscall_execve(15,0,0); // start shell
+
+ static char *argv[]={"test",NULL};
+ syscall_execve(15,argv,0); // start shell
+}
+
+
+// stat, fstat, lstat
+
+int syscall_stat(const char *path, struct stat *st,int none)
+{
+ #ifdef LOG_SYSCALLS
+ log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"stat (path=0x%08X,stat=0x%08X)", path,st);
+ #endif
+
+ st->st_mode = S_IFCHR;
+ return 0;
+}
+
+int syscall_fstat(int file, struct stat *st,int none)
+{
+ #ifdef LOG_SYSCALLS
+ log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"fstat (file=%d,stat=0x%08X)", file,st);
+ #endif
+
+ st->st_mode = S_IFCHR;
+ return 0;
+}
+
+
+int syscall_lstat(const char *path, struct stat *st,int none)
+{
+ #ifdef LOG_SYSCALLS
+ log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"lstat (path=0x%08X,stat=0x%08X)", path,st);
+ #endif
+
+ st->st_mode = S_IFCHR;
+ return 0;
}