summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/include/sys/filedesc.h2
-rw-r--r--sys/include/sys/syscall.h1
-rw-r--r--sys/kern/kern_descrip.c13
-rw-r--r--sys/kern/kern_syscall.c1
4 files changed, 17 insertions, 0 deletions
diff --git a/sys/include/sys/filedesc.h b/sys/include/sys/filedesc.h
index 5f7e4e3..4ce2db2 100644
--- a/sys/include/sys/filedesc.h
+++ b/sys/include/sys/filedesc.h
@@ -62,5 +62,7 @@ off_t fd_seek(int fildes, off_t offset, int whence);
int fd_dup(int fd);
struct filedesc *fd_get(unsigned int fdno);
+scret_t sys_lseek(struct syscall_args *scargs);
+
#endif /* _KERNEL */
#endif /* !_SYS_FILEDESC_H_ */
diff --git a/sys/include/sys/syscall.h b/sys/include/sys/syscall.h
index 0376bd2..37e2286 100644
--- a/sys/include/sys/syscall.h
+++ b/sys/include/sys/syscall.h
@@ -51,6 +51,7 @@
#define SYS_mmap 10
#define SYS_munmap 11
#define SYS_access 12
+#define SYS_lseek 13
#if defined(_KERNEL)
/* Syscall return value and arg type */
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 1737b53..a2dd667 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -331,3 +331,16 @@ fd_seek(int fildes, off_t offset, int whence)
return 0;
}
+
+/*
+ * Update file offset
+ *
+ * arg0: `filedes'
+ * arg1: `offset'
+ * arg2: `whence'
+ */
+scret_t
+sys_lseek(struct syscall_args *scargs)
+{
+ return fd_seek(scargs->arg0, scargs->arg1, scargs->arg2);
+}
diff --git a/sys/kern/kern_syscall.c b/sys/kern/kern_syscall.c
index fdcc73f..aaa5d04 100644
--- a/sys/kern/kern_syscall.c
+++ b/sys/kern/kern_syscall.c
@@ -49,6 +49,7 @@ scret_t(*g_sctab[])(struct syscall_args *) = {
sys_mmap, /* SYS_mmap */
sys_munmap, /* SYS_munap */
sys_access, /* SYS_access */
+ sys_lseek, /* SYS_lseek */
};
const size_t MAX_SYSCALLS = NELEM(g_sctab);