M port/sysfile.c => port/sysfile.c +15 -0
@@ 85,6 85,21 @@ openmode(ulong o)
}
long
+syspath(ulong *arg)
+{
+ Chan *c;
+
+ validaddr(arg[1], 1, 0);
+ if(vmemchr((char*)arg[1], '\0', arg[2]) == 0)
+ error(Ebadarg);
+
+ c = fdtochan(arg[0], -1, 0, 0);
+
+ ptpath(c->path, (char*)arg[1], arg[2]);
+ return 0;
+}
+
+long
syspipe(ulong *arg)
{
int fd[2];
M port/sysproc.c => port/sysproc.c +2 -4
@@ 12,10 12,8 @@ int shargs(char*, int, char**);
long
sysr1(ulong *arg)
{
- Chan *c;
-
- c = fdtochan(arg[0], -1, 0, 0);
- ptpath(c->path, (char*)arg[1], arg[2]);
+ xsummary();
+ print("[%s %s %d] r1 = %d\n", up->user, up->text, up->pid, arg[0]);
return 0;
}
M port/systab.h => port/systab.h +3 -3
@@ 26,7 26,7 @@ Syscall sysrfork;
Syscall syswrite;
Syscall syspipe;
Syscall syscreate;
-Syscall sys_x3;
+Syscall syspath;
Syscall sysbrk_;
Syscall sysremove;
Syscall syswstat;
@@ 66,7 66,7 @@ Syscall *systab[]={
[WRITE] syswrite,
[PIPE] syspipe,
[CREATE] syscreate,
- [_X3] sysdeath,
+ [PATH] syspath,
[BRK_] sysbrk_,
[REMOVE] sysremove,
[WSTAT] syswstat,
@@ 106,7 106,7 @@ char *sysctab[]={
[WRITE] "Write",
[PIPE] "Pipe",
[CREATE] "Create",
- [_X3] "_x3",
+ [PATH] "Path",
[BRK_] "Brk",
[REMOVE] "Remove",
[WSTAT] "Wstat",