Browse Source

Plan 9 from Bell Labs 2003-06-27

David du Colombier 16 years ago
parent
commit
c448916ad4
3 changed files with 27 additions and 0 deletions
  1. 2 0
      dist/replica/plan9.db
  2. 2 0
      dist/replica/plan9.log
  3. 23 0
      sys/src/cmd/aux/zerotrunc.c

+ 2 - 0
dist/replica/plan9.db

@@ -150,6 +150,7 @@
 386/bin/aux/vmware - 775 sys sys 1049428256 453
 386/bin/aux/vmwarefs - 775 sys sys 1045537962 102172
 386/bin/aux/write - 775 sys sys 1038443108 4198
+386/bin/aux/zerotrunc - 775 sys sys 1056634437 58154
 386/bin/awd - 775 sys sys 1038443108 5033
 386/bin/awk - 775 sys sys 1048745031 316908
 386/bin/basename - 775 sys sys 1039758547 38375
@@ -6766,6 +6767,7 @@ sys/src/cmd/aux/vga/vision968.c - 664 sys sys 1014925014 3959
 sys/src/cmd/aux/vga/vmware.c - 664 sys sys 1020313485 4907
 sys/src/cmd/aux/vga/w30c516.c - 664 sys sys 1014925014 3158
 sys/src/cmd/aux/write.c - 664 sys sys 944960778 471
+sys/src/cmd/aux/zerotrunc.c - 664 sys sys 1056634403 300
 sys/src/cmd/awd.c - 664 sys sys 944961364 567
 sys/src/cmd/awk - 20000000775 sys sys 944964677 0
 sys/src/cmd/awk/awk.h - 664 sys sys 944960803 4624

+ 2 - 0
dist/replica/plan9.log

@@ -12743,3 +12743,5 @@
 1056573071 4 c sys/lib/ghostscript/font/README - 444 sys sys 1056572274 350
 1056573071 5 m sys/lib/ghostscript/font/README - 444 sys sys 1056572274 350
 1056573071 6 c sys/lib/postscript/font/NOTICE - 444 sys sys 1056572331 816
+1056636155 0 a 386/bin/aux/zerotrunc - 775 sys sys 1056634437 58154
+1056636155 1 a sys/src/cmd/aux/zerotrunc.c - 664 sys sys 1056634403 300

+ 23 - 0
sys/src/cmd/aux/zerotrunc.c

@@ -0,0 +1,23 @@
+/*
+ * cat standard input until you get a zero byte
+ */
+
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+
+void
+main(void)
+{
+	int c;
+	Biobuf bin, bout;
+
+	Binit(&bin, 0, OREAD);
+	Binit(&bout, 1, OWRITE);
+	while((c = Bgetc(&bin)) != Beof && c != 0){
+		Bputc(&bout, c);
+	}
+	Bflush(&bout);
+	exits(0);
+}
+