From a365c1d84fb8e2b059bed56afcf5cd6fbd52e36e Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Mon, 4 Oct 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-10-04 --- port/sysfile.c | 15 +++++++++++++++ port/sysproc.c | 6 ++---- port/systab.h | 6 +++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/port/sysfile.c b/port/sysfile.c index 4bd1db99fc4a79ed42dcf6c133ad313c4ff0723c..7621b8a9e16234e2b49cc63446df12e1bfd49b1e 100644 --- a/port/sysfile.c +++ b/port/sysfile.c @@ -84,6 +84,21 @@ openmode(ulong o) return 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) { diff --git a/port/sysproc.c b/port/sysproc.c index 14726bebe8c2375d3d1f3592c7d73c3d2557dd38..07ff2582fd36e9fc723865422ee13c2cd1d0945e 100644 --- a/port/sysproc.c +++ b/port/sysproc.c @@ -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; } diff --git a/port/systab.h b/port/systab.h index 50d0116d0475d388ccfcab277327a96f5b51e4a6..87188f5e56f6ade2985b48609eea1848997d6e67 100644 --- a/port/systab.h +++ b/port/systab.h @@ -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",