shithub: riscv

Download patch

ref: 4f45a403344037b0931d921ab8cd4b428f630a7e
parent: 73d35f9c7db439c324a84a7582b1208222a71537
author: cinap_lenrek <[email protected]>
date: Sat Aug 2 11:47:24 EDT 2014

iostats: cannot spy on fd 0,1,2 as /fd is per process

--- a/sys/src/cmd/iostats.c
+++ b/sys/src/cmd/iostats.c
@@ -308,12 +308,8 @@
 		bind("#c/pid", "/dev/pid", MREPL);
 		bind("#c/ppid", "/dev/ppid", MREPL);
 		bind("#e", "/env", MREPL|MCREATE);
-		close(0);
-		close(1);
-		close(2);
-		open("/fd/0", OREAD);
-		open("/fd/1", OWRITE);
-		open("/fd/2", OWRITE);
+		bind("#d", "/fd", MREPL);
+
 		if(chdir(buf) < 0)
 			sysfatal("chdir");
 		exec(*argv, argv);