summaryrefslogtreecommitdiff
path: root/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/syscall.c b/syscall.c
index 48da287..4505c89 100644
--- a/syscall.c
+++ b/syscall.c
@@ -303,7 +303,6 @@ sys_unlink(void)
return r;
}
-
int
sys_fstat(void)
{
@@ -326,6 +325,21 @@ sys_fstat(void)
}
int
+sys_link(void)
+{
+ struct proc *cp = curproc[cpu()];
+ uint name1, name2;
+ int r;
+
+ if(fetcharg(0, &name1) < 0 || checkstring(name1) < 0)
+ return -1;
+ if(fetcharg(1, &name2) < 0 || checkstring(name2) < 0)
+ return -1;
+ r = link(cp->mem + name1, cp->mem + name2);
+ return r;
+}
+
+int
sys_exec(void)
{
struct proc *cp = curproc[cpu()];
@@ -543,6 +557,9 @@ syscall(void)
case SYS_fstat:
ret = sys_fstat();
break;
+ case SYS_link:
+ ret = sys_link();
+ break;
default:
cprintf("unknown sys call %d\n", num);
// XXX fault