Browse Source

Plan 9 from Bell Labs 2003-02-18

David du Colombier 21 years ago
parent
commit
a33d1e76ad
100 changed files with 2004 additions and 3562 deletions
  1. 1 0
      386/bin/aux/vmware
  2. 1 1
      acme/bin/source/win/fs.c
  3. 331 331
      dist/replica/plan9.db
  4. 562 0
      dist/replica/plan9.log
  5. 31 11
      rc/bin/C
  6. 1 1
      rc/bin/mail
  7. 1 1
      rc/bin/replica/pull
  8. 1 1
      rc/bin/troff2gif
  9. 3 1
      rc/bin/window
  10. 2 0
      sys/games/lib/fortunes
  11. 3 0
      sys/include/thread.h
  12. 12 1
      sys/include/venti.h
  13. 1 1
      sys/lib/dist/pc/inst/mountdist
  14. 1 1
      sys/lib/dist/pc/plan9.ini.cd
  15. 1 1
      sys/lib/dist/pc/plan9.ini.vmware
  16. 87 49
      sys/lib/man/lookman/index
  17. 1 0
      sys/lib/mimetype
  18. 62 4
      sys/lib/sysconfig/proto/portproto
  19. 4 0
      sys/lib/tls/README
  20. 0 2
      sys/man/1/INDEX
  21. 16 1
      sys/man/1/faces
  22. 1 2
      sys/man/1/marshal
  23. 1 1
      sys/man/1/mc
  24. 1 1
      sys/man/1/mlmgr
  25. 1 68
      sys/man/1/tel
  26. 164 95
      sys/man/1/vnc
  27. 5 0
      sys/man/2/INDEX
  28. 4 1
      sys/man/2/pushtls
  29. 1 1
      sys/man/2/strcat
  30. 2 1
      sys/man/3/tls
  31. 2 0
      sys/man/8/INDEX
  32. 6 5
      sys/man/8/aan
  33. 27 0
      sys/man/8/fs
  34. 49 41
      sys/man/8/fsconfig
  35. 3 1
      sys/man/8/listen
  36. 2 1
      sys/man/8/mk9660
  37. 4 0
      sys/man/8/secstore
  38. 3 1
      sys/man/8/send
  39. 2 0
      sys/man/8/smtp
  40. 6 2
      sys/man/8/ventiaux
  41. 0 1
      sys/src/9/bitsy/etherif.h
  42. 4 4
      sys/src/9/boot/mkboot
  43. 1 1
      sys/src/9/ip/tcp.c
  44. 0 1
      sys/src/9/mtx/etherif.h
  45. 0 60
      sys/src/9/pc/clock.c
  46. 31 36
      sys/src/9/pc/devarch.c
  47. 1 1
      sys/src/9/pc/pcdisk
  48. 6 8
      sys/src/9/pc/pcflop
  49. 1 1
      sys/src/9/port/devfs.c
  50. 0 1490
      sys/src/9/port/devwpsd.c
  51. 47 38
      sys/src/9/port/master
  52. 9 0
      sys/src/9/port/mkfile
  53. 8 2
      sys/src/9/port/portdat.h
  54. 0 761
      sys/src/ape/cmd/make/gram.c
  55. 1 0
      sys/src/ape/cmd/pdksh/README.Plan9
  56. 1 186
      sys/src/ape/cmd/pdksh/alloc.c
  57. 5 1
      sys/src/boot/alphapc/conf.c
  58. 29 6
      sys/src/boot/alphapc/cons.c
  59. 1 1
      sys/src/boot/alphapc/mkfile
  60. 3 0
      sys/src/boot/pc/sdata.c
  61. 9 9
      sys/src/cmd/1l/asm.c
  62. 16 16
      sys/src/cmd/1l/obj.c
  63. 12 12
      sys/src/cmd/1l/pass.c
  64. 1 1
      sys/src/cmd/1l/span.c
  65. 12 12
      sys/src/cmd/2l/asm.c
  66. 16 16
      sys/src/cmd/2l/obj.c
  67. 10 10
      sys/src/cmd/2l/pass.c
  68. 1 1
      sys/src/cmd/2l/span.c
  69. 1 1
      sys/src/cmd/5l/asm.c
  70. 5 5
      sys/src/cmd/5l/noop.c
  71. 23 23
      sys/src/cmd/5l/obj.c
  72. 7 7
      sys/src/cmd/5l/pass.c
  73. 7 7
      sys/src/cmd/5l/span.c
  74. 5 5
      sys/src/cmd/6l/asm.c
  75. 16 16
      sys/src/cmd/6l/obj.c
  76. 8 8
      sys/src/cmd/6l/pass.c
  77. 6 6
      sys/src/cmd/6l/span.c
  78. 11 11
      sys/src/cmd/7l/asm.c
  79. 8 8
      sys/src/cmd/7l/noop.c
  80. 23 23
      sys/src/cmd/7l/obj.c
  81. 6 6
      sys/src/cmd/7l/pass.c
  82. 5 5
      sys/src/cmd/7l/span.c
  83. 6 6
      sys/src/cmd/8l/asm.c
  84. 1 1
      sys/src/cmd/8l/list.c
  85. 21 21
      sys/src/cmd/8l/obj.c
  86. 8 8
      sys/src/cmd/8l/pass.c
  87. 7 7
      sys/src/cmd/8l/span.c
  88. 11 11
      sys/src/cmd/9l/asm.c
  89. 6 6
      sys/src/cmd/9l/noop.c
  90. 23 23
      sys/src/cmd/9l/obj.c
  91. 6 6
      sys/src/cmd/9l/pass.c
  92. 7 7
      sys/src/cmd/9l/span.c
  93. 1 0
      sys/src/cmd/acme/dat.h
  94. 8 1
      sys/src/cmd/acme/ecmd.c
  95. 32 7
      sys/src/cmd/acme/elog.c
  96. 7 0
      sys/src/cmd/acme/text.c
  97. 1 10
      sys/src/cmd/auth/authsrv.c
  98. 1 0
      sys/src/cmd/auth/lib/getexpiration.c
  99. 96 10
      sys/src/cmd/auth/login.c
  100. 0 4
      sys/src/cmd/auth/secstore/aescbc.c

+ 1 - 0
386/bin/aux/vmware

@@ -1,6 +1,7 @@
 #!/bin/rc
 #!/bin/rc
 
 
 if(aux/isvmware -s){
 if(aux/isvmware -s){
+	echo -n on >'#P/pge'	# default, but set anyway.
 	echo -n off >'#P/i8253timerset'
 	echo -n off >'#P/i8253timerset'
 	for(i in '#S'/sd??)
 	for(i in '#S'/sd??)
 		if(test -f $i/ctl)
 		if(test -f $i/ctl)

+ 1 - 1
acme/bin/source/win/fs.c

@@ -127,12 +127,12 @@ Srv fs = {
 .write=	fswrite,
 .write=	fswrite,
 .flush=	fsflush,
 .flush=	fsflush,
 .destroyfid=	fsdestroyfid,
 .destroyfid=	fsdestroyfid,
+.leavefdsopen=	1,
 };
 };
 
 
 void
 void
 mountcons(void)
 mountcons(void)
 {
 {
-//chatty9p=1;
 	fschan = chancreate(sizeof(Fsevent), 0);
 	fschan = chancreate(sizeof(Fsevent), 0);
 	writechan = chancreate(sizeof(void*), 0);
 	writechan = chancreate(sizeof(void*), 0);
 	fs.tree = alloctree("win", "win", DMDIR|0555, nil);
 	fs.tree = alloctree("win", "win", DMDIR|0555, nil);

File diff suppressed because it is too large
+ 331 - 331
dist/replica/plan9.db


+ 562 - 0
dist/replica/plan9.log

@@ -17310,3 +17310,565 @@
 1045432863 2 c sys/src/9/ip/tcp.c - 664 sys sys 1045432714 65108
 1045432863 2 c sys/src/9/ip/tcp.c - 664 sys sys 1045432714 65108
 1045436465 0 c 386/bin/aux/timesync - 775 sys sys 1045435076 127693
 1045436465 0 c 386/bin/aux/timesync - 775 sys sys 1045435076 127693
 1045436465 1 c sys/src/cmd/aux/timesync.c - 664 sys sys 1045435060 24288
 1045436465 1 c sys/src/cmd/aux/timesync.c - 664 sys sys 1045435060 24288
+1045492244 0 c sys/src/9/port/portdat.h - 664 sys sys 1045491608 21205
+1045494045 0 c rc/bin/C - 775 sys sys 1045493437 788
+1045500142 0 c sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1045500125 343
+1045500142 1 c sys/lib/dist/pc/plan9.ini.vmware - 664 sys sys 1045500078 168
+1045500142 2 c sys/src/9/pc/pcflop - 664 sys sys 1045500133 1386
+1045501248 0 a sys/man/8/aan - 664 sys sys 1045501064 1670
+1045501248 1 d sys/man/1/aan - 664 sys sys 1019856818 0
+1045501248 2 d sys/src/cmd/upas/fs/biff.c - 664 sys sys 947802083 0
+1045501248 3 d sys/src/libc/port/fastrand.c - 664 sys sys 1032061120 0
+1045501248 4 d sys/src/libc/port/nfastrand.c - 664 sys sys 1014927400 0
+1045503049 0 c sys/man/1/mc - 664 sys sys 1045501392 508
+1045503049 1 c sys/man/1/tel - 664 sys sys 1045501423 941
+1045503049 2 c sys/man/1/vnc - 664 sys sys 1045501432 4186
+1045503049 3 c sys/man/1/faces - 664 sys sys 1045501346 2052
+1045503049 4 c sys/man/1/marshal - 664 sys sys 1045501381 3308
+1045503049 5 c sys/man/1/mlmgr - 664 sys sys 1045501403 2427
+1045503049 6 c sys/man/2/strcat - 664 sys sys 1045501487 4688
+1045503049 7 c sys/man/2/pushtls - 664 sys sys 1045501472 4516
+1045503049 8 c sys/man/3/tls - 664 sys sys 1045501496 7018
+1045503049 9 c sys/man/8/fs - 664 sys sys 1045501599 14286
+1045503049 10 c sys/man/8/fsconfig - 664 sys sys 1045501600 8142
+1045503049 11 c sys/man/8/listen - 664 sys sys 1045501609 3740
+1045503049 12 c sys/man/8/mk9660 - 664 sys sys 1045501618 3940
+1045503049 13 c sys/man/8/secstore - 664 sys sys 1045501623 990
+1045503049 14 c sys/man/8/send - 664 sys sys 1045501634 2168
+1045503049 15 c sys/man/8/smtp - 664 sys sys 1045501674 3966
+1045503049 16 c sys/man/8/ventiaux - 664 sys sys 1045501683 9967
+1045503049 17 c sys/src/9/bitsy/etherif.h - 664 sys sys 1045501788 913
+1045503049 18 c sys/src/cmd/samterm/menu.c - 664 sys sys 1045502822 6528
+1045503049 19 c sys/src/cmd/samterm/samterm.h - 664 sys sys 1045502822 3730
+1045503049 20 c sys/src/fs/dev/cw.c - 664 sys sys 1045502886 41997
+1045503049 21 c sys/src/fs/pc/lock.c - 664 sys sys 1045502910 3591
+1045503049 22 c sys/src/fs/port/all.h - 664 sys sys 1045502862 1927
+1045503049 23 c sys/src/fs/port/config.c - 664 sys sys 1045502863 15760
+1045503049 24 c sys/src/fs/port/iobuf.c - 664 sys sys 1045502864 4845
+1045503049 25 c sys/src/fs/port/portdat.h - 664 sys sys 1045502865 16642
+1045503049 26 c sys/src/fs/port/sub.c - 664 sys sys 1045502866 23708
+1045503049 27 c sys/src/libbin/bin.c - 664 sys sys 1045502972 1811
+1045503049 28 c sys/src/libc/9sys/qlock.c - 664 sys sys 1045502963 3793
+1045503049 29 c sys/src/libc/9sys/tm2sec.c - 664 sys sys 1045502952 3192
+1045503049 30 c sys/src/libflate/inflate.c - 664 sys sys 1045502936 13119
+1045503049 31 c sys/src/libhttpd/date.c - 664 sys sys 1045502928 3507
+1045503049 32 c sys/src/libmemdraw/arctest.c - 664 sys sys 1045502219 865
+1045503049 33 c sys/src/libmemdraw/drawtest.c - 664 sys sys 1045502228 23441
+1045503049 34 c sys/src/libmemdraw/mkfile - 664 sys sys 1045502238 593
+1045503049 35 c sys/src/libmp/port/dat.h - 664 sys sys 1045502198 350
+1045503049 36 c sys/src/libmp/port/mpfmt.c - 664 sys sys 1045502186 2729
+1045503049 37 c sys/src/libsec/port/rsafill.c - 664 sys sys 1045502171 1104
+1045503049 38 c sys/src/libstdio/vfprintf.c - 664 sys sys 1045502146 14378
+1045503049 39 c sys/src/libthread/channel.c - 664 sys sys 1045502115 8519
+1045503049 40 a sys/src/libventi/client.c - 664 sys sys 1045502093 5265
+1045503049 41 a sys/src/libventi/debug.c - 664 sys sys 1045502093 1258
+1045503049 42 a sys/src/libventi/fatal.c - 664 sys sys 1045502093 227
+1045503049 43 c sys/src/libventi/mkfile - 664 sys sys 1045502094 576
+1045503049 44 c sys/src/libventi/pack.c - 664 sys sys 1045502094 2851
+1045503049 45 a sys/src/libventi/parsescore.c - 664 sys sys 1045502095 516
+1045503049 46 a sys/src/libventi/plan9-io.c - 664 sys sys 1045502095 1754
+1045503049 47 a sys/src/libventi/plan9-sha1.c - 664 sys sys 1045502095 1058
+1045503049 48 a sys/src/libventi/plan9-thread.c - 664 sys sys 1045502074 6699
+1045503049 49 a sys/src/libventi/readfully.c - 664 sys sys 1045502095 237
+1045503049 50 a sys/src/libventi/rpc.c - 664 sys sys 1045502096 7237
+1045503049 51 a sys/src/libventi/scorefmt.c - 664 sys sys 1045502096 255
+1045503049 52 a sys/src/libventi/server.c - 664 sys sys 1045502096 4507
+1045503049 53 a sys/src/libventi/strdup.c - 664 sys sys 1045502096 203
+1045503049 54 a sys/src/libventi/venti.txt - 664 sys sys 1045502097 4347
+1045503049 55 a sys/src/libventi/zero.c - 664 sys sys 1045502097 1509
+1045503049 56 c sys/src/mkfile.proto - 664 sys sys 1045502130 269
+1045503049 57 d sys/src/9/boot/libboot.a8 - 664 sys sys 1045063737 0
+1045503049 58 d sys/src/9/pc/clock.c - 664 sys sys 1032052912 0
+1045503049 59 d sys/src/9/port/devwpsd.c - 664 sys sys 1018469561 0
+1045503049 60 d sys/src/ape/cmd/make/gram.c - 664 sys sys 1014921974 0
+1045503049 61 d sys/src/libventi/plan9.c - 664 sys sys 1039964807 0
+1045503049 62 d sys/src/libventi/score.c - 664 sys sys 1019678692 0
+1045503049 63 d sys/src/libventi/sha1-plan9.c - 664 sys sys 1036005838 0
+1045503049 64 d sys/src/libventi/util.c - 664 sys sys 1019678692 0
+1045503049 65 d sys/src/libventi/venti.c - 664 sys sys 1036470163 0
+1045504849 0 c acme/bin/source/win/fs.c - 664 sys sys 1045503982 2713
+1045504849 1 c rc/bin/mail - 775 sys sys 1045504003 138
+1045504849 2 c rc/bin/replica/pull - 775 sys sys 1045504036 1445
+1045504849 3 c rc/bin/troff2gif - 775 sys sys 1045504085 178
+1045504849 4 c rc/bin/window - 775 sys sys 1045504108 1742
+1045504849 5 c sys/games/lib/fortunes - 664 sys sys 1045504123 238318
+1045504849 6 c sys/include/thread.h - 664 sys sys 1045504289 3562
+1045504849 7 c sys/include/venti.h - 664 sys sys 1045504293 6956
+1045504849 8 c sys/lib/dist/pc/inst/mountdist - 775 sys sys 1045504304 4889
+1045504849 9 c sys/lib/mimetype - 664 sys sys 1045504324 5269
+1045504849 10 c sys/lib/sysconfig/proto/portproto - 664 sys sys 1045504345 1680
+1045504849 11 c sys/lib/tls/README - 664 sys sys 1045504355 412
+1045504849 12 c sys/src/9/boot/mkboot - 775 sys sys 1045504382 1935
+1045504849 13 c sys/src/9/mtx/etherif.h - 664 sys sys 1045504432 785
+1045504849 14 c sys/src/9/pc/devarch.c - 664 sys sys 1045504479 16138
+1045504849 15 c sys/src/9/pc/pcdisk - 664 sys sys 1045504515 1369
+1045504849 16 c sys/src/ape/cmd/pdksh/README.Plan9 - 664 sys sys 1045504608 792
+1045504849 17 c sys/src/ape/cmd/pdksh/alloc.c - 664 sys sys 1045504808 13935
+1045504849 18 c sys/src/boot/alphapc/conf.c - 664 sys sys 1045504823 1348
+1045504849 19 c sys/src/boot/alphapc/cons.c - 664 sys sys 1045504824 3660
+1045504849 20 c sys/src/boot/pc/sdata.c - 664 sys sys 1045504828 33498
+1045504849 21 c sys/src/cmd/2l/asm.c - 664 sys sys 1045503932 28491
+1045504849 22 c sys/src/cmd/2l/obj.c - 664 sys sys 1045503933 24179
+1045504849 23 c sys/src/cmd/2l/pass.c - 664 sys sys 1045503934 9412
+1045504849 24 c sys/src/cmd/2l/span.c - 664 sys sys 1045503935 9612
+1045504849 25 c sys/src/cmd/5l/asm.c - 664 sys sys 1045503936 32289
+1045504849 26 c sys/src/cmd/5l/noop.c - 664 sys sys 1045503936 8486
+1045504849 27 c sys/src/cmd/5l/obj.c - 664 sys sys 1045503937 24524
+1045504849 28 c sys/src/cmd/5l/pass.c - 664 sys sys 1045503938 7358
+1045504849 29 c sys/src/cmd/5l/span.c - 664 sys sys 1045503939 14656
+1045504849 30 c sys/src/cmd/6l/asm.c - 664 sys sys 1045503940 8312
+1045504849 31 c sys/src/cmd/6l/obj.c - 664 sys sys 1045503940 18510
+1045504849 32 c sys/src/cmd/6l/pass.c - 664 sys sys 1045503941 7126
+1045504849 33 c sys/src/cmd/6l/span.c - 664 sys sys 1045503942 12853
+1045504849 34 c sys/src/cmd/8l/asm.c - 664 sys sys 1045503947 10028
+1045504849 35 c sys/src/cmd/8l/list.c - 664 sys sys 1045503947 4185
+1045504849 36 c sys/src/cmd/8l/obj.c - 664 sys sys 1045503948 24392
+1045504849 37 c sys/src/cmd/8l/pass.c - 664 sys sys 1045503949 10682
+1045504849 38 c sys/src/cmd/8l/span.c - 664 sys sys 1045503950 22035
+1045504849 39 c sys/src/cmd/9l/asm.c - 664 sys sys 1045503951 28348
+1045504849 40 c sys/src/cmd/9l/noop.c - 664 sys sys 1045503964 8588
+1045504849 41 c sys/src/cmd/9l/obj.c - 664 sys sys 1045503965 24015
+1045504849 42 c sys/src/cmd/9l/pass.c - 664 sys sys 1045503965 6750
+1045504849 43 c sys/src/cmd/9l/span.c - 664 sys sys 1045503966 11787
+1045504849 44 c sys/src/cmd/acme/dat.h - 664 sys sys 1045504837 10938
+1045504849 45 c sys/src/cmd/acme/ecmd.c - 664 sys sys 1045504838 23562
+1045504849 46 c sys/src/cmd/acme/elog.c - 664 sys sys 1045504839 6830
+1045504849 47 c sys/src/cmd/acme/text.c - 664 sys sys 1045504840 24133
+1045504849 48 c sys/src/cmd/auth/authsrv.c - 664 sys sys 1045504853 18391
+1045504849 49 c sys/src/cmd/auth/secstore/aescbc.c - 664 sys sys 1045504879 3920
+1045504849 50 c sys/src/cmd/auth/secstore/secuser.c - 664 sys sys 1045504876 4367
+1045504849 51 c sys/src/cmd/auth/secureidcheck.c - 664 sys sys 1045504896 8973
+1045504849 52 c sys/src/cmd/kl/asm.c - 664 sys sys 1045503967 26003
+1045504849 53 c sys/src/cmd/kl/noop.c - 664 sys sys 1045503968 11140
+1045504849 54 c sys/src/cmd/kl/obj.c - 664 sys sys 1045503969 21556
+1045504849 55 c sys/src/cmd/kl/pass.c - 664 sys sys 1045503969 9348
+1045504849 56 c sys/src/cmd/kl/span.c - 664 sys sys 1045503970 10146
+1045504849 57 c sys/src/cmd/webfs/client.c - 664 sys sys 1045503603 6504
+1045504849 58 c sys/src/cmd/webfs/cookies.c - 664 sys sys 1045503603 21597
+1045504849 59 c sys/src/cmd/webfs/dat.h - 664 sys sys 1045503604 1600
+1045504849 60 c sys/src/cmd/webfs/http.c - 664 sys sys 1045503605 6727
+1045504849 61 c sys/src/cmd/ql/asm.c - 664 sys sys 1045503971 10899
+1045504849 62 c sys/src/cmd/ql/asmout.c - 664 sys sys 1045503972 30253
+1045504849 63 c sys/src/cmd/ql/obj.c - 664 sys sys 1045503973 22745
+1045504849 64 c sys/src/cmd/ql/pass.c - 664 sys sys 1045503973 8914
+1045504849 65 c sys/src/cmd/ql/span.c - 664 sys sys 1045503974 14051
+1045504849 66 c sys/src/cmd/usb/audio/config.c - 664 sys sys 1045503797 8526
+1045504849 67 c sys/src/cmd/usb/audio/controls.c - 664 sys sys 1045503797 13379
+1045504849 68 c sys/src/cmd/usb/audio/dat.h - 664 sys sys 1045503798 3603
+1045504849 69 c sys/src/cmd/usb/audio/dump.c - 664 sys sys 1045503798 7065
+1045504849 70 c sys/src/cmd/usb/audio/fs.c - 664 sys sys 1045503799 18550
+1045504849 71 c sys/src/cmd/usb/audio/main.c - 664 sys sys 1045503799 9312
+1045504849 72 c sys/src/cmd/usb/audio/mkfile - 664 sys sys 1045503800 351
+1045504849 73 c sys/src/cmd/venti/arena.c - 664 sys sys 1045503653 13221
+1045504849 74 c sys/src/cmd/venti/backup.example - 775 sys sys 1045503662 521
+1045504849 75 c sys/src/cmd/venti/httpd.c - 664 sys sys 1045503654 9107
+1045504849 76 c sys/src/cmd/venti/index.c - 664 sys sys 1045503654 15232
+1045504849 77 c sys/src/cmd/venti/mkfile - 664 sys sys 1045503634 1083
+1045504849 78 a sys/src/cmd/venti/mkroot.c - 664 sys sys 1045503630 1172
+1045504849 79 c sys/src/cmd/venti/score.c - 664 sys sys 1045503655 588
+1045504849 80 c sys/src/cmd/vl/asm.c - 664 sys sys 1045503975 30493
+1045504849 81 c sys/src/cmd/vl/obj.c - 664 sys sys 1045503976 22971
+1045504849 82 c sys/src/cmd/vl/pass.c - 664 sys sys 1045503976 8714
+1045504849 83 c sys/src/cmd/vl/span.c - 664 sys sys 1045503977 12015
+1045504849 84 c sys/src/cmd/wikifs/mkfile - 664 sys sys 1045503591 468
+1045504849 85 c sys/src/cmd/wikifs/tohtml.c - 664 sys sys 1045503591 13989
+1045504849 86 c sys/src/cmd/1l/asm.c - 664 sys sys 1045503929 27882
+1045504849 87 c sys/src/cmd/1l/obj.c - 664 sys sys 1045503929 23494
+1045504849 88 c sys/src/cmd/1l/pass.c - 664 sys sys 1045503930 11701
+1045504849 89 c sys/src/cmd/1l/span.c - 664 sys sys 1045503931 8925
+1045504849 90 c sys/src/cmd/7l/asm.c - 774 sys sys 1045503943 27093
+1045504849 91 c sys/src/cmd/7l/noop.c - 774 sys sys 1045503944 19495
+1045504849 92 c sys/src/cmd/7l/obj.c - 774 sys sys 1045503944 23202
+1045504849 93 c sys/src/cmd/7l/pass.c - 774 sys sys 1045503945 8694
+1045504849 94 c sys/src/cmd/7l/span.c - 774 sys sys 1045503946 12041
+1045504849 95 d sys/src/cmd/jpg/rgbv.h - 664 sys sys 984718830 0
+1045504849 96 d sys/src/cmd/jpg/ycbcr.h - 664 sys sys 984718830 0
+1045506650 0 c sys/src/cmd/auth/lib/getexpiration.c - 664 sys sys 1045504996 1557
+1045506650 1 c sys/src/cmd/aux/apm.c - 664 sys sys 1045504910 20260
+1045506650 2 c sys/src/cmd/aux/conswdir.c - 664 sys sys 1045504955 2077
+1045506650 3 c sys/src/cmd/aux/vga/cyber938x.c - 664 sys sys 1045505008 6440
+1045506650 4 c sys/src/cmd/aux/vga/i81x.c - 664 sys sys 1045505005 4692
+1045506650 5 c sys/src/cmd/cfs/cfs.c - 664 sys sys 1045505024 16548
+1045506650 6 c sys/src/cmd/disk/prep/fdisk.c - 664 sys sys 1045505057 21802
+1045506650 7 c sys/src/cmd/dossrv/dossubs.c - 664 sys sys 1045505070 37735
+1045506650 8 c sys/src/cmd/gzip/unzip.c - 664 sys sys 1045505170 13605
+1045506650 9 c sys/src/cmd/ip/ftpd.c - 664 sys sys 1045505176 32914
+1045506650 10 c sys/src/cmd/ip/ftpfs/proto.c - 664 sys sys 1045505192 29282
+1045506650 11 c sys/src/cmd/ip/imap4d/date.c - 664 sys sys 1045505209 5668
+1045506650 12 c sys/src/cmd/ip/imap4d/imap4d.c - 664 sys sys 1045505233 40500
+1045506650 13 c sys/src/cmd/ip/ppp/ppp.c - 664 sys sys 1045505276 57262
+1045506650 14 c sys/src/cmd/ip/ppp/ppp.h - 664 sys sys 1045505276 8116
+1045506650 15 c sys/src/cmd/ip/ppp/testppp.c - 664 sys sys 1045505281 3011
+1045506650 16 c sys/src/cmd/ip/snoopy/dat.h - 664 sys sys 1045505292 1900
+1045506650 17 c sys/src/cmd/ip/snoopy/filter.y - 664 sys sys 1045505292 1536
+1045506650 18 c sys/src/cmd/ip/snoopy/hdlc.c - 664 sys sys 1045505305 4273
+1045506650 19 c sys/src/cmd/ip/snoopy/icmp6.c - 664 sys sys 1045505383 7727
+1045506650 20 c sys/src/cmd/ip/snoopy/main.c - 664 sys sys 1045505326 14337
+1045506650 21 c sys/src/cmd/ip/snoopy/mkfile - 664 sys sys 1045505384 775
+1045506650 22 c sys/src/cmd/ip/snoopy/ppp.c - 664 sys sys 1045505315 10502
+1045506650 23 c sys/src/cmd/ip/snoopy/tcp.c - 664 sys sys 1045505332 3550
+1045506650 24 c sys/src/cmd/lens.c - 664 sys sys 1045505408 4645
+1045506650 25 c sys/src/cmd/ms2html.c - 664 sys sys 1045505445 40080
+1045506650 26 c sys/src/cmd/ndb/dnresolve.c - 664 sys sys 1045505455 15249
+1045506650 27 c sys/src/cmd/execnet/client.c - 664 sys sys 1045505082 6794
+1045506650 28 c sys/src/cmd/faces/plumb.c - 664 sys sys 1045505116 7132
+1045506650 29 c sys/src/cmd/jpg/gif.c - 664 sys sys 1045505400 8844
+1045506650 30 c sys/src/cmd/ramfs.c - 664 sys sys 1045505479 15085
+1045506650 31 c sys/src/cmd/rc/fns.h - 664 sys sys 1045505528 1261
+1045506650 32 c sys/src/cmd/rc/glob.c - 664 sys sys 1045505529 4361
+1045506650 33 c sys/src/cmd/rc/mkfile - 664 sys sys 1045505530 780
+1045506650 34 c sys/src/cmd/rc/plan9.c - 664 sys sys 1045505528 8773
+1045506650 35 c sys/src/cmd/rc/unix.c - 664 sys sys 1045505529 8702
+1045506650 36 c sys/src/cmd/srvold9p/srvold9p.c - 664 sys sys 1045505578 19752
+1045506650 37 c sys/src/cmd/ssh/sshnet.c - 664 sys sys 1045505611 17656
+1045506650 38 c sys/src/cmd/unix/u9fs/authp9any.c - 664 sys sys 1045505643 11090
+1045506650 39 a sys/src/cmd/unix/u9fs/des.c - 664 sys sys 1045505648 16936
+1045506650 40 c sys/src/cmd/unix/u9fs/makefile - 664 sys sys 1045505665 1063
+1045506650 41 c sys/src/cmd/unix/u9fs/plan9.h - 664 sys sys 1045505644 5469
+1045506650 42 c sys/src/cmd/upas/filterkit/deliver.c - 664 sys sys 1045505683 1338
+1045506650 43 c sys/src/cmd/upas/filterkit/pipeto.sample - 664 sys sys 1045505695 1765
+1045506650 44 c sys/src/cmd/upas/fs/dat.h - 664 sys sys 1045505919 4257
+1045506650 45 c sys/src/cmd/upas/fs/fs.c - 664 sys sys 1045505917 27332
+1045506650 46 c sys/src/cmd/upas/marshal/marshal.c - 664 sys sys 1045505877 32205
+1045506650 47 c sys/src/cmd/upas/ml/mlmgr.c - 664 sys sys 1045505888 2332
+1045506650 48 c sys/src/cmd/upas/ned/nedmail.c - 664 sys sys 1045505901 41626
+1045506650 49 c sys/src/cmd/upas/scanmail/scanmail.c - 664 sys sys 1045505931 8656
+1045506650 50 c sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1045505955 23075
+1045506650 51 c sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1045505962 1063
+1045506650 52 c sys/src/cmd/upas/smtp/spam.c - 664 sys sys 1045505970 9221
+1045506650 53 c sys/src/cmd/gs/src/gdevplan9.c - 664 sys sys 1045505134 16247
+1045506650 54 c sys/src/cmd/ls.c - 664 sys sys 1045505418 5440
+1045506650 55 c sys/src/cmd/page/ps.c - 664 sys sys 1045505467 9176
+1045506650 56 c sys/src/cmd/page/rotate.c - 664 sys sys 1045505471 4764
+1045506650 57 c sys/src/cmd/page/view.c - 664 sys sys 1045505472 18161
+1045506650 58 c sys/src/cmd/rdbfs.c - 664 sys sys 1045505538 7974
+1045506650 59 c sys/src/cmd/sam/file.c - 664 sys sys 1045505553 11030
+1045506650 60 c sys/src/cmd/srv.c - 664 sys sys 1045505557 3986
+1045507623 0 c 386/bin/aux/vmware - 775 sys sys 1045507615 298
+1045508451 0 c 386/bin/replica/applylog - 775 sys sys 1045507749 99755
+1045508451 1 c sys/src/cmd/replica/applylog.c - 664 sys sys 1045507733 17134
+1045524668 0 c sys/src/9/ip/tcp.c - 664 sys sys 1045524266 65132
+1045524668 1 c sys/src/cmd/auth/login.c - 664 sys sys 1045524275 3959
+1045530070 0 c sys/src/cmd/vnc/exportfs.c - 664 sys sys 1045529366 13666
+1045530070 1 c sys/src/cmd/vnc/mkfile - 664 sys sys 1045529367 661
+1045530553 0 c sys/src/9/port/master - 664 sys sys 1045530270 341
+1045530553 1 a sys/src/9/port/mkfile - 664 sys sys 1045530270 264
+1045530553 2 c sys/src/9/port/devfs.c - 664 sys sys 1045530194 10701
+1045533673 0 c sys/src/9/port/master - 664 sys sys 1045531976 348
+1045533673 1 c sys/src/9/port/mkfile - 664 sys sys 1045531976 266
+1045535473 0 c sys/src/cmd/mkfile - 664 sys sys 1045534751 2205
+1045536479 0 c sys/src/fs/choline/mkfile - 664 sys sys 1045536422 1673
+1045536479 1 c sys/src/fs/emelie/mkfile - 664 sys sys 1045536445 1693
+1045536479 2 c sys/src/fs/roro/mkfile - 664 sys sys 1045536462 1647
+1045537262 0 c sys/src/boot/alphapc/mkfile - 664 sys sys 1045537256 449
+1045538237 0 c 386/9loaddebug - 775 sys sys 1045538097 259969
+1045538237 1 c 386/9loadlitedebug - 775 sys sys 1045538098 183665
+1045538237 2 c 386/9pc - 775 sys sys 1045538102 1791779
+1045538237 3 c 386/9pccpu - 775 sys sys 1045538106 1455620
+1045538237 4 c 386/9pcdisk - 775 sys sys 1045538111 1995668
+1045538237 5 c 386/bin/8a - 775 sys sys 1045537931 113390
+1045538237 6 c 386/bin/8c - 775 sys sys 1045537931 298708
+1045538237 7 c 386/bin/8l - 775 sys sys 1045537932 107923
+1045538237 8 c 386/bin/9660srv - 775 sys sys 1045537932 105209
+1045538237 9 c 386/bin/aan - 775 sys sys 1045537933 128318
+1045538237 10 c 386/bin/acid - 775 sys sys 1045537934 377954
+1045538237 11 c 386/bin/acme - 775 sys sys 1045537935 416883
+1045538237 12 c 386/bin/ar - 775 sys sys 1045537937 113125
+1045538237 13 c 386/bin/archfs - 775 sys sys 1045537938 141436
+1045538237 14 c 386/bin/awk - 775 sys sys 1045537963 319638
+1045538237 15 c 386/bin/bind - 775 sys sys 1045537963 58305
+1045538237 16 c 386/bin/bitsy/bitsyload - 775 sys sys 1045537963 62107
+1045538237 17 c 386/bin/bitsy/keyboard - 775 sys sys 1045537964 301457
+1045538237 18 c 386/bin/bitsy/pencal - 775 sys sys 1045537965 115172
+1045538237 19 c 386/bin/bitsy/prompter - 775 sys sys 1045537965 283641
+1045538237 20 c 386/bin/bzip2 - 775 sys sys 1045537966 112670
+1045538237 21 c 386/bin/calendar - 775 sys sys 1045537966 78193
+1045538237 22 c 386/bin/cdfs - 775 sys sys 1045537967 161880
+1045538237 23 c 386/bin/cfs - 775 sys sys 1045537967 129059
+1045538237 24 c 386/bin/chmod - 775 sys sys 1045537967 61739
+1045538237 25 c 386/bin/clock - 775 sys sys 1045537968 155230
+1045538237 26 c 386/bin/colors - 775 sys sys 1045537968 147404
+1045538237 27 c 386/bin/cp - 775 sys sys 1045537969 62690
+1045538237 28 c 386/bin/cpp - 775 sys sys 1045537969 148380
+1045538237 29 c 386/bin/db - 775 sys sys 1045537970 323629
+1045538237 30 c 386/bin/dc - 775 sys sys 1045537970 97871
+1045538237 31 c 386/bin/deroff - 775 sys sys 1045537971 73202
+1045538237 32 c 386/bin/diff - 775 sys sys 1045537971 82265
+1045538237 33 c 386/bin/dossrv - 775 sys sys 1045537975 139903
+1045538237 34 c 386/bin/du - 775 sys sys 1045537975 63067
+1045538237 35 c 386/bin/ed - 775 sys sys 1045537975 92166
+1045538237 36 c 386/bin/exportfs - 775 sys sys 1045537976 145636
+1045538237 37 c 386/bin/faces - 775 sys sys 1045537977 189109
+1045538237 38 c 386/bin/gunzip - 775 sys sys 1045538012 79921
+1045538237 39 c 386/bin/gzip - 775 sys sys 1045538013 84018
+1045538237 40 c 386/bin/hget - 775 sys sys 1045538014 216242
+1045538237 41 c 386/bin/history - 775 sys sys 1045538014 72138
+1045538237 42 c 386/bin/htmlfmt - 775 sys sys 1045538015 158912
+1045538237 43 c 386/bin/idiff - 775 sys sys 1045538015 75495
+1045538237 44 c 386/bin/lnfs - 775 sys sys 1045538028 100759
+1045538237 45 c 386/bin/nntpfs - 775 sys sys 1045538038 161729
+1045538237 46 c 386/bin/png - 775 sys sys 1045538041 158163
+1045538237 47 c 386/bin/replica/applychanges - 775 sys sys 1045538045 99047
+1045538237 48 c 386/bin/replica/applylog - 775 sys sys 1045538046 99757
+1045538237 49 c 386/bin/replica/updatedb - 775 sys sys 1045538046 95942
+1045538237 50 c 386/bin/rtstats - 775 sys sys 1045538048 177343
+1045538237 51 c 386/bin/snap - 775 sys sys 1045538051 288724
+1045538237 52 c 386/bin/snapfs - 775 sys sys 1045538052 359389
+1045538237 53 c 386/bin/srvold9p - 775 sys sys 1045538056 130539
+1045538237 54 c 386/bin/unzip - 775 sys sys 1045538067 90110
+1045538237 55 c 386/bin/usb/usbaudio - 775 sys sys 1045538078 175445
+1045538237 56 c 386/bin/usb/usbd - 775 sys sys 1045538079 122021
+1045538237 57 c 386/bin/usb/usbmouse - 775 sys sys 1045538079 137425
+1045538237 58 c 386/bin/venti/buildindex - 775 sys sys 1045538081 157283
+1045538237 59 c 386/bin/venti/checkarenas - 775 sys sys 1045538081 159635
+1045538237 60 c 386/bin/venti/checkindex - 775 sys sys 1045538082 158089
+1045538237 61 c 386/bin/venti/clumpstats - 775 sys sys 1045538082 147284
+1045538237 62 c 386/bin/venti/copy - 775 sys sys 1045538083 104274
+1045538237 63 c 386/bin/venti/findscore - 775 sys sys 1045538083 131060
+1045538237 64 c 386/bin/venti/fmtarenas - 775 sys sys 1045538084 132914
+1045538237 65 c 386/bin/venti/fmtindex - 775 sys sys 1045538084 146114
+1045538237 66 c 386/bin/venti/fmtisect - 775 sys sys 1045538085 147539
+1045538237 67 c 386/bin/venti/rdarena - 775 sys sys 1045538085 130806
+1045538237 68 c 386/bin/venti/read - 775 sys sys 1045538086 100640
+1045538237 69 c 386/bin/venti/sync - 775 sys sys 1045538086 99790
+1045538237 70 c 386/bin/venti/syncindex - 775 sys sys 1045538087 172636
+1045538237 71 c 386/bin/venti/venti - 775 sys sys 1045538087 249410
+1045538237 72 c 386/bin/venti/verifyarena - 775 sys sys 1045538088 105156
+1045538237 73 c 386/bin/venti/wrarena - 775 sys sys 1045538089 178907
+1045538237 74 c 386/bin/venti/write - 775 sys sys 1045538089 100592
+1045538237 75 c 386/bin/vncs - 775 sys sys 1045538091 437972
+1045538237 76 c 386/bin/vncv - 775 sys sys 1045538091 266167
+1045538237 77 c 386/bin/webcookies - 775 sys sys 1045538093 161704
+1045538237 78 c 386/bin/wikifs - 775 sys sys 1045538095 196298
+1045538237 79 c 386/bin/zip - 775 sys sys 1045538096 89317
+1045538237 80 c 386/bin/file - 775 sys sys 1045537977 117151
+1045538237 81 c 386/bin/fortune - 775 sys sys 1045537977 66332
+1045538237 82 c 386/bin/ftpfs - 775 sys sys 1045537980 149042
+1045538237 83 c 386/bin/gif - 775 sys sys 1045537981 156120
+1045538237 84 c 386/bin/grap - 775 sys sys 1045537981 278460
+1045538237 85 c 386/bin/graph - 775 sys sys 1045537982 127364
+1045538237 86 c 386/bin/gs - 775 sys sys 1045538012 11099657
+1045538237 87 c 386/bin/hayes - 775 sys sys 1045538013 63555
+1045538237 88 c 386/bin/hoc - 775 sys sys 1045538014 98958
+1045538237 89 c 386/bin/import - 775 sys sys 1045538015 87318
+1045538237 90 c 386/bin/iostats - 775 sys sys 1045538016 98803
+1045538237 91 c 386/bin/join - 775 sys sys 1045538026 114439
+1045538237 92 c 386/bin/jpg - 775 sys sys 1045538027 172815
+1045538237 93 c 386/bin/kprof - 775 sys sys 1045538027 101902
+1045538237 94 c 386/bin/ktrace - 775 sys sys 1045538028 115129
+1045538237 95 c 386/bin/lens - 775 sys sys 1045538028 122376
+1045538237 96 c 386/bin/ls - 775 sys sys 1045538029 80925
+1045538237 97 c 386/bin/mc - 775 sys sys 1045538029 129044
+1045538237 98 c 386/bin/mk - 775 sys sys 1045538030 141372
+1045538237 99 c 386/bin/mkdir - 775 sys sys 1045538030 57839
+1045538237 100 c 386/bin/mount - 775 sys sys 1045538031 71035
+1045538237 101 c 386/bin/ms2html - 775 sys sys 1045538031 102447
+1045538237 102 c 386/bin/mv - 775 sys sys 1045538032 64996
+1045538237 103 c 386/bin/netstat - 775 sys sys 1045538036 81379
+1045538237 104 c 386/bin/news - 775 sys sys 1045538036 70512
+1045538237 105 c 386/bin/nm - 775 sys sys 1045538037 123227
+1045538237 106 c 386/bin/page - 775 sys sys 1045538038 215658
+1045538237 107 c 386/bin/pic - 775 sys sys 1045538039 303251
+1045538237 108 c 386/bin/plot - 775 sys sys 1045538040 219623
+1045538237 109 c 386/bin/plumber - 775 sys sys 1045538041 169961
+1045538237 110 c 386/bin/ppm - 775 sys sys 1045538042 147179
+1045538237 111 c 386/bin/pr - 775 sys sys 1045538042 76440
+1045538237 112 c 386/bin/prof - 775 sys sys 1045538043 106378
+1045538237 113 c 386/bin/proof - 775 sys sys 1045538044 175773
+1045538237 114 c 386/bin/ramfs - 775 sys sys 1045538044 89923
+1045538237 115 c 386/bin/rc - 775 sys sys 1045538044 140122
+1045538237 116 c 386/bin/rdbfs - 775 sys sys 1045538045 169167
+1045538237 117 c 386/bin/rio - 775 sys sys 1045538047 302877
+1045538237 118 c 386/bin/rm - 775 sys sys 1045538047 60036
+1045538237 119 c 386/bin/rx - 775 sys sys 1045538048 78437
+1045538237 120 c 386/bin/sam - 775 sys sys 1045538049 156896
+1045538237 121 c 386/bin/scat - 775 sys sys 1045538050 282041
+1045538237 122 c 386/bin/scp - 775 sys sys 1045538050 159554
+1045538237 123 c 386/bin/size - 775 sys sys 1045538050 76295
+1045538237 124 c 386/bin/snoopy - 775 sys sys 1045538053 153925
+1045538237 125 c 386/bin/spin - 775 sys sys 1045538055 652380
+1045538237 126 c 386/bin/split - 775 sys sys 1045538055 74227
+1045538237 127 c 386/bin/srv - 775 sys sys 1045538056 80168
+1045538237 128 c 386/bin/ssh - 775 sys sys 1045538057 209753
+1045538237 129 c 386/bin/stats - 775 sys sys 1045538058 186569
+1045538237 130 c 386/bin/strip - 775 sys sys 1045538058 60829
+1045538237 131 c 386/bin/swap - 775 sys sys 1045538059 60847
+1045538237 132 c 386/bin/vtdump - 775 sys sys 1045538093 160937
+1045538237 133 c 386/bin/webfs - 775 sys sys 1045538094 346822
+1045538237 134 c 386/bin/winwatch - 775 sys sys 1045538096 141063
+1045538237 135 c 386/bin/ape/cc - 775 sys sys 1045537935 68930
+1045538237 136 c 386/bin/ape/make - 775 sys sys 1045537935 205170
+1045538237 137 c 386/bin/ape/sh - 775 sys sys 1045537937 477563
+1045538237 138 c 386/bin/auth/aescbc - 775 sys sys 1045537938 120957
+1045538237 139 c 386/bin/auth/authsrv - 775 sys sys 1045537939 161978
+1045538237 140 c 386/bin/auth/changeuser - 775 sys sys 1045537939 96090
+1045538237 141 c 386/bin/auth/convkeys - 775 sys sys 1045537939 84016
+1045538237 142 c 386/bin/auth/convkeys2 - 775 sys sys 1045537940 84036
+1045538237 143 c 386/bin/auth/cron - 775 sys sys 1045537940 140015
+1045538237 144 c 386/bin/auth/debug - 775 sys sys 1045537941 98167
+1045538237 145 c 386/bin/auth/factotum - 775 sys sys 1045537941 305369
+1045538237 146 c 386/bin/auth/fgui - 775 sys sys 1045537942 211917
+1045538237 147 c 386/bin/auth/guard.srv - 775 sys sys 1045537943 139879
+1045538237 148 c 386/bin/auth/keyfs - 775 sys sys 1045537943 114313
+1045538237 149 c 386/bin/auth/login - 775 sys sys 1045537944 100738
+1045538237 150 c 386/bin/auth/secretpem - 775 sys sys 1045537944 118526
+1045538237 151 c 386/bin/auth/secstore - 775 sys sys 1045537945 186312
+1045538237 152 c 386/bin/auth/secstored - 775 sys sys 1045537945 193098
+1045538237 153 c 386/bin/auth/secuser - 775 sys sys 1045537946 149562
+1045538237 154 c 386/bin/auth/warning - 775 sys sys 1045537946 97726
+1045538237 155 c 386/bin/aux/LOCK - 775 sys sys 1045537946 58692
+1045538237 156 c 386/bin/aux/X509gen - 775 sys sys 1045537947 126470
+1045538237 157 c 386/bin/aux/apm - 775 sys sys 1045537947 174544
+1045538237 158 c 386/bin/aux/consolefs - 775 sys sys 1045537948 153752
+1045538237 159 c 386/bin/aux/depend - 775 sys sys 1045537948 145890
+1045538237 160 c 386/bin/aux/disksim - 775 sys sys 1045537949 144655
+1045538237 161 c 386/bin/aux/faxreceive - 775 sys sys 1045537949 83421
+1045538237 162 c 386/bin/aux/faxsend - 775 sys sys 1045537950 88819
+1045538237 163 c 386/bin/aux/flashfs - 775 sys sys 1045537950 160526
+1045538237 164 c 386/bin/aux/listen - 775 sys sys 1045537950 104214
+1045538237 165 c 386/bin/aux/listen1 - 775 sys sys 1045537951 91097
+1045538237 166 c 386/bin/aux/lpdaemon - 775 sys sys 1045537951 167847
+1045538237 167 c 386/bin/aux/mapd - 775 sys sys 1045537952 190971
+1045538237 168 c 386/bin/aux/mkflashfs - 775 sys sys 1045537952 66243
+1045538237 169 c 386/bin/aux/mnihongo - 775 sys sys 1045537952 136431
+1045538237 170 c 386/bin/aux/ms2 - 775 sys sys 1045537953 84053
+1045538237 171 c 386/bin/aux/na - 775 sys sys 1045537953 152774
+1045538237 172 c 386/bin/aux/nfsserver - 775 sys sys 1045537954 171046
+1045538237 173 c 386/bin/aux/olefs - 775 sys sys 1045537954 144352
+1045538237 174 c 386/bin/aux/pcnfsd - 775 sys sys 1045537955 126750
+1045538237 175 c 386/bin/aux/portmapper - 775 sys sys 1045537955 125638
+1045538237 176 c 386/bin/aux/reboot - 775 sys sys 1045537955 59052
+1045538237 177 c 386/bin/aux/samterm - 775 sys sys 1045537956 244816
+1045538237 178 c 386/bin/aux/searchfs - 775 sys sys 1045537956 90977
+1045538237 179 c 386/bin/aux/ssh_genkey - 775 sys sys 1045537957 194629
+1045538237 180 c 386/bin/aux/sshserve - 775 sys sys 1045537958 246584
+1045538237 181 c 386/bin/aux/stub - 775 sys sys 1045537958 135076
+1045538237 182 c 386/bin/aux/tcpostio - 775 sys sys 1045537959 199727
+1045538237 183 c 386/bin/aux/timesync - 775 sys sys 1045537959 127114
+1045538237 184 c 386/bin/aux/tr2post - 775 sys sys 1045537960 175522
+1045538237 185 c 386/bin/aux/trampoline - 775 sys sys 1045537960 81157
+1045538237 186 c 386/bin/aux/typepasswd - 775 sys sys 1045537960 68154
+1045538237 187 c 386/bin/aux/vga - 775 sys sys 1045537961 299475
+1045538237 188 c 386/bin/aux/vmware - 775 sys sys 1045537961 298
+1045538237 189 c 386/bin/aux/vmwarefs - 775 sys sys 1045537962 102172
+1045538237 190 c 386/bin/disk/dump9660 - 775 sys sys 1045537971 151530
+1045538237 191 c 386/bin/disk/fdisk - 775 sys sys 1045537972 106865
+1045538237 192 c 386/bin/disk/format - 775 sys sys 1045537972 91869
+1045538237 193 c 386/bin/disk/kfs - 775 sys sys 1045537973 247159
+1045538237 194 c 386/bin/disk/mbr - 775 sys sys 1045537973 72337
+1045538237 195 c 386/bin/disk/mkext - 775 sys sys 1045537974 77821
+1045538237 196 c 386/bin/disk/mkfs - 775 sys sys 1045537974 87447
+1045538237 197 c 386/bin/disk/prep - 775 sys sys 1045537974 98786
+1045538237 198 c 386/bin/execnet - 775 sys sys 1045537976 172468
+1045538237 199 c 386/bin/fossil/flchk - 775 sys sys 1045537978 226819
+1045538237 200 c 386/bin/fossil/flfmt - 775 sys sys 1045537979 225404
+1045538237 201 c 386/bin/fossil/fossil - 775 sys sys 1045537980 329940
+1045538237 202 c 386/bin/ip/dhcpclient - 775 sys sys 1045538016 91665
+1045538237 203 c 386/bin/ip/dhcpd - 775 sys sys 1045538017 144977
+1045538237 204 c 386/bin/ip/dhcpleases - 775 sys sys 1045538017 84658
+1045538237 205 c 386/bin/ip/ftpd - 775 sys sys 1045538018 166805
+1045538237 206 c 386/bin/ip/gping - 775 sys sys 1045538018 179663
+1045538237 207 c 386/bin/ip/httpd/httpd - 775 sys sys 1045538019 283990
+1045538237 208 c 386/bin/ip/httpd/imagemap - 775 sys sys 1045538020 113660
+1045538237 209 c 386/bin/ip/httpd/man2html - 775 sys sys 1045538020 121928
+1045538237 210 c 386/bin/ip/httpd/save - 775 sys sys 1045538021 130989
+1045538237 211 c 386/bin/ip/httpd/wikipost - 775 sys sys 1045538021 111347
+1045538237 212 c 386/bin/ip/imap4d - 775 sys sys 1045538022 232677
+1045538237 213 c 386/bin/ip/ipconfig - 775 sys sys 1045538022 103751
+1045538237 214 c 386/bin/ip/ppp - 775 sys sys 1045538023 212162
+1045538237 215 c 386/bin/ip/pptp - 775 sys sys 1045538023 123280
+1045538237 216 c 386/bin/ip/pptpd - 775 sys sys 1045538024 123603
+1045538237 217 c 386/bin/ip/rarpd - 775 sys sys 1045538024 107221
+1045538237 218 c 386/bin/ip/rexexec - 775 sys sys 1045538024 86659
+1045538237 219 c 386/bin/ip/rlogind - 775 sys sys 1045538025 66387
+1045538237 220 c 386/bin/ip/telnetd - 775 sys sys 1045538025 120153
+1045538237 221 c 386/bin/ip/tftpd - 775 sys sys 1045538025 102539
+1045538237 222 c 386/bin/mkpaqfs - 775 sys sys 1045538030 93494
+1045538237 223 c 386/bin/mntgen - 775 sys sys 1045538031 135882
+1045538237 224 c 386/bin/mtime - 775 sys sys 1045538032 57878
+1045538237 225 c 386/bin/ndb/cs - 775 sys sys 1045538033 143190
+1045538237 226 c 386/bin/ndb/dns - 775 sys sys 1045538033 211008
+1045538237 227 c 386/bin/ndb/dnsdebug - 775 sys sys 1045538034 186001
+1045538237 228 c 386/bin/ndb/dnstcp - 775 sys sys 1045538034 184825
+1045538237 229 c 386/bin/ndb/ipquery - 775 sys sys 1045538035 91678
+1045538237 230 c 386/bin/ndb/mkhash - 775 sys sys 1045538035 82294
+1045538237 231 c 386/bin/ndb/mkhosts - 775 sys sys 1045538035 83238
+1045538237 232 c 386/bin/ndb/query - 775 sys sys 1045538036 81036
+1045538237 233 c 386/bin/paqfs - 775 sys sys 1045538039 108076
+1045538237 234 c 386/bin/sshnet - 775 sys sys 1045538058 283791
+1045538237 235 c 386/bin/tail - 775 sys sys 1045538059 64885
+1045538237 236 c 386/bin/tar - 775 sys sys 1045538059 81328
+1045538237 237 c 386/bin/tcs - 775 sys sys 1045538060 257039
+1045538237 238 c 386/bin/telco - 775 sys sys 1045538061 105058
+1045538237 239 c 386/bin/telnet - 775 sys sys 1045538061 80803
+1045538237 240 c 386/bin/test - 775 sys sys 1045538061 63916
+1045538237 241 c 386/bin/tlsclient - 775 sys sys 1045538062 191932
+1045538237 242 c 386/bin/tlssrv - 775 sys sys 1045538062 192262
+1045538237 243 c 386/bin/togif - 775 sys sys 1045538063 188996
+1045538237 244 c 386/bin/toppm - 775 sys sys 1045538064 164433
+1045538237 245 c 386/bin/tprof - 775 sys sys 1045538064 273469
+1045538237 246 c 386/bin/troff - 775 sys sys 1045538065 355718
+1045538237 247 c 386/bin/tweak - 775 sys sys 1045538066 190337
+1045538237 248 c 386/bin/upas/aliasmail - 775 sys sys 1045538067 100882
+1045538237 249 c 386/bin/upas/deliver - 775 sys sys 1045538067 68848
+1045538237 250 c 386/bin/upas/filter - 775 sys sys 1045538068 145562
+1045538237 251 c 386/bin/upas/fs - 775 sys sys 1045538069 326385
+1045538237 252 c 386/bin/upas/list - 775 sys sys 1045538069 81422
+1045538237 253 c 386/bin/upas/marshal - 775 sys sys 1045538070 128508
+1045538237 254 c 386/bin/upas/ml - 775 sys sys 1045538070 118096
+1045538237 255 c 386/bin/upas/mlmgr - 775 sys sys 1045538070 100993
+1045538237 256 c 386/bin/upas/mlowner - 775 sys sys 1045538071 92134
+1045538237 257 c 386/bin/upas/nedmail - 775 sys sys 1045538071 148496
+1045538237 258 c 386/bin/upas/pop3 - 775 sys sys 1045538072 251655
+1045538237 259 c 386/bin/upas/qer - 775 sys sys 1045538073 98523
+1045538237 260 c 386/bin/upas/ratfs - 775 sys sys 1045538073 112392
+1045538237 261 c 386/bin/upas/runq - 775 sys sys 1045538073 111308
+1045538237 262 c 386/bin/upas/scanmail - 775 sys sys 1045538074 127744
+1045538237 263 c 386/bin/upas/send - 775 sys sys 1045538075 188625
+1045538237 264 c 386/bin/upas/smtp - 775 sys sys 1045538075 264858
+1045538237 265 c 386/bin/upas/smtpd - 775 sys sys 1045538076 307506
+1045538237 266 c 386/bin/upas/testscan - 775 sys sys 1045538077 82381
+1045538237 267 c 386/bin/upas/vf - 775 sys sys 1045538077 90532
+1045538237 268 c 386/bin/vac - 775 sys sys 1045538080 171324
+1045538237 269 c 386/bin/vacfs - 775 sys sys 1045538080 177522
+1045538237 270 c 386/bin/vt - 775 sys sys 1045538092 170883
+1045538237 271 c 386/bin/yacc - 775 sys sys 1045538096 100853
+1045538237 272 c 386/lib/lib9p.a - 664 sys sys 1045538115 80508
+1045538237 273 c 386/lib/libString.a - 664 sys sys 1045538115 18554
+1045538237 274 c 386/lib/libauth.a - 664 sys sys 1045538115 52988
+1045538237 275 c 386/lib/libauthsrv.a - 664 sys sys 1045538115 31942
+1045538237 276 c 386/lib/libbin.a - 664 sys sys 1045538115 2556
+1045538237 277 c 386/lib/libbio.a - 664 sys sys 1045538115 28390
+1045538237 278 c 386/lib/libc.a - 664 sys sys 1045538117 496970
+1045538237 279 c 386/lib/libcontrol.a - 664 sys sys 1045538117 243448
+1045538237 280 c 386/lib/libdisk.a - 664 sys sys 1045538118 43692
+1045538237 281 c 386/lib/libdraw.a - 664 sys sys 1045538119 372606
+1045538237 282 c 386/lib/libflate.a - 664 sys sys 1045538119 77880
+1045538237 283 c 386/lib/libframe.a - 664 sys sys 1045538119 65832
+1045538237 284 c 386/lib/libgeometry.a - 664 sys sys 1045538120 50806
+1045538237 285 c 386/lib/libhtml.a - 664 sys sys 1045538120 220944
+1045538237 286 c 386/lib/libhttpd.a - 664 sys sys 1045538121 98914
+1045538237 287 c 386/lib/libip.a - 664 sys sys 1045538121 32560
+1045538237 288 c 386/lib/libl.a - 664 sys sys 1045538121 5412
+1045538237 289 c 386/lib/libmach.a - 664 sys sys 1045538123 743792
+1045538237 290 c 386/lib/libmemdraw.a - 664 sys sys 1045538124 292324
+1045538237 291 c 386/lib/libmemlayer.a - 664 sys sys 1045538125 47116
+1045538237 292 c 386/lib/libmp.a - 664 sys sys 1045538125 77064
+1045538237 293 c 386/lib/libndb.a - 664 sys sys 1045538125 52836
+1045538237 294 c 386/lib/libplumb.a - 664 sys sys 1045538125 19000
+1045538237 295 c 386/lib/libregexp.a - 664 sys sys 1045538126 37356
+1045538237 296 c 386/lib/libscribble.a - 664 sys sys 1045538126 108138
+1045538237 297 c 386/lib/libsec.a - 664 sys sys 1045538128 635686
+1045538237 298 c 386/lib/libstdio.a - 664 sys sys 1045538128 125144
+1045538237 299 c 386/lib/libthread.a - 664 sys sys 1045538129 71494
+1045538237 300 c 386/lib/libventi.a - 664 sys sys 1045538129 97938
+1045538237 301 c acme/bin/386/News - 775 sys sys 1045538112 126431
+1045538237 302 c acme/bin/386/Wiki - 775 sys sys 1045538113 124615
+1045538237 303 a acme/bin/386/mkwnew - 775 sys sys 1045538113 39475
+1045538237 304 c acme/bin/386/spout - 775 sys sys 1045538113 60277
+1045538237 305 c acme/bin/386/win - 775 sys sys 1045538114 178505
+1045538237 306 c acme/mail/386/Mail - 775 sys sys 1045538114 176629
+1045538237 307 c sys/lib/man/lookman/index - 664 sys sys 1045538133 1405018
+1045538237 308 c sys/man/1/INDEX - 664 sys sys 1045538129 2900
+1045538237 309 c sys/man/2/INDEX - 664 sys sys 1045538129 20216
+1045538237 310 c sys/man/8/INDEX - 664 sys sys 1045538129 2512

+ 31 - 11
rc/bin/C

@@ -1,27 +1,47 @@
 #!/bin/rc
 #!/bin/rc
 
 
 rfork n
 rfork n
+oflag=()
+while(~ $1 -*)
+	switch($1){
+	case -r
+		shift
+		opt=''
+	case -O -o
+		oflag=-O
+		shift
+	case *
+		opt=-r
+		shift
+	}
+
 switch($1){
 switch($1){
-case -r
-	shift
-	opt=''
-case *
-	opt=-r
+case erika
+	exec C office1
+	exit
 }
 }
 
 
-# change to console server
-# may want to use a switch on the 
-# machine name to support multiple
-# console servers
+# look for server in /lib/ndb
+server=`{ndb/query sys $1 console}
+switch($server){
+case ''
+	echo C: unknown console server for $1
+	exit 1
+}
 
 
-server=$sysname
+# can't cpu to old servers any more
+switch($server){
+case dinar bones
+	ssh $server C $1
+	exit 0
+}
 
 
 if(! test -e /mnt/consoles/$1){
 if(! test -e /mnt/consoles/$1){
 	switch($sysname){
 	switch($sysname){
 	case $server
 	case $server
 		mount /srv/consoles /mnt/consoles
 		mount /srv/consoles /mnt/consoles
 	case *
 	case *
-		import $server /mnt/consoles
+		import $oflag $server /mnt/consoles
 	}
 	}
 }
 }
 
 

+ 1 - 1
rc/bin/mail

@@ -5,7 +5,7 @@ case 0
 }
 }
 
 
 switch($1){
 switch($1){
-case -f* -r* -c* -m* -n*
+case -f* -r* -c* -m*
 	exec upas/nedmail $*
 	exec upas/nedmail $*
 case *
 case *
 	exec upas/marshal $*
 	exec upas/marshal $*

+ 1 - 1
rc/bin/replica/pull

@@ -20,7 +20,7 @@ must clientmount
 n=`{ls -l $clientlog >[2]/dev/null |awk '{print $6}'}
 n=`{ls -l $clientlog >[2]/dev/null |awk '{print $6}'}
 s=`{ls -l $serverlog >[2]/dev/null |awk '{print $6}'}
 s=`{ls -l $serverlog >[2]/dev/null |awk '{print $6}'}
 if(~ $n 0 || ~ $#n 0 || test $s -lt $n){
 if(~ $n 0 || ~ $#n 0 || test $s -lt $n){
-	must rm $clientlog
+	if(test -e $clientlog) must rm $clientlog
 	must cp $serverlog $clientlog
 	must cp $serverlog $clientlog
 }
 }
 if not{
 if not{

+ 1 - 1
rc/bin/troff2gif

@@ -1,2 +1,2 @@
 #!/bin/rc
 #!/bin/rc
-{/bin/troff|/bin/lp -dstdout|/bin/gs -dNOPAUSE -dQUIET '-sOUTPUTFILE='/fd/1 '-sDEVICE=plan9bm' - quit.ps| crop -c 255 255 255 | togif}  >[2] /dev/null
+{grap|pic|tbl|eqn|/bin/troff|/bin/lp -dstdout|/bin/gs -dNOPAUSE -dQUIET '-sOUTPUTFILE='/fd/1 '-sDEVICE=plan9bm' - quit.ps| crop -c 255 255 255 | togif}  >[2] /dev/null

+ 3 - 1
rc/bin/window

@@ -73,7 +73,6 @@ if(~ $1 -m){
 	{
 	{
 		if(mount $srv $dir 'new -pid '^`{cat /dev/ppid}^' '$"*){
 		if(mount $srv $dir 'new -pid '^`{cat /dev/ppid}^' '$"*){
 			bind -b $dir /dev
 			bind -b $dir /dev
-			echo -n `{basename $1} > /dev/label >[2] /dev/null
 			# toss geometry parameters to find command
 			# toss geometry parameters to find command
 			while(~ $1 -*)
 			while(~ $1 -*)
 				switch($1){
 				switch($1){
@@ -81,9 +80,12 @@ if(~ $1 -m){
 					shift 2
 					shift 2
 				case -r
 				case -r
 					shift 5
 					shift 5
+				case -hide
+					shift
 				}
 				}
 			if(~ $#* 0) cmd = rc
 			if(~ $#* 0) cmd = rc
 			if not cmd = $*
 			if not cmd = $*
+			echo -n `{basename $cmd(1)} > /dev/label >[2] /dev/null
 			exec $cmd < /dev/cons > /dev/cons >[2] /dev/cons
 			exec $cmd < /dev/cons > /dev/cons >[2] /dev/cons
 		}
 		}
 	}&
 	}&

+ 2 - 0
sys/games/lib/fortunes

@@ -3860,3 +3860,5 @@ MOZILLA_FIVE_HOME=/opt/netscape-6.2.3-us
 If you haven't heard of XML yet, you must be living under a rock!  - Programming in the .NET Environment
 If you haven't heard of XML yet, you must be living under a rock!  - Programming in the .NET Environment
 The second line computes the sinus of the result.  - Programming in the .NET Environment
 The second line computes the sinus of the result.  - Programming in the .NET Environment
 Where would Christianity be if Jesus got eight to fifteen years, with time off for good behavior? -- New York Senator James H. Donovan on capital punishment. 
 Where would Christianity be if Jesus got eight to fifteen years, with time off for good behavior? -- New York Senator James H. Donovan on capital punishment. 
+rsc            5202    0:00   0:00 1710768K Rendez   8.portmapd
+http://www.fortunecookieadvertising.com

+ 3 - 0
sys/include/thread.h

@@ -98,6 +98,9 @@ int		threadpid(int);
 int		threadsetgrp(int);	/* set thread group, return old */
 int		threadsetgrp(int);	/* set thread group, return old */
 void		threadsetname(char *name);
 void		threadsetname(char *name);
 Channel*	threadwaitchan(void);
 Channel*	threadwaitchan(void);
+int	tprivalloc(void);
+void	tprivfree(int);
+void	**tprivaddr(int);
 void		yield(void);
 void		yield(void);
 
 
 extern	int		mainstacksize;
 extern	int		mainstacksize;

+ 12 - 1
sys/include/venti.h

@@ -141,6 +141,15 @@ int vtErrFmt(Fmt *fmt);
 void vtDebug(VtSession*, char *, ...);
 void vtDebug(VtSession*, char *, ...);
 void vtDebugMesg(VtSession *z, Packet *p, char *s);
 void vtDebugMesg(VtSession *z, Packet *p, char *s);
 
 
+/* internal */
+VtSession *vtAlloc(void);
+void vtReset(VtSession*);
+int vtAddString(Packet*, char*);
+int vtGetString(Packet*, char**);
+int vtSendPacket(VtSession*, Packet*);
+Packet *vtRecvPacket(VtSession*);
+void vtDisconnect(VtSession*, int);
+int vtHello(VtSession*);
 
 
 /* client side */
 /* client side */
 VtSession *vtClientAlloc(void);
 VtSession *vtClientAlloc(void);
@@ -157,6 +166,7 @@ int vtSync(VtSession *s);
 
 
 int vtZeroExtend(int type, uchar *buf, int n, int nn);
 int vtZeroExtend(int type, uchar *buf, int n, int nn);
 int vtZeroTruncate(int type, uchar *buf, int n);
 int vtZeroTruncate(int type, uchar *buf, int n);
+int vtParseScore(char*, uint, uchar[VtScoreSize]);
 
 
 void vtRootPack(VtRoot*, uchar*);
 void vtRootPack(VtRoot*, uchar*);
 int vtRootUnpack(VtRoot*, uchar*);
 int vtRootUnpack(VtRoot*, uchar*);
@@ -219,7 +229,7 @@ int vtThread(void (*f)(void*), void *rock);
 void vtThreadSetName(char*);
 void vtThreadSetName(char*);
 
 
 VtLock *vtLockAlloc(void);
 VtLock *vtLockAlloc(void);
-void vtLockInit(VtLock**);
+/* void vtLockInit(VtLock**); */
 void vtLock(VtLock*);
 void vtLock(VtLock*);
 int vtCanLock(VtLock*);
 int vtCanLock(VtLock*);
 void vtRLock(VtLock*);
 void vtRLock(VtLock*);
@@ -252,3 +262,4 @@ int vtFdWrite(int, uchar*, int);
 #pragma	varargck	type	"R"		void
 #pragma	varargck	type	"R"		void
 
 
 #pragma	varargck	argpos	vtSetError	1
 #pragma	varargck	argpos	vtSetError	1
+

+ 1 - 1
sys/lib/dist/pc/inst/mountdist

@@ -171,7 +171,7 @@ case go
 			echo '	exit			- exit shell'
 			echo '	exit			- exit shell'
 			echo 
 			echo 
 			echo 'Move to the directory containing the distribution'
 			echo 'Move to the directory containing the distribution'
-			echo 'and and then exit.'
+			echo 'and then exit.'
 			echo
 			echo
 			oifs=$ifs
 			oifs=$ifs
 			ifs=$nl
 			ifs=$nl

+ 1 - 1
sys/lib/dist/pc/plan9.ini.cd

@@ -12,7 +12,7 @@ adisk=/dev/sdD0/cdboot
 cdboot=yes
 cdboot=yes
 
 
 [install]
 [install]
-nobootprompt=local!/bzroot
+nobootprompt=local!/boot/bzroot
 bootfile=sdD0!cdboot!9pcflop.gz
 bootfile=sdD0!cdboot!9pcflop.gz
 
 
 [cdboot]
 [cdboot]

+ 1 - 1
sys/lib/dist/pc/plan9.ini.vmware

@@ -1,6 +1,6 @@
 *nomp=1
 *nomp=1
 partition=new
 partition=new
-nobootprompt=local!/bzroot
+nobootprompt=local!/boot/bzroot
 bootfile=fd0!9pcflop.gz
 bootfile=fd0!9pcflop.gz
 mouseport=ps2
 mouseport=ps2
 monitor=xga
 monitor=xga

File diff suppressed because it is too large
+ 87 - 49
sys/lib/man/lookman/index


+ 1 - 0
sys/lib/mimetype

@@ -24,6 +24,7 @@
 .class		application	java		-		y # Java bytecodes
 .class		application	java		-		y # Java bytecodes
 .cpio		application	x-cpio		-		y
 .cpio		application	x-cpio		-		y
 .cpp		text		plain		-		y # DOS C++ program
 .cpp		text		plain		-		y # DOS C++ program
+.crt		application	x-x509-ca-cert	-		y # DER X.509 CA certificate
 .csv		application	vnd.ms-excel	-		y # Microsoft Excel comma-separated-values
 .csv		application	vnd.ms-excel	-		y # Microsoft Excel comma-separated-values
 .dat		text		plain		-		y # AMPL et al.
 .dat		text		plain		-		y # AMPL et al.
 .diff		text		plain		-		y
 .diff		text		plain		-		y

+ 62 - 4
sys/lib/sysconfig/proto/portproto

@@ -1,5 +1,4 @@
 adm
 adm
-	timeconst
 	timezone
 	timezone
 		*
 		*
 	users
 	users
@@ -22,19 +21,29 @@ lib
 				+
 				+
 			times
 			times
 				+
 				+
+	keyboard
 	ndb
 	ndb
 		local
 		local
+		local-cs
 		common
 		common
+		friends
 	units
 	units
 	vgadb
 	vgadb
 rc
 rc
 	+
 	+
 mail
 mail
 	fs
 	fs
+	queue
+	queue.hold
+	queue.ext
+	queue.post
+	tmp
 $cputype
 $cputype
 	init
 	init
 	bin
 	bin
 		*
 		*
+		auth
+			*
 		aux
 		aux
 			*
 			*
 		disk
 		disk
@@ -47,10 +56,18 @@ $cputype
 			*
 			*
 		upas
 		upas
 			*
 			*
+		usb
+			*
 	include
 	include
-		*
+		+
 	lib
 	lib
 		*
 		*
+		X11
+			+
+		alef
+			+
+		ape
+			+
 	mkfile
 	mkfile
 acme
 acme
 	acid
 	acid
@@ -59,17 +76,20 @@ acme
 			*
 			*
 	bin
 	bin
 		*
 		*
-	edit
-		*
 		$cputype
 		$cputype
 			*
 			*
 	mail
 	mail
 		*
 		*
 		$cputype
 		$cputype
 			*
 			*
+	news
+		*
+	wiki
+		*
 mnt
 mnt
 	acme
 	acme
 	apeselect
 	apeselect
+	apm
 	cd
 	cd
 	cons
 	cons
 		cons
 		cons
@@ -81,16 +101,23 @@ mnt
 	lp
 	lp
 	plumb
 	plumb
 	rdb
 	rdb
+	temp
 	term
 	term
+	vmware
 	wsys
 	wsys
 n
 n
+	9
 	9fat
 	9fat
+	a
+	c
+	d
 	a:
 	a:
 	c:
 	c:
 	d:
 	d:
 	boot
 	boot
 	bootes
 	bootes
 	bootesother
 	bootesother
+	choline
 	dump
 	dump
 	emelie
 	emelie
 	emelieother
 	emelieother
@@ -105,12 +132,23 @@ srv
 sys
 sys
 	include
 	include
 		*
 		*
+		ape
+			*
 	lib
 	lib
 		acid
 		acid
 			*
 			*
+		ghostscript
+			+
+		lp
+			+
+		man
+			+
+		mimetype
 		newuser
 		newuser
 		plumb
 		plumb
 			*
 			*
+		postscript
+			+
 		samsave
 		samsave
 		ssh
 		ssh
 		texmf
 		texmf
@@ -129,8 +167,19 @@ sys
 			term
 			term
 				tab.dumb
 				tab.dumb
 				tab.utf
 				tab.utf
+				tab.37
+	log
+		cs	666 sys sys	/sys/lib/pcdist/disk/empty
+		dns	666 sys sys	/sys/lib/pcdist/disk/empty
+		mail	666 sys sys	/sys/lib/pcdist/disk/empty
+		smtp	666 sys sys	/sys/lib/pcdist/disk/empty
+		smtpd	666 sys sys	/sys/lib/pcdist/disk/empty
+		listen	666 sys sys	/sys/lib/pcdist/disk/empty
+		ipboot	666 sys sys	/sys/lib/pcdist/disk/empty
 	man
 	man
 		fonts
 		fonts
+		1pub
+			*
 		1
 		1
 			*
 			*
 		2
 		2
@@ -147,5 +196,14 @@ sys
 			*
 			*
 		8
 		8
 			*
 			*
+	src
+		mkfile
+		mkfile.proto
+		cmd
+			mkfile
+			mklib
+			mkmany
+			mkone
+			mksyslib
 tmp
 tmp
 usr
 usr

+ 4 - 0
sys/lib/tls/README

@@ -2,6 +2,10 @@ By convention, the owner of a file here defines the policy for
 adding entries;  please send email to request additions, so that
 adding entries;  please send email to request additions, so that
 some consistency can be maintained.
 some consistency can be maintained.
 
 
+Thus, the postmaster will maintain in /sys/lib/tls/mail the thumbprint,
+i.e. the SHA-1 checksum of the mail server's X.509 certificate, for
+services that are locally considered trusted for IMAPS.
+
 SEE ALSO
 SEE ALSO
 okThumbprint(2)
 okThumbprint(2)
 sha1sum(1)
 sha1sum(1)

+ 0 - 2
sys/man/1/INDEX

@@ -39,7 +39,6 @@ kl 2l
 ql 2l
 ql 2l
 vl 2l
 vl 2l
 xl 2l
 xl 2l
-aan aan
 acid acid
 acid acid
 trump acid
 trump acid
 truss acid
 truss acid
@@ -260,7 +259,6 @@ tbl tbl
 tcs tcs
 tcs tcs
 tee tee
 tee tee
 iwhois tel
 iwhois tel
-ppq tel
 tel tel
 tel tel
 test test
 test test
 time time
 time time

+ 16 - 1
sys/man/1/faces

@@ -5,6 +5,9 @@ faces, seemail, vwhois \-  mailbox interface
 .B faces
 .B faces
 [
 [
 .B -ih
 .B -ih
+] [
+.B -m
+.I maildir
 ]
 ]
 .br
 .br
 .B seemail
 .B seemail
@@ -61,7 +64,19 @@ flag causes
 .B faces
 .B faces
 to read the messages in
 to read the messages in
 .B /mail/fs/mbox
 .B /mail/fs/mbox
-or in the named mail directory upon startup.
+upon startup.
+.PP
+The
+.B -m
+option directs
+.I faces
+to watch for messages arriving in
+.I maildir
+as well as in
+.BR /mail/fs/mbox .
+However, only
+.BR /mail/fs/mbox
+is used to load the initial set of faces.
 .PP
 .PP
 The
 The
 .B -h
 .B -h

+ 1 - 2
sys/man/1/marshal

@@ -39,8 +39,7 @@ if it exists, otherwise to
 The message format is both RFC 822 and
 The message format is both RFC 822 and
 MIME conformant, so
 MIME conformant, so
 .I marshal
 .I marshal
-adds any required headers not already in the message.
-Before adding any necessary header lines, it prepends
+adds any required headers not already in the message, prefixed by
 the contents of
 the contents of
 .BI /mail/box/ username /headers\f1.
 .BI /mail/box/ username /headers\f1.
 This allows the addition of personal headers like
 This allows the addition of personal headers like

+ 1 - 1
sys/man/1/mc

@@ -17,7 +17,7 @@ mc \- multicolumn print
 splits the input into as many columns as will fit in
 splits the input into as many columns as will fit in
 .I N
 .I N
 print positions.
 print positions.
-If run in an
+If run in a
 .IR rio (1)
 .IR rio (1)
 window, the default
 window, the default
 .I N
 .I N

+ 1 - 1
sys/man/1/mlmgr

@@ -105,7 +105,7 @@ files created by
 list's mailbox directory
 list's mailbox directory
 .TP
 .TP
 .B /mail/box/\fI<listname>\fP-owner
 .B /mail/box/\fI<listname>\fP-owner
-owmer's mailbox directory
+owner's mailbox directory
 .TP
 .TP
 .B  /mail/box/\fI<listname>\fP/address-list
 .B  /mail/box/\fI<listname>\fP/address-list
 log of mailing list deletions and additions
 log of mailing list deletions and additions

+ 1 - 68
sys/man/1/tel

@@ -1,18 +1,10 @@
 .TH TEL 1
 .TH TEL 1
 .SH NAME
 .SH NAME
-tel, ppq, iwhois \- look in phone book
+tel, iwhois \- look in phone book
 .SH SYNOPSIS
 .SH SYNOPSIS
 .B tel
 .B tel
 .I key ...
 .I key ...
 .PP
 .PP
-.B p
-.RB [ -f ]
-.I value
-.PP
-.B ppq
-.RB [ -f ]
-.IR attribute = value
-.PP
 .B iwhois
 .B iwhois
 .IR name [ \fL@\f2domain ]
 .IR name [ \fL@\f2domain ]
 .SH DESCRIPTION
 .SH DESCRIPTION
@@ -33,63 +25,6 @@ userids, home numbers, and office numbers of users.  It also contains
 a directory of area codes and miscellaneous people of general
 a directory of area codes and miscellaneous people of general
 interest.
 interest.
 .PP
 .PP
-.I Ppq
-looks up entries in the Lucent personnel database.
-Each search is against a single attribute.  The
-possible search attributes are:
-.IP tel
-a telephone number. 
-An entry matches if its telephone number ends in the
-digits given in
-.IR value .
-.IP name
-a proper name.
-.I Value
-must contain a family name, optionally prefixed
-with first and middle names or initials separated by '.'s.
-For example, emlin, grace.emlin, g.r.emlin can
-can be used to look up Grace Roosevelt Emlin.
-.IP org
-an organization name.
-.I Value
-can be any prefix string of an organization number.
-For example,
-.B bl011
-looks up everyone in research while
-.B bl011273
-looks up everyone in a single department.
-.IP id
-a post id.
-.I Value
-must exactly match the post id.
-.PP
-The attribute can be explicitly declared, e.g.
-.BR tel=5551212 ,
-or can be inferred from the form of the value using the following criteria:
-.IP 1)
-A
-.I value
-containing a '.' implies a name.
-.IP 2)
-Nothing but digits, '+', and '-' implies a telephone number.
-.IP 3)
-A mix of digits and letters implies an organization.
-.IP 4)
-Anything else implies two searches, first with the attribute
-.B id
-and if that fails, with attribute
-.BR name .
-.PP
-With no flags,
-.I ppq
-returns for each match a single line containing
-the employee's name, title, organization, location, room, telephone number,
-and email address.
-With 
-.BR \-f ,
-.I ppq
-returns a fuller multiline entry for each match.
-.PP
 .I Iwhois
 .I Iwhois
 looks up names in the Internet NIC's personnel database.
 looks up names in the Internet NIC's personnel database.
 .I Name
 .I Name
@@ -106,5 +41,3 @@ Public telephone number database.
 .B /rc/bin/tel
 .B /rc/bin/tel
 .br
 .br
 .B /rc/bin/iwhois
 .B /rc/bin/iwhois
-.br
-.B /sys/src/cmd/ppq.c

+ 164 - 95
sys/man/1/vnc

@@ -4,124 +4,190 @@ vncs, vncv \- remote frame buffer server and viewer for Virtual Network Computin
 .SH SYNOPSIS
 .SH SYNOPSIS
 .B vncs
 .B vncs
 [
 [
-.B -v ] [ -g
-.I width
-.B X
-.I height
-.B ]
-.B [ -d
-.I :display
-.B ] 
-.B [command [args ...]]
+.B -v
+]
+[
+.B -c
+.I cert
+]
+[
+.B -d
+.BI : display
+]
+[
+.B -g
+.IB width x height
+]
+[
+.B -p
+.I pixfmt
+]
+[
+.B -x
+.I net
+]
+[
+.I cmd
+[
+.I args
+...
+]
+]
 .PP
 .PP
-.B vncs -k
-.I :display
+.B vncs
+.B -k
+.BI : display
+[
+.B -x
+.I net
+]
 .PP
 .PP
 .B vncv
 .B vncv
 [
 [
-.B -e
-.I encodings
+.B -cstv
 ]
 ]
 [
 [
-.B -csv
+.B -e
+.I encodings
 ]
 ]
 .IR host [\fL: n ]
 .IR host [\fL: n ]
 .SH DESCRIPTION
 .SH DESCRIPTION
-.I vncs
-starts a new virtual frame buffer in memory and waits for connections from remote viewers.
-Each viewer is authenticated using challenge and response. APOP password is used as the
-private key. A display number 
-.I :n
-in the global name space is printed to stderr. A viewer must use the same display number 
-in order to contact the desired server. Multiple VNC servers can co-exist on the same host,
-each with a unique display number.
+VNC is a lightweight protocol
+for accessing graphical applications
+remotely.  The protocol allows one or more
+clients to connect to a server.
+While connected, clients display the frame buffer
+presented by the server and can send mouse events,
+keyboard events, and exchange snarf buffers.
+The server persists across viewer sessions, so that
+the virtual application can be accessed from various locations
+as its owner moves around.
+.PP
+VNC displays have names of the form
+.IB host : n \fR,
+where
+.I host
+is the machine's network name and
+.I n
+is a small integer identifier; display
+.I n
+is served on TCP port
+.RI 5900+ n .
 .PP
 .PP
-One frame buffer can have simultaneous viewers if the viewers are started with the -s option,
-see below. Otherwise, starting a new viewer would cause the server to disconnect from all 
-existing viewers. Killing the viewers will not affect the remote server. Therefore, the same desktop
-can migrate from one location to another without restarting the window system.
+.I Vncs
+starts a new virtual frame buffer in memory, simulating
+a Plan 9 terminal running
+.I cmd
+.IR args ,
+by default an interactive shell.
+As viewers connect, each is authenticated using a 
+(rather breakable) challenge-response protocol using
+the user's Inferno/POP password.
 .PP
 .PP
-The server options are:
+The options are:
 .TP
 .TP
-.B -v
-causes verbose output to stderr.
+.B -c \fIcert
+start TLS on each viewer connection using the certificate
+in the file
+.IR cert .
+The corresponding private key must be loaded into
+the server's
+.IR factotum (4).
+When serving TLS connections, the base port is
+35729 rather than 5900.
+.TP
+.B -d :\fIn
+run on display
+.I n ;
+without this option, the server searches
+for an unused display.
 .TP
 .TP
-.B -g " widthXheight
-specifies the frame buffer geometry. Default is 1024x768. The depth is fixed
-at 16 bits per pixel (r5g6b5).
+.B -g \fIwidth\fBx\fIheight\fR
+set the virtual frame buffer to be
+.IB width x height
+(default
+1024x768)
+pixels.
 .TP
 .TP
-.B -d 
-chooses a display number
-.RI : n .
-The server aborts if the display is not available. If not specified, the server hunts for 
-the first available on that host interface.
+.B -p \fIpixfmt
+set the virtual frame buffer's internal pixel format to
+.I pixfmt
+(default
+.BR r5g6b5 ).
 .TP
 .TP
-.I command [args ...]
-By default, the server starts with a terminal similar to that of drawterm. RC is
-executed on behalf of the owner of the vncs process. The user can specify any program
-to start the VNC server, e.g. rio.
+.B -v
+print verbose output to standard error.
 .TP
 .TP
-.B -k " :display
-shutdown the VNC server and all of its connected clients on 
-.RI : display .
-Note, kill vncs | rc will kill ALL servers running on that host.
+.B -x \fInet
+announce on an alternate network interface.
+Because of the weak authentication protocol and
+default lack of encryption, this option must
+be accompanied by
+.BR -c .
+.PD
+.PP
+The command
+.B vncs
+.B -k
+.BI : n
+kills the VNC server running on display
+.IR n .
 .PP
 .PP
 .I Vncv
 .I Vncv
-provides access to remote frame buffer
-.I n
-on 
-.I host
-using the VNC (Virtual Network Computing)
-protocol.
+provides access to remote display
+.IB host : n \fR.
 It resizes its window to be the smaller of the
 It resizes its window to be the smaller of the
 remote frame buffer size and the local screen.
 remote frame buffer size and the local screen.
 .PP
 .PP
-The 
-.B -e
-option specifies an ordered list of rectangle
-encodings to allow in the protocol.
-The default (and full set) is 
-.IP
-.EX
-copyrect corre hextile rre raw
-.EE
-.PP
-By default, connecting to a display closes 
-any other connections to that display.
-The
-.B -s
-option allows the other connections to share the display.
-.PP
-The
-.B -v
-option causes verbose output.
-.PP
-.I Vncv
-negotiates with the VNC server to settle on a true-color pixel format.
-For true-color displays, this is the native display pixel format.
-On eight bit color-mapped displays,
-.I vncv
-requests 
-.B r3g3b2
-pixels and upon receipt translates them to the nearest
-color in the map.
-This does not cover the color map particularly well.
-When invoked with the
+The options are:
+.TP
 .B -c
 .B -c
-option,
-.I vncv
-requests
+when connecting to 8-bit displays, request
 .B r4g4b4
 .B r4g4b4
-pixels instead.  This consumes more bandwidth
-but results in better matching to the available colors.
+pixels rather than 
+.B r3g3b2
+pixels.
+This takes up more bandwidth but usually gives
+significantly better matching to the Plan 9 color map.
+.TP
+.B -e \fIencodings
+set the ordered list of allowed frame buffer update encodings.
+The default (and full) set is
+.B copyrect
+.B corre
+.B hextile
+.B rre
+.BR raw .
+The encodings should be given as a single space-separated argument
+(quoted when using the shell).
+.TP
+.B -s
+share the display with extant viewers;
+by default extant viewers are closed
+when a new viewer connects.
+.TP
+.B -t
+start TLS on the connection.
+.TP
+.B -v
+print verbose output to standard error.
+.PD
 .PP
 .PP
+The VNC protocol represents keyboard input as
+key up/down events.
+Plan 9 does not expose the state of the
+Ctl and Shift keys except as it can be inferred
+from receipt of control or shifted characters.
+It does not expose the state of the Alt key at all,
+since the Alt key is used to compose Unicode characters
+(see
+.IR keyboard (6)).
 .I Vncv
 .I Vncv
-correctly handles the typing of control characters
-and shifted keystrokes.
-To support systems that require the use
-of modifiers like Alt, Ctl, and Shift on
-things like mouse events,
-typing the sequences
+correctly handles the sending of control and shifted
+characters.
+To support systems that use key sequences like Alt-X
+(or worse, Alt-mouse-click), typing the Plan 9 compose
+sequences
 .B Alt
 .B Alt
 .B Z
 .B Z
 .B A
 .B A
@@ -136,8 +202,7 @@ and
 .B S
 .B S
 (for Shift)
 (for Shift)
 will send a ``key down'' message for
 will send a ``key down'' message for
-the given key (see
-.IR keyboard (6)).
+the given key.
 A corresponding ``key up'' message
 A corresponding ``key up'' message
 will be sent after the next key is pressed,
 will be sent after the next key is pressed,
 or when the sequence is retyped,
 or when the sequence is retyped,
@@ -151,3 +216,7 @@ whichever happens first.
 .SH BUGS
 .SH BUGS
 If the remote frame buffer is larger than the local screen,
 If the remote frame buffer is larger than the local screen,
 only the upper left corner can be accessed.
 only the upper left corner can be accessed.
+.PP
+.I Vncv
+does no verification of the TLS certificate presented
+by the server.

+ 5 - 0
sys/man/2/INDEX

@@ -13,6 +13,11 @@ readstr 9p
 respond 9p
 respond 9p
 srv 9p
 srv 9p
 threadpostmountsrv 9p
 threadpostmountsrv 9p
+9pcmdbuf 9pcmdbuf
+Cmdbuf 9pcmdbuf
+lookupcmd 9pcmdbuf
+parsecmd 9pcmdbuf
+respondcmderror 9pcmdbuf
 9pfid 9pfid
 9pfid 9pfid
 Fid 9pfid
 Fid 9pfid
 Fidpool 9pfid
 Fidpool 9pfid

+ 4 - 1
sys/man/2/pushtls

@@ -154,7 +154,10 @@ be freed by the application whenever convenient.
 .SH FILES
 .SH FILES
 .TP 
 .TP 
 .B /sys/lib/tls
 .B /sys/lib/tls
-thumbprints of trusted services, maintained manually
+thumbprints of trusted services
+.TP 
+.B /sys/lib/ssl
+PEM certificate files
 .SH SOURCE
 .SH SOURCE
 .B /sys/src/libc/9sys/pushtls.c
 .B /sys/src/libc/9sys/pushtls.c
 .br
 .br

+ 1 - 1
sys/man/2/strcat

@@ -111,7 +111,7 @@ bytes.
 .I Cistrcmp
 .I Cistrcmp
 and
 and
 .I cistrncmp
 .I cistrncmp
-ignore ASCII case distictions when comparing strings.
+ignore ASCII case distinctions when comparing strings.
 The comparisons are made with unsigned bytes.
 The comparisons are made with unsigned bytes.
 .PP
 .PP
 .I Strcpy
 .I Strcpy

+ 2 - 1
sys/man/3/tls

@@ -267,6 +267,7 @@ and
 .BR 'sha1' .
 .BR 'sha1' .
 .SH "SEE ALSO"
 .SH "SEE ALSO"
 .IR listen (8),
 .IR listen (8),
-.IR dial (2)
+.IR dial (2),
+.IR pushtls (2)
 .SH SOURCE
 .SH SOURCE
 .B /sys/src/9/port/devtls.c
 .B /sys/src/9/port/devtls.c

+ 2 - 0
sys/man/8/INDEX

@@ -3,6 +3,7 @@ intro 0intro
 9load 9load
 9load 9load
 ld 9load
 ld 9load
 9pcon 9pcon
 9pcon 9pcon
+aan aan
 aliasmail aliasmail
 aliasmail aliasmail
 apm apm
 apm apm
 auth auth
 auth auth
@@ -142,6 +143,7 @@ smtp smtp
 smtpd smtp
 smtpd smtp
 snoopy snoopy
 snoopy snoopy
 stats stats
 stats stats
+stub stub
 swap swap
 swap swap
 timesync timesync
 timesync timesync
 tlsclient tlssrv
 tlsclient tlssrv

+ 6 - 5
sys/man/1/aan → sys/man/8/aan

@@ -1,4 +1,4 @@
-.TH AAN 1
+.TH AAN 8
 .SH NAME
 .SH NAME
 aan \- always available network
 aan \- always available network
 .SH SYNOPSIS
 .SH SYNOPSIS
@@ -14,7 +14,7 @@ aan \- always available network
 ]
 ]
 .I dialstring
 .I dialstring
 |
 |
-handle
+.I dir
 .SH DESCRIPTION
 .SH DESCRIPTION
 .I Aan
 .I Aan
 tunnels traffic between a client and a server through a persistent
 tunnels traffic between a client and a server through a persistent
@@ -47,8 +47,9 @@ The client side (option
 calls the server by its
 calls the server by its
 .IR dialstring ,
 .IR dialstring ,
 while
 while
-the server side listens on
-.IR handle .
+the server side listens for connections in the 
+already-announced network directory
+.IR devdir .
 .PP
 .PP
 .I Aan
 .I Aan
 is usually run automatically through the
 is usually run automatically through the
@@ -75,7 +76,7 @@ name space can be imported through
 using this command:
 using this command:
 .IP
 .IP
 .EX
 .EX
-import -p /net/tcp!astro6 / /mnt/term
+import -p astro6 / /mnt/term
 .EE
 .EE
 .SH FILES
 .SH FILES
 .TP
 .TP

+ 27 - 0
sys/man/8/fs

@@ -19,6 +19,14 @@ fs, exsort \- file server maintenance
 .B check
 .B check
 .RI [ options ]
 .RI [ options ]
 .PP
 .PP
+.B clean
+.I file
+[
+.I bno
+[
+.I addr
+] ]
+.PP
 .B clri
 .B clri
 .RI [ file ...]
 .RI [ file ...]
 .PP
 .PP
@@ -158,6 +166,7 @@ flushes it.
 changes the current file system, that is, the file tree to which
 changes the current file system, that is, the file tree to which
 commands
 commands
 .RB ( check ,
 .RB ( check ,
+.BR clean ,
 .BR clri ,
 .BR clri ,
 .BR create ,
 .BR create ,
 .BR cwcmd ,
 .BR cwcmd ,
@@ -250,6 +259,24 @@ This is a discredited idea to try to keep operating
 on the knee of the cache working set.
 on the knee of the cache working set.
 Buy more cache disk.
 Buy more cache disk.
 .PP
 .PP
+.I Clean
+prints the block numbers in
+.IR file 's
+directory entry (direct, indirect and doubly indirect)
+and checks the tags of the blocks cited.
+If
+.I bno
+is supplied, the
+.IR bno 'th
+block number (using zero origin)
+is set to
+.I addr
+(defaults to zero).
+Note that only the block numbers in the directory entry itself
+are examined;
+.I clean
+does not recurse through indirect blocks.
+.PP
 .I Clri
 .I Clri
 clears the internal directory entry and abandons storage
 clears the internal directory entry and abandons storage
 associated with
 associated with

+ 49 - 41
sys/man/8/fsconfig

@@ -15,20 +15,6 @@ fsconfig \- configuring a file server
 .I name
 .I name
 .I device
 .I device
 .PP
 .PP
-.B ream
-.I name
-.PP
-.B recover
-.I name
-.PP
-.B allow
-.PP
-.B noauth
-.PP
-.B noattach
-.PP
-.B copyworm
-.PP
 .B ip
 .B ip
 .I ipaddr
 .I ipaddr
 .PP
 .PP
@@ -44,6 +30,22 @@ fsconfig \- configuring a file server
 .B ipsntp
 .B ipsntp
 .I ipaddr
 .I ipaddr
 .PP
 .PP
+.B ream
+.I name
+.PP
+.B recover
+.I name
+.PP
+.B allow
+.PP
+.B readonly
+.PP
+.B noauth
+.PP
+.B noattach
+.PP
+.B copyworm
+.PP
 .B halt
 .B halt
 .PP
 .PP
 .B end
 .B end
@@ -56,7 +58,7 @@ apply only in that mode.  They establish configuration constants
 that are typically valid for the life of the server, and therefore
 that are typically valid for the life of the server, and therefore
 need be run only once.  If the non-volatile RAM on the server
 need be run only once.  If the non-volatile RAM on the server
 gets erased, it will be necessary to recreate the configuration.
 gets erased, it will be necessary to recreate the configuration.
-.PP
+.SS Syntax
 In these commands,
 In these commands,
 .I ipaddr
 .I ipaddr
 is an IP address in the form
 is an IP address in the form
@@ -208,7 +210,7 @@ is the cache, the second the WORM.
 .BI o
 .BI o
 (Letter o) The read-only (dump) file system
 (Letter o) The read-only (dump) file system
 of the most-recently defined cached WORM file system.
 of the most-recently defined cached WORM file system.
-.PP
+.SS Configuration
 The
 The
 .B service
 .B service
 command sets the textual name of the server as known in
 command sets the textual name of the server as known in
@@ -242,6 +244,29 @@ messages to connect to that file system.
 is the one attached to if the specifier is null; see
 is the one attached to if the specifier is null; see
 .IR attach (5)).
 .IR attach (5)).
 .PP
 .PP
+The rest of the configuration commands record IP addresses:
+the file server's address
+.RI ( ip ),
+the local gateway's
+.RI ( ipgw ),
+the local authentication server's
+.RI ( ipauth ),
+the local subnet mask
+.RI ( ipmask ),
+and the address of a system running an SNTP server
+.RI ( ipsntp ).
+.I Ipauth
+is no longer used.
+If the server has more than one network interface,
+a digit may be appended to the keywords
+.BR ip ,
+.B ipgw
+and
+.B ipmask
+to indicate the interface number;
+zero is the default.
+.SS "One-time actions"
+.PP
 The
 The
 .I ream
 .I ream
 command initializes the named file system.  It overwrites
 command initializes the named file system.  It overwrites
@@ -275,6 +300,10 @@ system, effectively resetting its contents to the last dump.
 .I Allow
 .I Allow
 turns off all permission checking; use with caution.
 turns off all permission checking; use with caution.
 .PP
 .PP
+.I Readonly
+disables all writing to all devices.
+This is useful for trying dangerous experiments.
+.PP
 .I Noauth
 .I Noauth
 disables authentication.
 disables authentication.
 .PP
 .PP
@@ -290,26 +319,10 @@ block by block,
 and loop.
 and loop.
 It knows how to read a fake worm file system.
 It knows how to read a fake worm file system.
 .PP
 .PP
-The rest of the commands record IP addresses: the file server's address
-.RI ( ip ),
-the local gateway's
-.RI ( ipgw ),
-the local authentication server's
-.RI ( ipauth ),
-the local subnet mask
-.RI ( ipmask ),
-and the address of a system running an SNTP server
-.RI ( ipsntp ).
-.I Ipauth
-is no longer used.
-If the server has more than one network interface,
-a digit may be appended to the keywords
-.BR ip ,
-.B ipgw
-and
-.B ipmask
-to indicate the interface number;
-zero is the default.
+.I Halt
+will cause the server to
+.I immediately
+exit and reboot.
 .PP
 .PP
 The various configuration commands only record what to do; they write
 The various configuration commands only record what to do; they write
 no data to disk.  The command
 no data to disk.  The command
@@ -317,11 +330,6 @@ no data to disk.  The command
 exits config mode and begins running the file server proper.
 exits config mode and begins running the file server proper.
 The server will then perform whatever I/O is required to establish
 The server will then perform whatever I/O is required to establish
 the configuration.
 the configuration.
-.PP
-.I Halt
-will cause the server to
-.I immediately
-exit and reboot.
 .SH EXAMPLE
 .SH EXAMPLE
 Initialize a file server
 Initialize a file server
 .B kgbsun
 .B kgbsun

+ 3 - 1
sys/man/8/listen

@@ -162,7 +162,9 @@ Secure IMAP4rev1 port.
 .I Listen1
 .I Listen1
 is a lightweight listener intended for personal use,
 is a lightweight listener intended for personal use,
 modeled from Inferno's
 modeled from Inferno's
-.IR listen (1).
+.\" write out this way so automatic programs
+.\" don't try to make it into a real man page reference.
+\fIlisten\fR(1).
 announces on
 announces on
 .IR address ,
 .IR address ,
 running
 running

+ 2 - 1
sys/man/8/mk9660

@@ -219,7 +219,8 @@ Plan 9 extensions in the system use fields, and
 a Joliet directory tree.
 a Joliet directory tree.
 .IP
 .IP
 .EX
 .EX
-disk/mk9660 -9cj -s /n/bootes -p plan9proto cdimage
+disk/mk9660 -9cj -s /n/bootes \e
+	-p /sys/lib/sysconfig/srcproto cdimage
 .EE
 .EE
 .SH SOURCE
 .SH SOURCE
 .B /sys/src/cmd/disk/9660
 .B /sys/src/cmd/disk/9660

+ 4 - 0
sys/man/8/secstore

@@ -32,6 +32,10 @@ to change status on existing accounts.
 It prompts for account information such as
 It prompts for account information such as
 password and expiration date, writing to
 password and expiration date, writing to
 .BR /adm/secstore/who/$uid .
 .BR /adm/secstore/who/$uid .
+The
+.B /adm/secstore
+directory should be created mode 770 for the userid
+or groupid of the secstored process.
 .SH FILES
 .SH FILES
 .B /adm/secstore/who/$uid
 .B /adm/secstore/who/$uid
 secstore account name, expiration date, verifier
 secstore account name, expiration date, verifier

+ 3 - 1
sys/man/8/send

@@ -21,7 +21,9 @@ send \- mail routing and delivery
 .I Send
 .I Send
 is not normally run directly by the user.  Instead, mail protocol
 is not normally run directly by the user.  Instead, mail protocol
 agents like
 agents like
-.IR smtpd (8)
+.I smtpd
+(see
+.IR smtp (8))
 and mail preparers like
 and mail preparers like
 .IR marshal (1)
 .IR marshal (1)
 fork and execute
 fork and execute

+ 2 - 0
sys/man/8/smtp

@@ -114,6 +114,8 @@ turns on forward DNS validation of non-trusted sender address.
 .TP
 .TP
 .B -f
 .B -f
 prevents relaying from non-trusted networks.
 prevents relaying from non-trusted networks.
+It also tags messages from non-trusted sites when they deliver mail
+from an address in a domain we believe we represent.
 .TP
 .TP
 .B -n
 .B -n
 specifies the name of the network directory assigned to the incoming connection.
 specifies the name of the network directory assigned to the incoming connection.

+ 6 - 2
sys/man/8/ventiaux

@@ -396,8 +396,12 @@ last=`{cat last}
 venti/wrarena -h venti2 -o 335872 /dev/sdC0/arenas $last >output
 venti/wrarena -h venti2 -o 335872 /dev/sdC0/arenas $last >output
 awk '/^end offset/ { print $3 }' offset >last
 awk '/^end offset/ { print $3 }' offset >last
 .EE
 .EE
-(Of course, one would need to add wrapper code to keep track
-of which arenas have been processed.)
+.LP
+Of course, one would need to add wrapper code to keep track
+of which arenas have been processed.
+See
+.B /sys/src/cmd/venti/backup.example
+for a version that does this.
 .PP
 .PP
 .I Read
 .I Read
 and
 and

+ 0 - 1
sys/src/9/bitsy/etherif.h

@@ -9,7 +9,6 @@ struct Ether {
 
 
 	int	ctlrno;
 	int	ctlrno;
 	int	tbdf;			/* type+busno+devno+funcno */
 	int	tbdf;			/* type+busno+devno+funcno */
-	int	mbps;			/* Mbps */
 	int	minmtu;
 	int	minmtu;
 	int 	maxmtu;
 	int 	maxmtu;
 	uchar	ea[Eaddrlen];
 	uchar	ea[Eaddrlen];

+ 4 - 4
sys/src/9/boot/mkboot

@@ -87,12 +87,12 @@ awk '
 ' $1
 ' $1
 
 
 #
 #
-#  configure in a cache file system if a 'cfs.root' appears in the
-#  'misc' section
+#  configure in a cache file system if a 
+# /386/bin/root appears in the rootdir section.
 #
 #
-../port/mkextract misc 0 $* | awk '
+../port/mkextract bootdir 0 $* | awk '
 	BEGIN			{ cfs = 0 }
 	BEGIN			{ cfs = 0 }
-	$1 == "cfs.root"	{ cfs = 1 }
+	$1 ~ "bin/cfs$"	{ cfs = 1 }
 	END			{ if(cfs)
 	END			{ if(cfs)
 					print "int (*cfs)(int) = cache;"
 					print "int (*cfs)(int) = cache;"
 				  else
 				  else

+ 1 - 1
sys/src/9/ip/tcp.c

@@ -1941,7 +1941,7 @@ tcpiput(Proto *tcp, Ipifc*, Block *bp)
 
 
 		h4->Unused = 0;
 		h4->Unused = 0;
 		hnputs(h4->tcplen, length-TCP4_PKT);
 		hnputs(h4->tcplen, length-TCP4_PKT);
-		if((h4->tcpcksum[0] || h4->tcpcksum[1]) && 
+		if(!(bp->flag & Btcpck) && (h4->tcpcksum[0] || h4->tcpcksum[1]) && 
 			ptclcsum(bp, TCP4_IPLEN, length-TCP4_IPLEN)) {
 			ptclcsum(bp, TCP4_IPLEN, length-TCP4_IPLEN)) {
 			tpriv->stats[CsumErrs]++;
 			tpriv->stats[CsumErrs]++;
 			tpriv->stats[InErrs]++;
 			tpriv->stats[InErrs]++;

+ 0 - 1
sys/src/9/mtx/etherif.h

@@ -9,7 +9,6 @@ struct Ether {
 
 
 	int	ctlrno;
 	int	ctlrno;
 	int	tbdf;			/* type+busno+devno+funcno */
 	int	tbdf;			/* type+busno+devno+funcno */
-	int	mbps;			/* Mbps */
 	int	minmtu;
 	int	minmtu;
 	int 	maxmtu;
 	int 	maxmtu;
 	uchar	ea[Eaddrlen];
 	uchar	ea[Eaddrlen];

+ 0 - 60
sys/src/9/pc/clock.c

@@ -1,60 +0,0 @@
-#include "u.h"
-#include "../port/lib.h"
-#include "mem.h"
-#include "dat.h"
-#include "fns.h"
-#include "io.h"
-#include "ureg.h"
-
-/*
- *  this is called both by the mp's clock interrupt and
- *  by the clockintr0 for the i8253
- */
-void
-clockintr(Ureg* ureg, void*)
-{
-	/* this has to get called every tick or the 8253 timer will overflow */
-	fastticks(nil);
-
-	if(m->flushmmu){
-		if(up)
-			flushmmu();
-		m->flushmmu = 0;
-	}
-
-	portclock(ureg);
-}
-
-void
-delay(int millisecs)
-{
-	millisecs *= m->loopconst;
-	if(millisecs <= 0)
-		millisecs = 1;
-	aamloop(millisecs);
-}
-
-void
-microdelay(int microsecs)
-{
-	microsecs *= m->loopconst;
-	microsecs /= 1000;
-	if(microsecs <= 0)
-		microsecs = 1;
-	aamloop(microsecs);
-}
-
-/*  
- *  performance measurement ticks.  must be low overhead.
- *  doesn't have to count over a second.
- */
-ulong
-perfticks(void)
-{
-	uvlong x;
-
-	if(!m->havetsc)
-		return ticks;
-	rdtsc(&x);
-	return x;
-}

+ 31 - 36
sys/src/9/pc/devarch.c

@@ -110,9 +110,9 @@ ioinit(void)
 	ioalloc(0x10000, 1, 0, "dummy");
 	ioalloc(0x10000, 1, 0, "dummy");
 	/*
 	/*
 	 * Someone needs to explain why this was here...
 	 * Someone needs to explain why this was here...
-	 */
 	ioalloc(0x0fff, 1, 0, "dummy");	// i82557 is at 0x1000, the dummy
 	ioalloc(0x0fff, 1, 0, "dummy");	// i82557 is at 0x1000, the dummy
 					// entry is needed for swappable devs.
 					// entry is needed for swappable devs.
+	 */
 
 
 	if ((excluded = getconf("ioexclude")) != nil) {
 	if ((excluded = getconf("ioexclude")) != nil) {
 		char *s;
 		char *s;
@@ -391,8 +391,7 @@ archread(Chan *c, void *a, long n, vlong offset)
 		break;
 		break;
 	}
 	}
 
 
-	/* allocate a buffer to avoid page faults in the loop */
-	if((buf = malloc(n+1)) == nil)	/* +1 for the NUL */
+	if((buf = malloc(n)) == nil)
 		error(Enomem);
 		error(Enomem);
 	p = buf;
 	p = buf;
 	n = n/Linelen;
 	n = n/Linelen;
@@ -404,7 +403,7 @@ archread(Chan *c, void *a, long n, vlong offset)
 			continue;
 			continue;
 		if(strcmp(m->tag, "dummy") == 0)
 		if(strcmp(m->tag, "dummy") == 0)
 			break;
 			break;
-		snprint(p, Linelen+1, "%8lux %8lux %-12.12s\n", m->start, m->end-1, m->tag);
+		sprint(p, "%8lux %8lux %-12.12s\n", m->start, m->end-1, m->tag);
 		p += Linelen;
 		p += Linelen;
 		n--;
 		n--;
 	}
 	}
@@ -624,9 +623,11 @@ cpuidprint(void)
  *  figure out:
  *  figure out:
  *	- cpu type
  *	- cpu type
  *	- whether or not we have a TSC (cycle counter)
  *	- whether or not we have a TSC (cycle counter)
- *	- whether or not is supports page size extensions
+ *	- whether or not it supports page size extensions
+ *		(if so turn it on)
+ *	- whether or not it supports machine check exceptions
  *		(if so turn it on)
  *		(if so turn it on)
- *	- whether or not is supports machine check exceptions
+ *	- whether or not it supports the page global flag
  *		(if so turn it on)
  *		(if so turn it on)
  */
  */
 int
 int
@@ -669,11 +670,11 @@ cpuidentify(void)
 	guesscpuhz(t->aalcycles);
 	guesscpuhz(t->aalcycles);
 
 
 	/*
 	/*
-	 * If machine check exception or page size extensions are supported
-	 * enable them in CR4 and clear any other set extensions.
+	 * If machine check exception, page size extensions or page global bit
+	 * are supported enable them in CR4 and clear any other set extensions.
 	 * If machine check was enabled clear out any lingering status.
 	 * If machine check was enabled clear out any lingering status.
 	 */
 	 */
-	if(m->cpuiddx & 0x88){
+	if(m->cpuiddx & 0x2088){
 		cr4 = 0;
 		cr4 = 0;
 		if(m->cpuiddx & 0x08)
 		if(m->cpuiddx & 0x08)
 			cr4 |= 0x10;		/* page size extensions */
 			cr4 |= 0x10;		/* page size extensions */
@@ -688,38 +689,32 @@ cpuidentify(void)
 				rdmsr(0x01, &mct);
 				rdmsr(0x01, &mct);
 			}
 			}
 		}
 		}
+	
+		/*
+		 * Detect whether the chip supports the global bit
+		 * in page directory and page table entries.  When set
+		 * in a particular entry, it means ``don't bother removing
+		 * this from the TLB when CR3 changes.''  
+		 * 
+		 * We flag all kernel pages with this bit.  Doing so lessens the
+		 * overhead of switching processes on bare hardware,
+		 * even more so on VMware.  See mmu.c:/^memglobal.
+		 *
+		 * For future reference, should we ever need to do a
+		 * full TLB flush, it can be accomplished by clearing
+		 * the PGE bit in CR4, writing to CR3, and then
+		 * restoring the PGE bit.
+		 */
+		if(m->cpuiddx & 0x2000){
+			cr4 |= 0x80;		/* page global enable bit */
+			m->havepge = 1;
+		}
+
 		putcr4(cr4);
 		putcr4(cr4);
 		if(m->cpuiddx & 0x80)
 		if(m->cpuiddx & 0x80)
 			rdmsr(0x01, &mct);
 			rdmsr(0x01, &mct);
 	}
 	}
 
 
-	/*
-	 * Detect whether the chip supports the global bit
-	 * in page directory and page table entries.  When set
-	 * in a particular entry, it means ``don't bother removing
-	 * this from the TLB when CR3 changes.''  
-	 * 
-	 * We flag all kernel pages with this bit.  Doing so lessens the
-	 * overhead of switching processes on bare hardware,
-	 * even more so on VMware.  See mmu.c:/^memglobal.
-	 *
-	 * This feature exists on Intel Pentium Pro and later
-	 * processors.  Presumably the AMD processors have
-	 * a similar notion, but I can't find it in the meager
-	 * documentation I've tried.
-	 *
-	 * For future reference, should we ever need to do a
-	 * full TLB flush, it can be accomplished by clearing
-	 * the PGE bit in CR4, writing to CR3, and then
-	 * restoring the PGE bit.
-	 */
-	if(tab==x86intel && t->family >= 6){
-		cr4 = getcr4();
-		cr4 |= 0x80;		/* page global enable bit */
-		putcr4(cr4);
-		m->havepge = 1;
-	}
-
 	cputype = t;
 	cputype = t;
 	return t->family;
 	return t->family;
 }
 }

+ 1 - 1
sys/src/9/pc/pcdisk

@@ -100,8 +100,8 @@ port
 	int cpuserver = 0;
 	int cpuserver = 0;
 
 
 boot boot #S/sdC0/
 boot boot #S/sdC0/
-	local
 	il
 	il
+	local
 
 
 bootdir
 bootdir
 	bootpcdisk.out boot
 	bootpcdisk.out boot

+ 6 - 8
sys/src/9/pc/pcflop

@@ -14,7 +14,7 @@ dev
 #	tls
 #	tls
 	cap
 	cap
 #	kprof
 #	kprof
-#	realtime
+#	realtime	realtimesub edf
 
 
 	ether		netif
 	ether		netif
 	ip		arp chandial ip ipv6 ipaux iproute netlog nullmedium pktmedium ptclbsum386 inferno
 	ip		arp chandial ip ipv6 ipaux iproute netlog nullmedium pktmedium ptclbsum386 inferno
@@ -61,13 +61,6 @@ link
 misc
 misc
 #	archmp		mp apic
 #	archmp		mp apic
 
 
-#	ipconfig.root
-#	kfs.root
-#	factotum.root
-#	cfs.root
-	bzfs.root
-	bzroot.root
-
 	sdata		pci sdscsi
 	sdata		pci sdscsi
 	sd53c8xx		pci sdscsi
 	sd53c8xx		pci sdscsi
 	sdmylex		pci sdscsi
 	sdmylex		pci sdscsi
@@ -109,3 +102,8 @@ port
 
 
 boot glenda boot #f/fd0disk
 boot glenda boot #f/fd0disk
 	local
 	local
+
+bootdir
+	bootpcflop.out boot
+	/sys/lib/dist/bin/386/bzfs kfs
+	/sys/lib/dist/pc/root.bz2 bzroot

+ 1 - 1
sys/src/9/port/devfs.c

@@ -572,7 +572,7 @@ mwrite(Chan *c, void *a, long n, vlong off)
 }
 }
 
 
 Dev fsdevtab = {
 Dev fsdevtab = {
-	L'k',
+	'k',
 	"devfs",
 	"devfs",
 
 
 	devreset,
 	devreset,

+ 0 - 1490
sys/src/9/port/devwpsd.c

@@ -1,1490 +0,0 @@
-/*
- * Storage Device.
- */
-#include "u.h"
-#include "../port/lib.h"
-#include "mem.h"
-#include "dat.h"
-#include "fns.h"
-#include "io.h"
-#include "ureg.h"
-#include "../port/error.h"
-
-#include "../port/sd.h"
-
-extern Dev wpsddevtab;
-extern SDifc* sdifc[];
-
-typedef struct {
-	SDev*	dt_dev;
-	int	dt_nunits;		/* num units in dev */
-} dev_t;
-
-static dev_t* devs;			/* all devices */
-static QLock devslock;			/* insertion and removal of devices */
-static int ndevs;			/* total number of devices in the system */
-
-enum {
-	Rawcmd,
-	Rawdata,
-	Rawstatus,
-};
-
-enum
-{
-	CMpart,
-	CMdelpart,
-	CMwpenable,
-	CMwpblocks,
-	CMwildcard,
-};
-
-Cmdtab ctlmsg[] =
-{
-	CMpart,		"part",		3,
-	CMdelpart,	"delpart",	1,
-	CMwpenable,	"wpenable",	0,
-	CMwpblocks,	"wpblocks",	2,
-	CMwildcard,	"*",		0,
-};
-
-enum {
-	Qtopdir		= 1,		/* top level directory */
-	Qtopbase,
-	Qtopctl = Qtopbase,
-	Qtopstat,
-
-	Qunitdir,			/* directory per unit */
-	Qunitbase,
-	Qctl		= Qunitbase,
-	Qraw,
-	Qpart,
-
-	TypeLOG		= 4,
-	NType		= (1<<TypeLOG),
-	TypeMASK	= (NType-1),
-	TypeSHIFT	= 0,
-
-	PartLOG		= 8,
-	NPart		= (1<<PartLOG),
-	PartMASK	= (NPart-1),
-	PartSHIFT	= TypeLOG,
-
-	UnitLOG		= 8,
-	NUnit		= (1<<UnitLOG),
-	UnitMASK	= (NUnit-1),
-	UnitSHIFT	= (PartLOG+TypeLOG),
-
-	DevLOG		= 8,
-	NDev		= (1 << DevLOG),
-	DevMASK	= (NDev-1),
-	DevSHIFT = (UnitLOG+PartLOG+TypeLOG),
-
-	Ncmd = 20,
-};
-
-#define TYPE(q)		((((ulong)(q).path)>>TypeSHIFT) & TypeMASK)
-#define PART(q)		((((ulong)(q).path)>>PartSHIFT) & PartMASK)
-#define UNIT(q)		((((ulong)(q).path)>>UnitSHIFT) & UnitMASK)
-#define DEV(q)		((((ulong)(q).path)>>DevSHIFT) & DevMASK)
-#define QID(d,u, p, t)	(((d)<<DevSHIFT)|((u)<<UnitSHIFT)|\
-					 ((p)<<PartSHIFT)|((t)<<TypeSHIFT))
-
-
-static void
-sdaddpart(SDunit* unit, char* name, ulong start, ulong end)
-{
-	SDpart *pp;
-	int i, partno;
-
-	/*
-	 * Check name not already used
-	 * and look for a free slot.
-	 */
-	if(unit->part != nil){
-		partno = -1;
-		for(i = 0; i < unit->npart; i++){
-			pp = &unit->part[i];
-			if(!pp->valid){
-				if(partno == -1)
-					partno = i;
-				break;
-			}
-			if(strcmp(name, pp->name) == 0){
-				if(pp->start == start && pp->end == end)
-					return;
-				error(Ebadctl);
-			}
-		}
-	}
-	else{
-		if((unit->part = malloc(sizeof(SDpart)*SDnpart)) == nil)
-			error(Enomem);
-		unit->npart = SDnpart;
-		partno = 0;
-	}
-
-	/*
-	 * If no free slot found then increase the
-	 * array size (can't get here with unit->part == nil).
-	 */
-	if(partno == -1){
-		if(unit->npart >= NPart)
-			error(Enomem);
-		if((pp = malloc(sizeof(SDpart)*(unit->npart+SDnpart))) == nil)
-			error(Enomem);
-		memmove(pp, unit->part, sizeof(SDpart)*unit->npart);
-		free(unit->part);
-		unit->part = pp;
-		partno = unit->npart;
-		unit->npart += SDnpart;
-	}
-
-	/*
-	 * Check size and extent are valid.
-	 */
-	if(start > end || end > unit->sectors)
-		error(Eio);
-	pp = &unit->part[partno];
-	pp->start = start;
-	pp->end = end;
-	kstrdup(&pp->name, name);
-	kstrdup(&pp->user, eve);
-	pp->perm = 0640;
-	pp->valid = 1;
-}
-
-static void
-sddelpart(SDunit* unit,  char* name)
-{
-	int i;
-	SDpart *pp;
-
-	/*
-	 * Look for the partition to delete.
-	 * Can't delete if someone still has it open.
-	 */
-	pp = unit->part;
-	for(i = 0; i < unit->npart; i++){
-		if(strcmp(name, pp->name) == 0)
-			break;
-		pp++;
-	}
-	if(i >= unit->npart)
-		error(Ebadctl);
-	if(strcmp(up->user, pp->user) && !iseve())
-		error(Eperm);
-	pp->valid = 0;
-	pp->vers++;
-}
-
-static int
-sdinitpart(SDunit* unit)
-{
-	int i, nf;
-	ulong start, end;
-	char *f[4], *p, *q, buf[10];
-
-	unit->vers++;
-	unit->sectors = unit->secsize = 0;
-	if(unit->part){
-		for(i = 0; i < unit->npart; i++){
-			unit->part[i].valid = 0;
-			unit->part[i].vers++;
-		}
-	}
-
-	if(unit->inquiry[0] & 0xC0)
-		return 0;
-	switch(unit->inquiry[0] & 0x1F){
-	case 0x00:			/* DA */
-	case 0x04:			/* WORM */
-	case 0x05:			/* CD-ROM */
-	case 0x07:			/* MO */
-		break;
-	default:
-		return 0;
-	}
-
-	if(unit->dev->ifc->online)
-		unit->dev->ifc->online(unit);
-	if(unit->sectors){
-		sdaddpart(unit, "data", 0, unit->sectors);
-	
-		/*
-		 * Use partitions passed from boot program,
-		 * e.g.
-		 *	sdC0part=dos 63 123123/plan9 123123 456456
-		 * This happens before /boot sets hostname so the
-		 * partitions will have the null-string for user.
-		 * The gen functions patch it up.
-		 */
-		snprint(buf, sizeof buf, "%spart", unit->name);
-		for(p = getconf(buf); p != nil; p = q){
-			if(q = strchr(p, '/'))
-				*q++ = '\0';
-			nf = tokenize(p, f, nelem(f));
-			if(nf < 3)
-				continue;
-		
-			start = strtoul(f[1], 0, 0);
-			end = strtoul(f[2], 0, 0);
-			if(!waserror()){
-				sdaddpart(unit, f[0], start, end);
-				poperror();
-			}
-		}			
-	}
-
-	return 1;
-}
-
-static SDev*
-sdgetdev(int idno)
-{
-	SDev *sdev;
-	int i;
-
-	qlock(&devslock);
-	for(i = 0; i != ndevs; i++)
-		if (devs[i].dt_dev->idno == idno)
-			break;
-	
-	if(i == ndevs)
-		sdev = nil;
-	else{
-		sdev = devs[i].dt_dev;
-		incref(&sdev->r);
-	}
-	qunlock(&devslock);
-	return sdev;
-}
-
-static SDunit*
-sdgetunit(SDev* sdev, int subno)
-{
-	SDunit *unit;
-	char buf[32];
-
-	/*
-	 * Associate a unit with a given device and sub-unit
-	 * number on that device.
-	 * The device will be probed if it has not already been
-	 * successfully accessed.
-	 */
-	qlock(&sdev->unitlock);
-	if(subno > sdev->nunit){
-		qunlock(&sdev->unitlock);
-		return nil;
-	}
-
-	unit = sdev->unit[subno];
-	if(unit == nil){
-		/*
-		 * Probe the unit only once. This decision
-		 * may be a little severe and reviewed later.
-		 */
-		if(sdev->unitflg[subno]){
-			qunlock(&sdev->unitlock);
-			return nil;
-		}
-		if((unit = malloc(sizeof(SDunit))) == nil){
-			qunlock(&sdev->unitlock);
-			return nil;
-		}
-		sdev->unitflg[subno] = 1;
-
-		if(sdev->enabled == 0 && sdev->ifc->enable)
-			sdev->ifc->enable(sdev);
-		sdev->enabled = 1;
-
-		snprint(buf, sizeof(buf), "%s%d", sdev->name, subno);
-		kstrdup(&unit->name, buf);
-		kstrdup(&unit->user, eve);
-		unit->perm = 0555;
-		unit->subno = subno;
-		unit->dev = sdev;
-
-		/*
-		 * No need to lock anything here as this is only
-		 * called before the unit is made available in the
-		 * sdunit[] array.
-		 */
-		if(unit->dev->ifc->verify(unit) == 0){
-			qunlock(&sdev->unitlock);
-			free(unit);
-			return nil;
-		}
-		sdev->unit[subno] = unit;
-	}
-	qunlock(&sdev->unitlock);
-	return unit;
-}
-
-static void
-sdreset(void)
-{
-	int i;
-	SDev *sdev, *tail, *sdlist;
-
-	/*
-	 * Probe all configured controllers and make a list
-	 * of devices found, accumulating a possible maximum number
-	 * of units attached and marking each device with an index
-	 * into the linear top-level directory array of units.
-	 */
-	tail = sdlist = nil;
-	for(i = 0; sdifc[i] != nil; i++){
-		if(sdifc[i]->pnp == nil || (sdev = sdifc[i]->pnp()) == nil)
-			continue;
-		if(sdlist != nil)
-			tail->next = sdev;
-		else
-			sdlist = sdev;
-		for(tail = sdev; tail->next != nil; tail = tail->next){
-			tail->unit = (SDunit**)malloc(tail->nunit * sizeof(SDunit*));
-			tail->unitflg = (int*)malloc(tail->nunit * sizeof(int));
-			assert(tail->unit && tail->unitflg);
-			ndevs++;
-		}
-		tail->unit = (SDunit**)malloc(tail->nunit * sizeof(SDunit*));
-		tail->unitflg = (int*)malloc(tail->nunit * sizeof(int));
-		ndevs++;
-	}
-	
-	/*
-	 * Legacy and option code goes here. This will be hard...
-	 */
-
-	/*
-	 * The maximum number of possible units is known, allocate
-	 * placeholders for their datastructures; the units will be
-	 * probed and structures allocated when attached.
-	 * Allocate controller names for the different types.
-	 */
-	if(ndevs == 0)
-		return;
-	for(i = 0; sdifc[i] != nil; i++){
-		/*
-		 * BUG: no check is made here or later when a
-		 * unit is attached that the id and name are set.
-		 */
-		if(sdifc[i]->id)
-			sdifc[i]->id(sdlist);
-	}
-
-	/* 
-	  * The IDs have been set, unlink the sdlist and copy the spec to
-	  * the devtab.
-	  */
-	devs = (dev_t*)malloc(ndevs * sizeof(dev_t));
-	memset(devs, 0, ndevs * sizeof(dev_t));
-	i = 0;
-	while(sdlist != nil){
-		devs[i].dt_dev = sdlist;
-		devs[i].dt_nunits = sdlist->nunit;
-		sdlist = sdlist->next;
-		devs[i].dt_dev->next = nil;
-		i++;
-	}
-}
-
-static int
-sd2gen(Chan* c, int i, Dir* dp)
-{
-	Qid q;
-	vlong l;
-	SDpart *pp;
-	SDperm *perm;
-	SDunit *unit;
-	SDev *sdev;
-	int rv;
-
-	sdev = sdgetdev(DEV(c->qid));
-	assert(sdev);
-	unit = sdev->unit[UNIT(c->qid)];
-
-	rv = -1;
-	switch(i){
-	case Qctl:
-		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qctl), 
-			   unit->vers, QTFILE);
-		perm = &unit->ctlperm;
-		if(emptystr(perm->user)){
-			kstrdup(&perm->user, eve);
-			perm->perm = 0640;
-		}
-		devdir(c, q, "ctl", 0, perm->user, perm->perm, dp);
-		rv = 1;
-		break;
-
-	case Qraw:
-		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qraw), 
-			   unit->vers, QTFILE);
-		perm = &unit->rawperm;
-		if(emptystr(perm->user)){
-			kstrdup(&perm->user, eve);
-			perm->perm = DMEXCL|0600;
-		}
-		devdir(c, q, "raw", 0, perm->user, perm->perm, dp);
-		rv = 1;
-		break;
-
-	case Qpart:
-		pp = &unit->part[PART(c->qid)];
-		l = (pp->end - pp->start) * (vlong)unit->secsize;
-		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qpart), 
-			   unit->vers+pp->vers, QTFILE);
-		if(emptystr(pp->user))
-			kstrdup(&pp->user, eve);
-		devdir(c, q, pp->name, l, pp->user, pp->perm, dp);
-		rv = 1;
-		break;
-	}
-	
-	decref(&sdev->r);
-	return rv;
-}
-
-static int
-sd1gen(Chan* c, int i, Dir* dp)
-{
-	Qid q;
-
-	switch(i){
-	case Qtopctl:
-		mkqid(&q, QID(0, 0, 0, Qtopctl), 0, QTFILE);
-		devdir(c, q, "sdctl", 0, eve, 0640, dp);
-		return 1;
-	case Qtopstat:
-		mkqid(&q, QID(0, 0, 0, Qtopstat), 0, QTFILE);
-		devdir(c, q, "sdstat", 0, eve, 0640, dp);
-		return 1;
-	}
-	return -1;
-}
-
-static int
-sdgen(Chan* c, char*, Dirtab*, int, int s, Dir* dp)
-{
-	Qid q;
-	vlong l;
-	int i, r;
-	SDpart *pp;
-	SDunit *unit;
-	SDev *sdev;
-
-	switch(TYPE(c->qid)){
-	case Qtopdir:
-		if(s == DEVDOTDOT){
-			mkqid(&q, QID(0, s, 0, Qtopdir), 0, QTDIR);
-			sprint(up->genbuf, "#%C", wpsddevtab.dc);
-			devdir(c, q, up->genbuf, 0, eve, 0555, dp);
-			return 1;
-		}
-
-		if(s == 0 || s == 1)
-			return sd1gen(c, s + Qtopbase, dp);
-		s -= 2;
-
-		qlock(&devslock);
-		for(i = 0; i != ndevs; i++){
-			if (s < devs[i].dt_nunits)
-				break;
-			s -= devs[i].dt_nunits;
-		}
-		
-		if(i == ndevs){
-			/* Run of the end of the list */
-			qunlock(&devslock);
-			return -1;
-		}
-
-		if ((sdev = devs[i].dt_dev) == nil){
-			qunlock(&devslock);
-			return 0;
-		}
-
-		incref(&sdev->r);
-		qunlock(&devslock);
-
-		if((unit = sdev->unit[s]) == nil)
-			if((unit = sdgetunit(sdev, s)) == nil){
-				decref(&sdev->r);
-				return 0;
-			}
-
-		mkqid(&q, QID(sdev->idno, s, 0, Qunitdir), 0, QTDIR);
-		if(emptystr(unit->user))
-			kstrdup(&unit->user, eve);
-		devdir(c, q, unit->name, 0, unit->user, unit->perm, dp);
-		decref(&sdev->r);
-		return 1;
-
-	case Qunitdir:
-		if(s == DEVDOTDOT){
-			mkqid(&q, QID(0, s, 0, Qtopdir), 0, QTDIR);
-			sprint(up->genbuf, "#%C", wpsddevtab.dc);
-			devdir(c, q, up->genbuf, 0, eve, 0555, dp);
-			return 1;
-		}
-		
-		if((sdev = sdgetdev(DEV(c->qid))) == nil){
-			devdir(c, q, "unavailable", 0, eve, 0, dp);
-			return 1;
-		}
-
-		unit = sdev->unit[UNIT(c->qid)];
-		qlock(&unit->ctl);
-
-		/*
-		 * Check for media change.
-		 * If one has already been detected, sectors will be zero.
-		 * If there is one waiting to be detected, online
-		 * will return > 1.
-		 * Online is a bit of a large hammer but does the job.
-		 */
-		if(unit->sectors == 0
-		|| (unit->dev->ifc->online && unit->dev->ifc->online(unit) > 1))
-			sdinitpart(unit);
-
-		i = s+Qunitbase;
-		if(i < Qpart){
-			r = sd2gen(c, i, dp);
-			qunlock(&unit->ctl);
-			decref(&sdev->r);
-			return r;
-		}
-		i -= Qpart;
-		if(unit->part == nil || i >= unit->npart){
-			qunlock(&unit->ctl);
-			decref(&sdev->r);
-			break;
-		}
-		pp = &unit->part[i];
-		if(!pp->valid){
-			qunlock(&unit->ctl);
-			decref(&sdev->r);
-			return 0;
-		}
-		l = (pp->end - pp->start) * (vlong)unit->secsize;
-		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), i, Qpart), 
-			    unit->vers+pp->vers, QTFILE);
-		if(emptystr(pp->user))
-			kstrdup(&pp->user, eve);
-		devdir(c, q, pp->name, l, pp->user, pp->perm, dp);
-		qunlock(&unit->ctl);
-		decref(&sdev->r);
-		return 1;
-	case Qraw:
-	case Qctl:
-	case Qpart:
-		if((sdev = sdgetdev(DEV(c->qid))) == nil){
-			devdir(c, q, "unavailable", 0, eve, 0, dp);
-			return 1;
-		}
-		unit = sdev->unit[UNIT(c->qid)];
-		qlock(&unit->ctl);
-		r = sd2gen(c, TYPE(c->qid), dp);
-		qunlock(&unit->ctl);
-		decref(&sdev->r);
-		return r;
-	case Qtopctl:
-	case Qtopstat:
-		return sd1gen(c, TYPE(c->qid), dp);
-	default:
-		break;
-	}
-
-	return -1;
-}
-
-static Chan*
-sdattach(char* spec)
-{
-	Chan *c;
-	char *p;
-	SDev *sdev;
-	int idno, subno, i;
-
-	if(ndevs == 0 || *spec == '\0'){
-		c = devattach(wpsddevtab.dc, spec);
-		mkqid(&c->qid, QID(0, 0, 0, Qtopdir), 0, QTDIR);
-		return c;
-	}
-
-	if(spec[0] != 's' || spec[1] != 'd')
-		error(Ebadspec);
-	idno = spec[2];
-	subno = strtol(&spec[3], &p, 0);
-	if(p == &spec[3])
-		error(Ebadspec);
-
-	qlock(&devslock);
-	for (sdev = nil, i = 0; i != ndevs; i++)
-		if ((sdev = devs[i].dt_dev) != nil && sdev->idno == idno)
-			break;
-
-	if(i == ndevs || subno >= sdev->nunit || sdgetunit(sdev, subno) == nil){
-		qunlock(&devslock);
-		error(Enonexist);
-	}
-	incref(&sdev->r);
-	qunlock(&devslock);
-
-	c = devattach(wpsddevtab.dc, spec);
-	mkqid(&c->qid, QID(sdev->idno, subno, 0, Qunitdir), 0, QTDIR);
-	c->dev = (sdev->idno << UnitLOG) + subno;
-	decref(&sdev->r);
-	return c;
-}
-
-static Walkqid*
-sdwalk(Chan* c, Chan* nc, char** name, int nname)
-{
-	return devwalk(c, nc, name, nname, nil, 0, sdgen);
-}
-
-static int
-sdstat(Chan* c, uchar* db, int n)
-{
-	return devstat(c, db, n, nil, 0, sdgen);
-}
-
-static Chan*
-sdopen(Chan* c, int omode)
-{
-	SDpart *pp;
-	SDunit *unit;
-	SDev *sdev;
-	uchar tp;
-
-	c = devopen(c, omode, 0, 0, sdgen);
-	if((tp = TYPE(c->qid)) != Qctl && tp != Qraw && tp != Qpart)
-		return c;
-
-	sdev = sdgetdev(DEV(c->qid));
-	if(sdev == nil)
-		error(Enonexist);
-	unit = sdev->unit[UNIT(c->qid)];
-
-	switch(TYPE(c->qid)){
-	case Qctl:
-		c->qid.vers = unit->vers;
-		break;
-	case Qraw:
-		c->qid.vers = unit->vers;
-		if(tas(&unit->rawinuse) != 0){
-			c->flag &= ~COPEN;
-			error(Einuse);
-		}
-		unit->state = Rawcmd;
-		break;
-	case Qpart:
-		qlock(&unit->ctl);
-		if(waserror()){
-			qunlock(&unit->ctl);
-			c->flag &= ~COPEN;
-			nexterror();
-		}
-		pp = &unit->part[PART(c->qid)];
-		c->qid.vers = unit->vers+pp->vers;
-		qunlock(&unit->ctl);
-		poperror();
-		break;
-	}
-	decref(&sdev->r);
-	return c;
-}
-
-static void
-sdclose(Chan* c)
-{
-	SDunit *unit;
-	SDev *sdev;
-
-	if(c->qid.type & QTDIR)
-		return;
-	if(!(c->flag & COPEN))
-		return;
-
-	switch(TYPE(c->qid)){
-	default:
-		break;
-	case Qraw:
-		sdev = sdgetdev(DEV(c->qid));
-		if (sdev) {
-			unit = sdev->unit[UNIT(c->qid)];
-			unit->rawinuse = 0;
-			decref(&sdev->r);
-		}
-		break;
-	}
-}
-
-static long
-sdio(Chan* c, int write, char* a, long len, vlong off)
-{
-	int nchange;
-	long l;
-	uchar *b;
-	SDpart *pp;
-	SDunit *unit;
-	SDev *sdev;
-	ulong bno, max, nb, offset;
-
-	sdev = sdgetdev(DEV(c->qid));
-	if(sdev == nil)
-		error(Enonexist);
-	unit = sdev->unit[UNIT(c->qid)];
-	if(unit == nil)
-		error(Enonexist);
-
-	nchange = 0;
-	qlock(&unit->ctl);
-	while(waserror()){
-		/* notification of media change; go around again */
-		if(strcmp(up->errstr, Eio) == 0 && unit->sectors == 0 && nchange++ == 0){
-			sdinitpart(unit);
-			continue;
-		}
-
-		/* other errors; give up */
-		qunlock(&unit->ctl);
-		decref(&sdev->r);
-		nexterror();
-	}
-	pp = &unit->part[PART(c->qid)];
-	if(unit->vers+pp->vers != c->qid.vers)
-		error(Eio);
-
-	/*
-	 * Check the request is within bounds.
-	 * Removeable drives are locked throughout the I/O
-	 * in case the media changes unexpectedly.
-	 * Non-removeable drives are not locked during the I/O
-	 * to allow the hardware to optimise if it can; this is
-	 * a little fast and loose.
-	 * It's assumed that non-removeable media parameters
-	 * (sectors, secsize) can't change once the drive has
-	 * been brought online.
-	 */
-	bno = (off/unit->secsize) + pp->start;
-	nb = ((off+len+unit->secsize-1)/unit->secsize) + pp->start - bno;
-	max = SDmaxio/unit->secsize;
-	if(nb > max)
-		nb = max;
-	if(bno+nb > pp->end)
-		nb = pp->end - bno;
-	if(bno >= pp->end || nb == 0){
-		if(write)
-			error(Eio);
-		qunlock(&unit->ctl);
-		decref(&sdev->r);
-		poperror();
-		return 0;
-	}
-	if(!(unit->inquiry[1] & 0x80)){
-		qunlock(&unit->ctl);
-		poperror();
-	}
-
-	b = malloc(nb*unit->secsize);
-	if(b == nil)
-		error(Enomem);
-	if(waserror()){
-		free(b);
-		if(!(unit->inquiry[1] & 0x80))
-			decref(&sdev->r);		/* gadverdamme! */
-		nexterror();
-	}
-
-	offset = off%unit->secsize;
-	if(offset+len > nb*unit->secsize)
-		len = nb*unit->secsize - offset;
-	if(write){
-		if(offset || (len%unit->secsize)){
-			l = unit->dev->ifc->bio(unit, 0, 0, b, nb, bno);
-			if(l < 0)
-				error(Eio);
-			if(l < (nb*unit->secsize)){
-				nb = l/unit->secsize;
-				l = nb*unit->secsize - offset;
-				if(len > l)
-					len = l;
-			}
-		}
-		memmove(b+offset, a, len);
-		l = unit->dev->ifc->bio(unit, 0, 1, b, nb, bno);
-		if(l < 0)
-			error(Eio);
-		if(l < offset)
-			len = 0;
-		else if(len > l - offset)
-			len = l - offset;
-	}
-	else{
-		l = unit->dev->ifc->bio(unit, 0, 0, b, nb, bno);
-		if(l < 0)
-			error(Eio);
-		if(l < offset)
-			len = 0;
-		else if(len > l - offset)
-			len = l - offset;
-		memmove(a, b+offset, len);
-	}
-	free(b);
-	poperror();
-
-	if(unit->inquiry[1] & 0x80){
-		qunlock(&unit->ctl);
-		poperror();
-	}
-
-	decref(&sdev->r);
-	return len;
-}
-
-static long
-sdrio(SDreq* r, void* a, long n)
-{
-	void *data;
-
-	if(n >= SDmaxio || n < 0)
-		error(Etoobig);
-
-	data = nil;
-	if(n){
-		if((data = malloc(n)) == nil)
-			error(Enomem);
-		if(r->write)
-			memmove(data, a, n);
-	}
-	r->data = data;
-	r->dlen = n;
-
-	if(waserror()){
-		if(data != nil){
-			free(data);
-			r->data = nil;
-		}
-		nexterror();
-	}
-
-	if(r->unit->dev->ifc->rio(r) != SDok)
-		error(Eio);
-
-	if(!r->write && r->rlen > 0)
-		memmove(a, data, r->rlen);
-	if(data != nil){
-		free(data);
-		r->data = nil;
-	}
-	poperror();
-
-	return r->rlen;
-}
-
-static long
-sdread(Chan *c, void *a, long n, vlong off)
-{
-	char *p, *e, *buf;
-	SDpart *pp;
-	SDunit *unit;
-	SDev *sdev;
-	ulong offset;
-	int i, l, status;
-
-	offset = off;
-	switch(TYPE(c->qid)){
-	default:
-		error(Eperm);
-	case Qtopstat:
-		p = buf = malloc(READSTR);
-		assert(p);
-		e = p + READSTR;
-		qlock(&devslock);
-		for(i = 0; i != ndevs; i++){
-			SDev *sdev = devs[i].dt_dev;
-
-			if(sdev->ifc->stat)
-				p = sdev->ifc->stat(sdev, p, e);
-			else
-				p = seprint(e, "%s; no statistics available\n", sdev->name);
-		}
-		qunlock(&devslock);
-		n = readstr(off, a, n, buf);
-		free(buf);
-		return n;
-
-	case Qtopdir:
-	case Qunitdir:
-		return devdirread(c, a, n, 0, 0, sdgen);
-
-	case Qctl:
-		sdev = sdgetdev(DEV(c->qid));
-		if (sdev == nil)
-			error(Enonexist);
-
-		unit = sdev->unit[UNIT(c->qid)];
-		p = malloc(READSTR);
-		l = snprint(p, READSTR, "inquiry %.48s\n",
-			(char*)unit->inquiry+8);
-		qlock(&unit->ctl);
-		/*
-		 * If there's a device specific routine it must
-		 * provide all information pertaining to night geometry
-		 * and the garscadden trains.
-		 */
-		if(unit->dev->ifc->rctl)
-			l += unit->dev->ifc->rctl(unit, p+l, READSTR-l);
-		if(unit->sectors == 0)
-			sdinitpart(unit);
-		if(unit->sectors){
-			if(unit->dev->ifc->rctl == nil)
-				l += snprint(p+l, READSTR-l,
-					"geometry %ld %ld\n",
-					unit->sectors, unit->secsize);
-			pp = unit->part;
-			for(i = 0; i < unit->npart; i++){
-				if(pp->valid)
-					l += snprint(p+l, READSTR-l,
-						"part %s %lud %lud\n",
-						pp->name, pp->start, pp->end);
-				pp++;
-			}
-		}
-		qunlock(&unit->ctl);
-		decref(&sdev->r);
-		l = readstr(offset, a, n, p);
-		free(p);
-		return l;
-
-	case Qraw:
-		sdev = sdgetdev(DEV(c->qid));
-		if (sdev == nil)
-			error(Enonexist);
-
-		unit = sdev->unit[UNIT(c->qid)];
-		qlock(&unit->raw);
-		if(waserror()){
-			qunlock(&unit->raw);
-			decref(&sdev->r);
-			nexterror();
-		}
-		if(unit->state == Rawdata){
-			unit->state = Rawstatus;
-			i = sdrio(unit->req, a, n);
-		}
-		else if(unit->state == Rawstatus){
-			status = unit->req->status;
-			unit->state = Rawcmd;
-			free(unit->req);
-			unit->req = nil;
-			i = readnum(0, a, n, status, NUMSIZE);
-		} else
-			i = 0;
-		qunlock(&unit->raw);
-		decref(&sdev->r);
-		poperror();
-		return i;
-
-	case Qpart:
-		return sdio(c, 0, a, n, off);
-	}
-
-	return 0;
-}
-
-typedef struct {
-	int	o_on;
-	char*	o_spec;
-	DevConf	o_cf;
-} confdata_t;
-
-static void
-parse_switch(confdata_t* cd, char* option)
-{
-	if(!strcmp("on", option))
-		cd->o_on = 1;
-	else if(!strcmp("off", option))
-		cd->o_on = 0;
-	else
-		error(Ebadarg);
-}
-
-static void
-parse_spec(confdata_t* cd, char* option)
-{
-	if(strlen(option) > 1) 
-		error(Ebadarg);
-	cd->o_spec = option;
-}
-
-static port_t*
-getnewport(DevConf* dc)
-{
-	port_t *p;
-
-	p = (port_t *)malloc((dc->nports + 1) * sizeof(port_t));
-	if(dc->nports > 0){
-		memmove(p, dc->ports, dc->nports * sizeof(port_t));
-		free(dc->ports);
-	}
-	dc->ports = p;
-	p = &dc->ports[dc->nports++];
-	p->size = -1;
-	p->port = (ulong)-1;
-	return p;
-}
-
-static void
-parse_port(confdata_t* cd, char* option)
-{
-	char *e;
-	port_t *p;
-
-	if(cd->o_cf.nports == 0 || cd->o_cf.ports[cd->o_cf.nports-1].port != (ulong)-1)
-		p = getnewport(&cd->o_cf);
-	else
-		p = &cd->o_cf.ports[cd->o_cf.nports-1];
-	p->port = strtol(option, &e, 0);
-	if(e == nil || *e != '\0')
-		error(Ebadarg);
-}
-
-static void
-parse_size(confdata_t* cd, char* option)
-{
-	char *e;
-	port_t *p;
-
-	if(cd->o_cf.nports == 0 || cd->o_cf.ports[cd->o_cf.nports-1].size != -1)
-		p = getnewport(&cd->o_cf);
-	else
-		p = &cd->o_cf.ports[cd->o_cf.nports-1];
-	p->size = (int)strtol(option, &e, 0);
-	if(e == nil || *e != '\0')
-		error(Ebadarg);
-}
-
-static void
-parse_irq(confdata_t* cd, char* option)
-{
-	char *e;
-
-	cd->o_cf.interrupt = strtoul(option, &e, 0);
-	if(e == nil || *e != '\0')
-		error(Ebadarg);
-}
-
-static void
-parse_type(confdata_t* cd, char* option)
-{
-	cd->o_cf.type = option;
-}
-
-static struct {
-	char	*option;
-	void	(*parse)(confdata_t*, char*);
-} options[] = {
-	{ 	"switch",	parse_switch,	},
-	{	"spec",		parse_spec,	},
-	{	"port",		parse_port,	},
-	{	"size",		parse_size,	},
-	{	"irq",		parse_irq,	},
-	{	"type",		parse_type,	},
-};
-
-static long
-sdwrite(Chan* c, void* a, long n, vlong off)
-{
-	Cmdbuf *cb;
-	Cmdtab *ct;
-	SDreq *req;
-	SDunit *unit;
-	SDev *sdev;
-	ulong end, start;
-
-	switch(TYPE(c->qid)){
-	default:
-		error(Eperm);
-	case Qtopctl: {
-		confdata_t cd;
-		char buf[256], *field[Ncmd];
-		int nf, i, j;
-
-		memset(&cd, 0, sizeof(confdata_t));
-		if(n > sizeof(buf)-1) n = sizeof(buf)-1;
-		memmove(buf, a, n);
-		buf[n] = '\0';
-
-		cd.o_on = -1;
-		cd.o_spec = '\0';
-		memset(&cd.o_cf, 0, sizeof(DevConf));
-
-		nf = tokenize(buf, field, Ncmd);
-		for(i = 0; i < nf; i++){
-			char *opt = field[i++];
-			if(i >= nf)
-				error(Ebadarg);
-			for(j = 0; j != nelem(options); j++)
-				if(!strcmp(opt, options[j].option))
-					break;
-					
-			if(j == nelem(options))
-				error(Ebadarg);
-			options[j].parse(&cd, field[i]);
-		}
-
-		if(cd.o_on < 0) 
-			error(Ebadarg);
-
-		if(cd.o_on){
-			if(cd.o_spec == '\0' || cd.o_cf.nports == 0 || 
-			     cd.o_cf.interrupt == 0 || cd.o_cf.type == nil)
-				error(Ebadarg);
-		}
-		else{
-			if(cd.o_spec == '\0')
-				error(Ebadarg);
-		}
-
-		if(wpsddevtab.config == nil)
-			error("No configuration function");
-		wpsddevtab.config(cd.o_on, cd.o_spec, &cd.o_cf);
-		break;
-	}
-	case Qctl:
-		sdev = sdgetdev(DEV(c->qid));
-		if (sdev == nil)
-			error(Enonexist);
-		unit = sdev->unit[UNIT(c->qid)];
-
-		cb = parsecmd(a, n);
-		qlock(&unit->ctl);
-		if(waserror()){
-			qunlock(&unit->ctl);
-			decref(&sdev->r);
-			free(cb);
-			nexterror();
-		}
-		if(unit->vers != c->qid.vers)
-			error(Eio);
-
-		ct = lookupcmd(cb, ctlmsg, nelem(ctlmsg));
-		switch(ct->index) {
-		case CMpart:
-			if(unit->sectors == 0 && !sdinitpart(unit))
-				error(Eio);
-			start = strtoul(cb->f[2], 0, 0);
-			end = strtoul(cb->f[3], 0, 0);
-			sdaddpart(unit, cb->f[1], start, end);
-			break;
-		case CMdelpart:
-			sddelpart(unit, cb->f[1]);
-			break;
-		case CMwildcard:
-			if(unit->dev->ifc->wctl == nil)
-				error(Ebadctl);
-			unit->dev->ifc->wctl(unit, cb);
-			break;
-		}
-		poperror();
-		qunlock(&unit->ctl);
-		decref(&sdev->r);
-		free(cb);
-		break;
-
-	case Qraw:
-		sdev = sdgetdev(DEV(c->qid));
-		if(sdev == nil)
-			error(Enonexist);
-		unit = sdev->unit[UNIT(c->qid)];
-		qlock(&unit->raw);
-		if(waserror()){
-			qunlock(&unit->raw);
-			decref(&sdev->r);
-			nexterror();
-		}
-		switch(unit->state){
-		case Rawcmd:
-			if(n < 6 || n > sizeof(req->cmd))
-				error(Ebadarg);
-			if((req = malloc(sizeof(SDreq))) == nil)
-				error(Enomem);
-			req->unit = unit;
-			memmove(req->cmd, a, n);
-			req->clen = n;
-			req->flags = SDnosense;
-			req->status = ~0;
-
-			unit->req = req;
-			unit->state = Rawdata;
-			break;
-
-		case Rawstatus:
-			unit->state = Rawcmd;
-			free(unit->req);
-			unit->req = nil;
-			error(Ebadusefd);
-
-		case Rawdata:
-			if(unit->state != Rawdata)
-				error(Ebadusefd);
-			unit->state = Rawstatus;
-
-			unit->req->write = 1;
-			n = sdrio(unit->req, a, n);
-		}
-		qunlock(&unit->raw);
-		decref(&sdev->r);
-		poperror();
-		break;
-	case Qpart:
-		return sdio(c, 1, a, n, off);
-	}
-
-	return n;
-}
-
-static int
-sdwstat(Chan* c, uchar* dp, int n)
-{
-	Dir *d;
-	SDpart *pp;
-	SDperm *perm;
-	SDunit *unit;
-	SDev *sdev;
-
-	if(c->qid.type & QTDIR)
-		error(Eperm); 
-
-	sdev = sdgetdev(DEV(c->qid));
-	if (sdev == nil)
-		error(Enonexist);
-	unit = sdev->unit[UNIT(c->qid)];
-	qlock(&unit->ctl);
-	d = nil;
-	if(waserror()){
-		free(d);
-		qunlock(&unit->ctl);
-		decref(&sdev->r);
-		nexterror();
-	}
-
-	switch(TYPE(c->qid)){
-	default:
-		error(Eperm);
-	case Qctl:
-		perm = &unit->ctlperm;
-		break;
-	case Qraw:
-		perm = &unit->rawperm;
-		break;
-	case Qpart:
-		pp = &unit->part[PART(c->qid)];
-		if(unit->vers+pp->vers != c->qid.vers)
-			error(Enonexist);
-		perm = &pp->SDperm;
-		break;
-	}
-
-	if(strcmp(up->user, perm->user) && !iseve())
-		error(Eperm);
-
-	d = smalloc(sizeof(Dir)+n);
-	n = convM2D(dp, n, &d[0], (char*)&d[1]);
-	if(n == 0)
-		error(Eshortstat);
-	if(!emptystr(d[0].uid))
-		kstrdup(&perm->user, d[0].uid);
-	if(d[0].mode != ~0UL)
-		perm->perm = (perm->perm & ~0777) | (d[0].mode & 0777);
-
-	free(d);
-	qunlock(&unit->ctl);
-	decref(&sdev->r);
-	poperror();
-	return n;
-}
-
-static char
-getspec(char base)
-{
-	while(1){
-		int i;
-		SDev *sdev;
-
-		for(i = 0; i != ndevs; i++)
-			if((sdev = devs[i].dt_dev) != nil && (char)sdev->idno == base)
-				break;
-
-		if(i == ndevs)
-			return base;
-		base++;
-	}
-	return '\0';
-}
-
-static int
-configure(char* spec, DevConf* cf)
-{
-	ISAConf isa;
-	dev_t *_devs;
-	SDev *tail, *sdev, *(*probe)(DevConf*);
-	char *p, name[32];
-	int i, added_devs;
-
-	if((p = strchr(cf->type, '/')) != nil)
-		*p++ = '\0';
-
-	for(i = 0; sdifc[i] != nil; i++)
-		if(!strcmp(sdifc[i]->name, cf->type))
-			break;
-
-	if(sdifc[i] == nil)
-		error("type not found");
-	
-	if((probe = sdifc[i]->probe) == nil)
-		error("No probe function");
-
-	if(p){
-		/* Try to find the card on the ISA bus.  This code really belongs
-		     in sdata and I'll move it later.  Really! */
-		memset(&isa, 0, sizeof(isa));
-		isa.port = cf->ports[0].port;
-		isa.irq = cf->interrupt;
-
-		if(pcmspecial(p, &isa) < 0)
-			error("Cannot find controller");
-	}
-
-	qlock(&devslock);
-	if(waserror()){
-		qunlock(&devslock);
-		nexterror();
-	}
-	
-	for(i = 0; i != ndevs; i++)
-		if((sdev = devs[i].dt_dev) != nil && sdev->idno == *spec)
-			break;
-	if(i != ndevs)
-		error(Eexist);
-
-	if((sdev = (*probe)(cf)) == nil)
-		error("Cannot probe controller");
-	poperror();
-
-	added_devs = 0;
-	tail = sdev;
-	while(tail){
-		added_devs++;
-		tail = tail->next;
-	}
-	
-	_devs = (dev_t*)malloc((ndevs + added_devs) * sizeof(dev_t));
-	memmove(_devs, devs, ndevs * sizeof(dev_t));
-	free(devs);
-	devs = _devs;
-
-	while(sdev){
-		/* Assign `spec' to the device */
-		*spec = getspec(*spec);
-		snprint(name, sizeof(name), "sd%c", *spec);
-		kstrdup(&sdev->name, name);
-		sdev->idno = *spec;
-		sdev->unit = (SDunit **)malloc(sdev->nunit * sizeof(SDunit*));
-		sdev->unitflg = (int *)malloc(sdev->nunit * sizeof(int));
-		assert(sdev->unit && sdev->unitflg);
-
-		devs[ndevs].dt_dev = sdev;
-		devs[ndevs].dt_nunits = sdev->nunit;
-		sdev = sdev->next;
-		devs[ndevs].dt_dev->next = nil;
-		ndevs++;
-	}
-
-	qunlock(&devslock);
-	return 0;
-}
-
-static int
-unconfigure(char* spec)
-{
-	int i;	
-	SDev *sdev;
-
-	qlock(&devslock);
-	if(waserror()){
-		qunlock(&devslock);
-		nexterror();
-	}
-
-	sdev = nil;
-	for(i = 0; i != ndevs; i++)
-		if((sdev = devs[i].dt_dev) != nil && sdev->idno == *spec)
-			break;
-
-	if(i == ndevs)
-		error(Enonexist);
-
-	if(sdev->r.ref)
-		error(Einuse);
-
-	/* make sure no interrupts arrive anymore before removing resources */
-	if(sdev->enabled && sdev->ifc->disable)
-		sdev->ifc->disable(sdev);
-
-	/* we're alone and the device tab is locked; make the device unavailable */
-	memmove(&devs[i], &devs[ndevs - 1], sizeof(dev_t));
-	memset(&devs[ndevs - 1], 0, sizeof(dev_t));
-	ndevs--;
-
-	qunlock(&devslock);
-	poperror();
-
-	for(i = 0; i != sdev->nunit; i++)
-		if(sdev->unit[i]){
-			SDunit *unit = sdev->unit[i];
-
-			free(unit->name);
-			free(unit->user);
-			free(unit);
-		}
-
-	if(sdev->ifc->clear)
-		sdev->ifc->clear(sdev);
-	return 0;
-}
-
-static int
-sdconfig(int on, char* spec, DevConf* cf)
-{
-	if(on)
-		return configure(spec, cf);
-	return unconfigure(spec);
-}
-
-Dev wpwpsddevtab = {
-	'S',
-	"sd",
-
-	sdreset,
-	devinit,
-	devshutdown,
-	sdattach,
-	sdwalk,
-	sdstat,
-	sdopen,
-	devcreate,
-	sdclose,
-	sdread,
-	devbread,
-	sdwrite,
-	devbwrite,
-	devremove,
-	sdwstat,
-	devpower,
-	sdconfig,
-};

+ 47 - 38
sys/src/9/port/master

@@ -1,38 +1,47 @@
-	root	/
-	audio	A
-	bridge	B
-	sac	C
-	ssl	D
-	sdp	E
-	tinyfs	F
-	astar	G
-	ip	I
-	kprof	K
-	lpt	L
-	mnt	M
-	arch	P
-	realtime	R
-	sd	S
-	lm78	T
-	usb	U
-	lml	V
-	loopback	X
-	cardbus	Y
-	tls	a
-	cons	c
-	dup	d
-	env	e
-	floppy	f
-	draw	i
-	fs	k
-	ether	l
-	mouse	m
-	proc	p
-	rtc	r
-	srv	s
-	uart	t
-	vga	v
-	pcmcia	y
-	i82365	y
-	mntstats	z
-	pipe	|
+$	pnp
+/	root
+A	audio
+A	uda1341
+B	bridge
+D	ssl
+E	sdp
+F	flash
+F	tinyfs
+I	ip
+K	kprof
+L	lpt
+M	mnt
+P	arch
+R	realtime
+S	sd
+T	lm78
+U	usb
+V	lml
+V	tv
+V	tvnew
+X	loopback
+Y	pccard
+a	tls
+b	irq
+c	cons
+d	dup
+e	env
+f	floppy
+g	segment
+i	draw
+k	fs
+l	ether
+m	mouse
+m	nmouse
+m	penmouse
+p	proc
+r	rtc
+r	µc
+s	srv
+t	uart
+v	vga
+y	i82365
+y	pcmcia
+z	mntstats
+|	pipe
+¤	cap

+ 9 - 0
sys/src/9/port/mkfile

@@ -0,0 +1,9 @@
+# If the existence of this mkfile screws something up, rename it.	-rsc
+
+master:D:
+	echo '
+		X , s/Dev (.*)devtab.*{.*\n	L?''(.*)''/DEV \1 \2\n/
+		X ,x g/^DEV/ p
+	' | sam -d ../*/dev*.c >[2]/dev/null |
+	awk '/^DEV/ { printf("%s\t%s\n", $3, $2); }' |
+	sort -u >master

+ 8 - 2
sys/src/9/port/portdat.h

@@ -124,10 +124,15 @@ enum
 	CCACHE	= 0x0080,		/* client cache */
 	CCACHE	= 0x0080,		/* client cache */
 };
 };
 
 
+/* flag values */
 enum
 enum
 {
 {
 	BINTR	=	(1<<0),
 	BINTR	=	(1<<0),
 	BFREE	=	(1<<1),
 	BFREE	=	(1<<1),
+	Bipck	=	(1<<2),		/* ip checksum */
+	Budpck	=	(1<<3),		/* udp checksum */
+	Btcpck	=	(1<<4),		/* tcp checksum */
+	Bpktck	=	(1<<5),		/* packet checksum */
 };
 };
 
 
 struct Block
 struct Block
@@ -137,9 +142,10 @@ struct Block
 	uchar*	rp;			/* first unconsumed byte */
 	uchar*	rp;			/* first unconsumed byte */
 	uchar*	wp;			/* first empty byte */
 	uchar*	wp;			/* first empty byte */
 	uchar*	lim;			/* 1 past the end of the buffer */
 	uchar*	lim;			/* 1 past the end of the buffer */
-	uchar*	base;		/* start of the buffer */
+	uchar*	base;			/* start of the buffer */
 	void	(*free)(Block*);
 	void	(*free)(Block*);
-	ulong	flag;
+	ushort	flag;
+	ushort	checksum;		/* IP checksum of complete packet (minus media header) */
 };
 };
 #define BLEN(s)	((s)->wp - (s)->rp)
 #define BLEN(s)	((s)->wp - (s)->rp)
 #define BALLOC(s) ((s)->lim - (s)->base)
 #define BALLOC(s) ((s)->lim - (s)->base)

+ 0 - 761
sys/src/ape/cmd/make/gram.c

@@ -1,761 +0,0 @@
-
-#line	1	"/sys/src/ape/cmd/make/gram.y"
-#include "defs.h"
-
-#line	5	"/sys/src/ape/cmd/make/gram.y"
-typedef union 
-	{
-	struct shblock *yshblock;
-	depblkp ydepblock;
-	nameblkp ynameblock;
-	} YYSTYPE;
-extern	int	yyerrflag;
-#ifndef	YYMAXDEPTH
-#define	YYMAXDEPTH	150
-#endif
-YYSTYPE	yylval;
-YYSTYPE	yyval;
-
-#line	20	"/sys/src/ape/cmd/make/gram.y"
-struct depblock *pp;
-static struct shblock *prevshp;
-
-static struct nameblock *lefts[NLEFTS];
-struct nameblock *leftp;
-static int nlefts;
-
-struct lineblock *lp, *lpp;
-static struct depblock *prevdep;
-static int sepc;
-static int allnowait;
-
-static struct fstack
-	{
-	FILE *fin;
-	char *fname;
-	int lineno;
-	} filestack[MAXINCLUDE];
-static int ninclude = 0;
-#define	NAME	57346
-#define	SHELLINE	57347
-#define	START	57348
-#define	MACRODEF	57349
-#define	COLON	57350
-#define	DOUBLECOLON	57351
-#define	GREATER	57352
-#define	AMPER	57353
-#define	AMPERAMPER	57354
-#define YYEOFCODE 1
-#define YYERRCODE 2
-
-#line	149	"/sys/src/ape/cmd/make/gram.y"
-
-
-static char *zznextc;	/* null if need another line;
-			   otherwise points to next char */
-static int yylineno;
-static FILE * fin;
-static int retsh(char *);
-static int nextlin(void);
-static int isinclude(char *);
-
-int yyparse(void);
-
-int
-parse(char *name)
-{
-FILE *stream;
-
-if(name == CHNULL)
-	{
-	stream = NULL;
-	name = "(builtin-rules)";
-	}
-else if(equal(name, "-"))
-	{
-	stream = stdin;
-	name = "(stdin)";
-	}
-else if( (stream = fopen(name, "r")) == NULL)
-	return NO;
-filestack[0].fname = copys(name);
-ninclude = 1;
-fin = stream;
-yylineno = 0;
-zznextc = 0;
-
-if( yyparse() )
-	fatal("Description file error");
-
-if(fin)
-	fclose(fin);
-return YES;
-}
-
-int
-yylex(void)
-{
-char *p;
-char *q;
-char word[INMAX];
-
-if(! zznextc )
-	return nextlin() ;
-
-while( isspace(*zznextc) )
-	++zznextc;
-switch(*zznextc)
-	{
-	case '\0':
-		return nextlin() ;
-
-	case '|':
-		if(zznextc[1]==':')
-			{
-			zznextc += 2;
-			return DOUBLECOLON;
-			}
-		break;
-	case ':':
-		if(*++zznextc == ':')
-			{
-			++zznextc;
-			return DOUBLECOLON;
-			}
-		return COLON;
-	case '>':
-		++zznextc;
-		return GREATER;
-	case '&':
-		if(*++zznextc == '&')
-			{
-			++zznextc;
-			return AMPERAMPER;
-			}
-		return AMPER;
-	case ';':
-		return retsh(zznextc) ;
-	}
-
-p = zznextc;
-q = word;
-
-while( ! ( funny[*p] & TERMINAL) )
-	*q++ = *p++;
-
-if(p != zznextc)
-	{
-	*q = '\0';
-	if((yylval.ynameblock=srchname(word))==0)
-		yylval.ynameblock = makename(word);
-	zznextc = p;
-	return NAME;
-	}
-
-else	{
-	char junk[100];
-	sprintf(junk, "Bad character %c (octal %o), line %d of file %s",
-		*zznextc, *zznextc, yylineno, filestack[ninclude-1].fname);
-	fatal(junk);
-	}
-return 0;	/* never executed */
-}
-
-
-
-
-static int
-retsh(char *q)
-{
-register char *p;
-struct shblock *sp;
-
-for(p=q+1 ; *p==' '||*p=='\t' ; ++p)  ;
-
-sp = ALLOC(shblock);
-sp->nxtshblock = NULL;
-sp->shbp = (fin ? copys(p) : p );
-yylval.yshblock = sp;
-zznextc = 0;
-return SHELLINE;
-}
-
-static int
-nextlin(void)
-{
-static char yytext[INMAX];
-static char *yytextl	= yytext+INMAX;
-char *text, templin[INMAX];
-char c;
-char *p, *t;
-char lastch, *lastchp;
-extern char **linesptr;
-int incom;
-int kc;
-
-again:
-
-	incom = NO;
-	zznextc = 0;
-
-if(fin == NULL)
-	{
-	if( (text = *linesptr++) == 0)
-		return 0;
-	++yylineno;
-	}
-
-else	{
-	for(p = text = yytext ; p<yytextl ; *p++ = kc)
-		switch(kc = getc(fin))
-			{
-			case '\t':
-				if(p == yytext)
-					incom = YES;
-				break;
-
-			case ';':
-				incom = YES;
-				break;
-
-			case '#':
-				if(! incom)
-					kc = '\0';
-				break;
-
-			case '\n':
-				++yylineno;
-				if(p==yytext || p[-1]!='\\')
-					{
-					*p = '\0';
-					goto endloop;
-					}
-				p[-1] = ' ';
-				while( (kc=getc(fin))=='\t' || kc==' ' || kc=='\n')
-					if(kc == '\n')
-						++yylineno;
-	
-				if(kc != EOF)
-					break;
-			case EOF:
-				*p = '\0';
-				if(ninclude > 1)
-					{
-					register struct fstack *stp;
-					fclose(fin);
-					--ninclude;
-					stp = filestack + ninclude;
-					fin = stp->fin;
-					yylineno = stp->lineno;
-					free(stp->fname);
-					goto again;
-					}
-				return 0;
-			}
-
-	fatal("line too long");
-	}
-
-endloop:
-
-	if((c = text[0]) == '\t')
-		return retsh(text) ;
-	
-	if(isalpha(c) || isdigit(c) || c==' ' || c=='.'|| c=='_')
-		for(p=text+1; *p!='\0'; )
-			if(*p == ':')
-				break;
-			else if(*p++ == '=')
-				{
-				eqsign(text);
-				return MACRODEF;
-				}
-
-/* substitute for macros on dependency line up to the semicolon if any */
-
-for(t = yytext ; *t!='\0' && *t!=';' ; ++t)
-	;
-
-lastchp = t;
-lastch = *t;
-*t = '\0';	/* replace the semi with a null so subst will stop */
-
-subst(yytext, templin);		/* Substitute for macros on dependency lines */
-
-if(lastch)	/* copy the stuff after the semicolon */
-	{
-	*lastchp = lastch;
-	strcat(templin, lastchp);
-	}
-
-strcpy(yytext, templin);
-
-/* process include files after macro substitution */
-if(strncmp(text, "include", 7) == 0) {
- 	if (isinclude(text+7))
-		goto again;
-}
-
-for(p = zznextc = text ; *p ; ++p )
-	if(*p!=' ' && *p!='\t')
-		return START;
-goto again;
-}
-
-
-static int
-isinclude(char *s)
-{
-char *t;
-struct fstack *p;
-
-for(t=s; *t==' ' || *t=='\t' ; ++t)
-	;
-if(t == s)
-	return NO;
-
-for(s = t; *s!='\n' && *s!='#' && *s!='\0' ; ++s)
-	if(*s == ':')
-		return NO;
-*s = '\0';
-
-if(ninclude >= MAXINCLUDE)
-	fatal("include depth exceeded");
-p = filestack + ninclude;
-p->fin = fin;
-p->lineno = yylineno;
-p->fname = copys(t);
-if( (fin = fopen(t, "r")) == NULL)
-	fatal1("Cannot open include file %s", t);
-yylineno = 0;
-++ninclude;
-return YES;
-}
-
-
-int
-yyerror(char *s, ...)
-{
-char buf[100];
-
-sprintf(buf, "line %d of file %s: %s",
-		yylineno, filestack[ninclude-1].fname, s);
-fatal(buf);
-}
-short	yyexca[] =
-{-1, 1,
-	1, -1,
-	-2, 0,
-};
-#define	YYNPROD	22
-#define	YYPRIVATE 57344
-#define	YYLAST	21
-short	yyact[] =
-{
-  17,  20,  21,  16,   7,   9,  11,  18,  19,  12,
-  13,   5,   2,   1,  10,   3,   4,   8,   6,  14,
-  15
-};
-short	yypact[] =
-{
--1000,   9,-1000,   0,-1000,-1000,   1,-1000,  -2,-1000,
-  -4, -10,-1000,-1000,-1000,  -3,-1000,-1000,-1000,-1000,
--1000,-1000
-};
-short	yypgo[] =
-{
-   0,  20,  19,  18,  17,  14,  13,  12,   6
-};
-short	yyr1[] =
-{
-   0,   6,   6,   7,   7,   7,   7,   3,   3,   4,
-   4,   5,   5,   5,   5,   5,   8,   8,   2,   2,
-   1,   1
-};
-short	yyr2[] =
-{
-   0,   0,   2,   1,   1,   4,   1,   1,   2,   0,
-   1,   1,   2,   2,   2,   2,   1,   1,   0,   1,
-   1,   2
-};
-short	yychk[] =
-{
--1000,  -6,  -7,   6,   7,   2,  -3,   4,  -4,   4,
-  -5,  -8,   8,   9,  -2,  -1,   5,   4,  11,  12,
-  11,   5
-};
-short	yydef[] =
-{
-   1,  -2,   2,   3,   4,   6,   9,   7,  18,   8,
-  10,  11,  16,  17,   5,  19,  20,  13,  14,  15,
-  12,  21
-};
-short	yytok1[] =
-{
-   1
-};
-short	yytok2[] =
-{
-   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,
-  12
-};
-long	yytok3[] =
-{
-   0
-};
-#define YYFLAG 		-1000
-#define YYERROR		goto yyerrlab
-#define YYACCEPT	return(0)
-#define YYABORT		return(1)
-#define	yyclearin	yychar = -1
-#define	yyerrok		yyerrflag = 0
-
-#ifdef	yydebug
-#include	"y.debug"
-#else
-#define	yydebug		0
-char*	yytoknames[1];		/* for debugging */
-char*	yystates[1];		/* for debugging */
-#endif
-
-/*	parser for yacc output	*/
-
-int	yynerrs = 0;		/* number of errors */
-int	yyerrflag = 0;		/* error recovery flag */
-
-extern	int	fprint(int, char*, ...);
-extern	int	sprint(char*, char*, ...);
-
-char*
-yytokname(int yyc)
-{
-	static char x[10];
-
-	if(yyc > 0 && yyc <= sizeof(yytoknames)/sizeof(yytoknames[0]))
-	if(yytoknames[yyc-1])
-		return yytoknames[yyc-1];
-	sprintf(x, "<%d>", yyc);
-	return x;
-}
-
-char*
-yystatname(int yys)
-{
-	static char x[10];
-
-	if(yys >= 0 && yys < sizeof(yystates)/sizeof(yystates[0]))
-	if(yystates[yys])
-		return yystates[yys];
-	sprintf(x, "<%d>\n", yys);
-	return x;
-}
-
-long
-yylex1(void)
-{
-	long yychar;
-	long *t3p;
-	int c;
-
-	yychar = yylex();
-	if(yychar <= 0) {
-		c = yytok1[0];
-		goto out;
-	}
-	if(yychar < sizeof(yytok1)/sizeof(yytok1[0])) {
-		c = yytok1[yychar];
-		goto out;
-	}
-	if(yychar >= YYPRIVATE)
-		if(yychar < YYPRIVATE+sizeof(yytok2)/sizeof(yytok2[0])) {
-			c = yytok2[yychar-YYPRIVATE];
-			goto out;
-		}
-	for(t3p=yytok3;; t3p+=2) {
-		c = t3p[0];
-		if(c == yychar) {
-			c = t3p[1];
-			goto out;
-		}
-		if(c == 0)
-			break;
-	}
-	c = 0;
-
-out:
-	if(c == 0)
-		c = yytok2[1];	/* unknown char */
-	if(yydebug >= 3)
-		printf("lex %.4X %s\n", yychar, yytokname(c));
-	return c;
-}
-
-int
-yyparse(void)
-{
-	struct
-	{
-		YYSTYPE	yyv;
-		int	yys;
-	} yys[YYMAXDEPTH], *yyp, *yypt;
-	short *yyxi;
-	int yyj, yym, yystate, yyn, yyg;
-	YYSTYPE save1, save2;
-	int save3, save4;
-	long yychar;
-
-	save1 = yylval;
-	save2 = yyval;
-	save3 = yynerrs;
-	save4 = yyerrflag;
-
-	yystate = 0;
-	yychar = -1;
-	yynerrs = 0;
-	yyerrflag = 0;
-	yyp = &yys[-1];
-	goto yystack;
-
-ret0:
-	yyn = 0;
-	goto ret;
-
-ret1:
-	yyn = 1;
-	goto ret;
-
-ret:
-	yylval = save1;
-	yyval = save2;
-	yynerrs = save3;
-	yyerrflag = save4;
-	return yyn;
-
-yystack:
-	/* put a state and value onto the stack */
-	if(yydebug >= 4)
-		printf("char %s in %s", yytokname(yychar), yystatname(yystate));
-
-	yyp++;
-	if(yyp >= &yys[YYMAXDEPTH]) { 
-		yyerror("yacc stack overflow"); 
-		goto ret1; 
-	}
-	yyp->yys = yystate;
-	yyp->yyv = yyval;
-
-yynewstate:
-	yyn = yypact[yystate];
-	if(yyn <= YYFLAG)
-		goto yydefault; /* simple state */
-	if(yychar < 0)
-		yychar = yylex1();
-	yyn += yychar;
-	if(yyn < 0 || yyn >= YYLAST)
-		goto yydefault;
-	yyn = yyact[yyn];
-	if(yychk[yyn] == yychar) { /* valid shift */
-		yychar = -1;
-		yyval = yylval;
-		yystate = yyn;
-		if(yyerrflag > 0)
-			yyerrflag--;
-		goto yystack;
-	}
-
-yydefault:
-	/* default state action */
-	yyn = yydef[yystate];
-	if(yyn == -2) {
-		if(yychar < 0)
-			yychar = yylex1();
-
-		/* look through exception table */
-		for(yyxi=yyexca;; yyxi+=2)
-			if(yyxi[0] == -1 && yyxi[1] == yystate)
-				break;
-		for(yyxi += 2;; yyxi += 2) {
-			yyn = yyxi[0];
-			if(yyn < 0 || yyn == yychar)
-				break;
-		}
-		yyn = yyxi[1];
-		if(yyn < 0)
-			goto ret0;
-	}
-	if(yyn == 0) {
-		/* error ... attempt to resume parsing */
-		switch(yyerrflag) {
-		case 0:   /* brand new error */
-			yyerror("syntax error");
-			if(yydebug >= 1) {
-				printf("%s", yystatname(yystate));
-				printf("saw %s\n", yytokname(yychar));
-			}
-yyerrlab:
-			yynerrs++;
-
-		case 1:
-		case 2: /* incompletely recovered error ... try again */
-			yyerrflag = 3;
-
-			/* find a state where "error" is a legal shift action */
-			while(yyp >= yys) {
-				yyn = yypact[yyp->yys] + YYERRCODE;
-				if(yyn >= 0 && yyn < YYLAST) {
-					yystate = yyact[yyn];  /* simulate a shift of "error" */
-					if(yychk[yystate] == YYERRCODE)
-						goto yystack;
-				}
-
-				/* the current yyp has no shift onn "error", pop stack */
-				if(yydebug >= 2)
-					printf("error recovery pops state %d, uncovers %d\n",
-						yyp->yys, (yyp-1)->yys );
-				yyp--;
-			}
-			/* there is no state on the stack with an error shift ... abort */
-			goto ret1;
-
-		case 3:  /* no shift yet; clobber input char */
-			if(yydebug >= YYEOFCODE)
-				printf("error recovery discards %s\n", yytokname(yychar));
-			if(yychar == YYEOFCODE)
-				goto ret1;
-			yychar = -1;
-			goto yynewstate;   /* try again in the same state */
-		}
-	}
-
-	/* reduction by production yyn */
-	if(yydebug >= 2)
-		printf("reduce %d in:\n\t%s", yyn, yystatname(yystate));
-
-	yypt = yyp;
-	yyp -= yyr2[yyn];
-	yyval = (yyp+1)->yyv;
-	yym = yyn;
-
-	/* consult goto table to find next state */
-	yyn = yyr1[yyn];
-	yyg = yypgo[yyn];
-	yyj = yyg + yyp->yys + 1;
-
-	if(yyj >= YYLAST || yychk[yystate=yyact[yyj]] != -yyn)
-		yystate = yyact[yyg];
-	switch(yym) {
-		
-case 5:
-#line	48	"/sys/src/ape/cmd/make/gram.y"
- {
-	    while( --nlefts >= 0)
-		{
-		wildp wp;
-
-		leftp = lefts[nlefts];
-		if(wp = iswild(leftp->namep))
-			{
-			leftp->septype = SOMEDEPS;
-			if(lastwild)
-				lastwild->next = wp;
-			else
-				firstwild = wp;
-			lastwild = wp;
-			}
-
-		if(leftp->septype == 0)
-			leftp->septype = sepc;
-		else if(leftp->septype != sepc)
-			{
-			if(! wp)
-				fprintf(stderr,
-					"Inconsistent rules lines for `%s'\n",
-					leftp->namep);
-			}
-		else if(sepc==ALLDEPS && leftp->namep[0]!='.' && yypt[-0].yyv.yshblock!=0)
-			{
-			for(lp=leftp->linep; lp->nxtlineblock; lp=lp->nxtlineblock)
-			if(lp->shp)
-				fprintf(stderr,
-					"Multiple rules lines for `%s'\n",
-					leftp->namep);
-			}
-
-		lp = ALLOC(lineblock);
-		lp->nxtlineblock = NULL;
-		lp->depp = yypt[-1].yyv.ydepblock;
-		lp->shp = yypt[-0].yyv.yshblock;
-		if(wp)
-			wp->linep = lp;
-
-		if(equal(leftp->namep, ".SUFFIXES") && yypt[-1].yyv.ydepblock==0)
-			leftp->linep = 0;
-		else if(leftp->linep == 0)
-			leftp->linep = lp;
-		else	{
-			for(lpp = leftp->linep; lpp->nxtlineblock;
-				lpp = lpp->nxtlineblock) ;
-				if(sepc==ALLDEPS && leftp->namep[0]=='.')
-					lpp->shp = 0;
-			lpp->nxtlineblock = lp;
-			}
-		}
-	} break;
-case 7:
-#line	105	"/sys/src/ape/cmd/make/gram.y"
- { lefts[0] = yypt[-0].yyv.ynameblock; nlefts = 1; } break;
-case 8:
-#line	106	"/sys/src/ape/cmd/make/gram.y"
- { lefts[nlefts++] = yypt[-0].yyv.ynameblock;
-	    	if(nlefts>=NLEFTS) fatal("Too many lefts"); } break;
-case 9:
-#line	111	"/sys/src/ape/cmd/make/gram.y"
-{
-		char junk[100];
-		sprintf(junk, "%s:%d", filestack[ninclude-1].fname, yylineno);
-		fatal1("Must be a separator on rules line %s", junk);
-		} break;
-case 11:
-#line	119	"/sys/src/ape/cmd/make/gram.y"
- { prevdep = 0;  yyval.ydepblock = 0; allnowait = NO; } break;
-case 12:
-#line	120	"/sys/src/ape/cmd/make/gram.y"
- { prevdep = 0; yyval.ydepblock = 0; allnowait = YES; } break;
-case 13:
-#line	121	"/sys/src/ape/cmd/make/gram.y"
- {
-			  pp = ALLOC(depblock);
-			  pp->nxtdepblock = NULL;
-			  pp->depname = yypt[-0].yyv.ynameblock;
-			  pp->nowait = allnowait;
-			  if(prevdep == 0) yyval.ydepblock = pp;
-			  else  prevdep->nxtdepblock = pp;
-			  prevdep = pp;
-			  } break;
-case 14:
-#line	130	"/sys/src/ape/cmd/make/gram.y"
- { if(prevdep) prevdep->nowait = YES; } break;
-case 16:
-#line	134	"/sys/src/ape/cmd/make/gram.y"
- { sepc = ALLDEPS; } break;
-case 17:
-#line	135	"/sys/src/ape/cmd/make/gram.y"
- { sepc = SOMEDEPS; } break;
-case 18:
-#line	138	"/sys/src/ape/cmd/make/gram.y"
- {yyval.yshblock = 0; } break;
-case 19:
-#line	139	"/sys/src/ape/cmd/make/gram.y"
- { yyval.yshblock = yypt[-0].yyv.yshblock; } break;
-case 20:
-#line	142	"/sys/src/ape/cmd/make/gram.y"
- { yyval.yshblock = yypt[-0].yyv.yshblock;  prevshp = yypt[-0].yyv.yshblock; } break;
-case 21:
-#line	143	"/sys/src/ape/cmd/make/gram.y"
- { yyval.yshblock = yypt[-1].yyv.yshblock;
-			prevshp->nxtshblock = yypt[-0].yyv.yshblock;
-			prevshp = yypt[-0].yyv.yshblock;
-			} break;
-	}
-	goto yystack;  /* stack new state and value */
-}

+ 1 - 0
sys/src/ape/cmd/pdksh/README.Plan9

@@ -22,3 +22,4 @@ March 2000
 	bind pdksh over rc for use in mk,
 	bind pdksh over rc for use in mk,
 	a dubious justification.
 	a dubious justification.
 
 
+31 Dec 2002: rsc: Killed all ifdefs.

+ 1 - 186
sys/src/ape/cmd/pdksh/alloc.c

@@ -4,83 +4,7 @@
 
 
 #include "sh.h"
 #include "sh.h"
 
 
-#ifdef TEST_ALLOC
-# define shellf	printf
-# ifndef DEBUG_ALLOC
-#  define DEBUG_ALLOC
-# endif /* DEBUG_ALLOC */
-#endif /* TEST_ALLOC */
-
-#ifdef MEM_DEBUG
-
-/*
- * Special versions of alloc routines if doing mem_debug
- */
-Area *
-_chmem_ainit(ap, file, line)
-	Area *ap;
-	const char *file;
-	int line;
-{
-	ap->freelist = (struct Block *) _chmem_newpool("ainit", (char *) 0, -1,
-						file, line);
-	if (!ap->freelist)
-	    aerror(ap, "ainit failed (ie, newpool)");
-	return ap;
-}
-
-/* free all object in Area */
-void
-_chmem_afreeall(ap, file, line)
-	Area *ap;
-	const char *file;
-	int line;
-{
-	_chmem_delpool((Chmem_poolp) ap->freelist, 0, file, line);
-	/* Kind of ugly, but it works */
-	_chmem_ainit(ap, file, line);
-}
 
 
-/* allocate object from Area */
-void *
-_chmem_alloc(size, ap, file, line)
-	size_t size;
-	Area *ap;
-	const char *file;
-	int line;
-{
-	return _chmem_mallocp((Chmem_poolp) ap->freelist, size, file, line);
-}
-
-/* change size of object -- like realloc */
-void *
-_chmem_aresize(ptr, size, ap, file, line)
-	void *ptr;
-	size_t size;
-	Area *ap;
-	const char *file;
-	int line;
-{
-	if (!ptr)
-		/* Done as realloc(0, size) is not portable */
-		return _chmem_mallocp((Chmem_poolp) ap->freelist, size,
-					file, line);
-	else
-		return _chmem_reallocp((Chmem_poolp) ap->freelist, ptr, size,
-					file, line);
-}
-
-void
-_chmem_afree(ptr, ap, file, line)
-	void *ptr;
-	Area *ap;
-	const char *file;
-	int line;
-{
-	return _chmem_freep((Chmem_poolp) ap->freelist, ptr, file, line);
-}
-
-#else /* MEM_DEBUG */
 
 
 # if DEBUG_ALLOC
 # if DEBUG_ALLOC
 void acheck ARGS((Area *ap));
 void acheck ARGS((Area *ap));
@@ -663,114 +587,5 @@ aprint(ap, ptr, size)
 		}
 		}
 	}
 	}
 }
 }
-# endif /* DEBUG_ALLOC */
-
-# ifdef TEST_ALLOC
-
-Area a;
-FILE *myout;
-
-int
-main(int argc, char **argv)
-{
-	char buf[1024];
-	struct info {
-		int size;
-		void *value;
-	};
-	struct info info[1024 * 2];
-	int size, ident;
-	int lineno = 0;
-
-	myout = stdout;
-	ainit(&a);
-	while (fgets(buf, sizeof(buf), stdin)) {
-		lineno++;
-		if (buf[0] == '\n' || buf[0] == '#')
-			continue;
-		if (sscanf(buf, " alloc %d = i%d", &size, &ident) == 2) {
-			if (ident < 0 || ident > NELEM(info)) {
-				fprintf(stderr, "bad ident (%d) on line %d\n",
-					ident, lineno);
-				exit(1);
-			}
-			info[ident].value = alloc(info[ident].size = size, &a);
-			printf("%p = alloc(%d) [%d,i%d]\n", 
-				info[ident].value, info[ident].size,
-				lineno, ident);
-			memset(info[ident].value, 1, size);
-			continue;
-		}
-		if (sscanf(buf, " afree i%d", &ident) == 1) {
-			if (ident < 0 || ident > NELEM(info)) {
-				fprintf(stderr, "bad ident (%d) on line %d\n",
-					ident, lineno);
-				exit(1);
-			}
-			afree(info[ident].value, &a);
-			printf("afree(%p) [%d,i%d]\n", info[ident].value,
-				lineno, ident);
-			continue;
-		}
-		if (sscanf(buf, " aresize i%d , %d", &ident, &size) == 2) {
-			void *value;
-			if (ident < 0 || ident > NELEM(info)) {
-				fprintf(stderr, "bad ident (%d) on line %d\n",
-					ident, lineno);
-				exit(1);
-			}
-			value = info[ident].value;
-			info[ident].value = aresize(value,
-						    info[ident].size = size,
-						    &a);
-			printf("%p = aresize(%p, %d) [%d,i%d]\n", 
-				info[ident].value, value, info[ident].size,
-				lineno, ident);
-			memset(info[ident].value, 1, size);
-			continue;
-		}
-		if (sscanf(buf, " aprint i%d , %d", &ident, &size) == 2) {
-			if (ident < 0 || ident > NELEM(info)) {
-				fprintf(stderr, "bad ident (%d) on line %d\n",
-					ident, lineno);
-				exit(1);
-			}
-			printf("aprint(%p, %d) [%d,i%d]\n",
-				info[ident].value, size, lineno, ident);
-			aprint(&a, info[ident].value, size);
-			continue;
-		}
-		if (sscanf(buf, " aprint %d", &ident) == 1) {
-			if (ident < 0 || ident > NELEM(info)) {
-				fprintf(stderr, "bad ident (%d) on line %d\n",
-					ident, lineno);
-				exit(1);
-			}
-			printf("aprint(0, 0) [%d]\n", lineno);
-			aprint(&a, 0, 0);
-			continue;
-		}
-		if (sscanf(buf, " afreeall %d", &ident) == 1) {
-			printf("afreeall() [%d]\n", lineno);
-			afreeall(&a);
-			memset(info, 0, sizeof(info));
-			continue;
-		}
-		fprintf(stderr, "unrecognized line (line %d)\n",
-			lineno);
-		exit(1);
-	}
-	return 0;
-}
-
-void
-aerror(Area *ap, const char *msg)
-{
-	printf("aerror: %s\n", msg);
-	fflush(stdout);
-	abort();
-}
-
-# endif /* TEST_ALLOC */
 
 
-#endif /* MEM_DEBUG */
+#endif

+ 5 - 1
sys/src/boot/alphapc/conf.c

@@ -33,12 +33,16 @@ setconf(char *buf)
 	 * string, then it only gets done once.
 	 * string, then it only gets done once.
 	 */
 	 */
 	strcpy(bootargs, buf);
 	strcpy(bootargs, buf);
+	/* print("boot: stashing /alpha/conf boot args at 0x%lux\n",
+		bootargs);			/* DEBUG */
 	conf.bootargs = bootargs;
 	conf.bootargs = bootargs;
 
 
 	n = getcfields(buf, line, MAXCONF, "\n");
 	n = getcfields(buf, line, MAXCONF, "\n");
 	for(i = 0; i < n; i++){
 	for(i = 0; i < n; i++){
+		if(*line[i] == '#')
+			continue;
 		cp = strchr(line[i], '=');
 		cp = strchr(line[i], '=');
-		if(cp == 0)
+		if(cp == nil)
 			continue;
 			continue;
 		*cp++ = 0;
 		*cp++ = 0;
 		if(cp - line[i] >= NAMELEN+1)
 		if(cp - line[i] >= NAMELEN+1)

+ 29 - 6
sys/src/boot/alphapc/cons.c

@@ -4,6 +4,24 @@
 #include	"fns.h"
 #include	"fns.h"
 #include	"lib.h"
 #include	"lib.h"
 
 
+enum {
+	/* prom operations */
+	Promop_getc   = 1,
+	Promop_puts   = 2,
+	Promop_open   = 0x10,
+	Promop_close  = 0x11,
+	Promop_read   = 0x13,
+	Promop_write  = 0x14,
+	Promop_getenv = 0x22,
+
+	/* environment variable indices for getenv */
+	/* auto_action might be 1; it looks that way. */
+	Promenv_booted_dev	= 4,
+	Promenv_booted_file	= 6,
+	Promenv_booted_osflags	= 8,
+	Promenv_tty_dev		= 0xf,
+};
+
 Hwrpb	*hwrpb;
 Hwrpb	*hwrpb;
 
 
 static uvlong	dispatchf;
 static uvlong	dispatchf;
@@ -90,12 +108,17 @@ dumpenv(void)
 	int id, n;
 	int id, n;
 	static char buf[256];
 	static char buf[256];
 
 
-	for (id = 1; id < 0x100; id++) {
-		n = dispatch(0x22, id, (uvlong)buf, sizeof(buf), 0);
-		if (n <= 0)
+	/* old upper bound was 0x100, which blows up on my 164LX. 50 works. */
+	for (id = 1; id < 50; id++) {
+		n = dispatch(Promop_getenv, id, (uvlong)buf, sizeof(buf)-1, 0);
+		if (n == 0)
 			continue;
 			continue;
+		if (n < 0) {
+			print("dispatch failed at id %d\n", id);
+			break;
+		}
 		buf[n] = 0;
 		buf[n] = 0;
-		print("env[%x]: %s\n", id, buf);
+		print("env[0x%x]: %s\n", id, buf);
 	}
 	}
 }
 }
 
 
@@ -106,10 +129,10 @@ getenv(char *name)
 	static char buf[256];
 	static char buf[256];
 
 
 	if (strcmp(name, "booted_dev") == 0)
 	if (strcmp(name, "booted_dev") == 0)
-		id = 4;
+		id = Promenv_booted_dev;
 	else
 	else
 		return 0;
 		return 0;
-	n = dispatch(0x22, id, (uvlong)buf, sizeof(buf), 0);
+	n = dispatch(Promop_getenv, id, (uvlong)buf, sizeof(buf), 0);
 	if (n < 0)
 	if (n < 0)
 		return 0;
 		return 0;
 	buf[n] = 0;
 	buf[n] = 0;

+ 1 - 1
sys/src/boot/alphapc/mkfile

@@ -31,7 +31,7 @@ install:V: $TARGET
 	cp $TARGET /$objtype
 	cp $TARGET /$objtype
 
 
 clean nuke:V:
 clean nuke:V:
-	rm *.$O $TARGET
+	rm -f *.$O $TARGET
 
 
 %.$O:	%.s
 %.$O:	%.s
 	$AS $stem.s
 	$AS $stem.s

+ 3 - 0
sys/src/boot/pc/sdata.c

@@ -1355,6 +1355,8 @@ atapnp(void)
 			pcicfgw32(p, 0x40, r);
 			pcicfgw32(p, 0x40, r);
 			break;
 			break;
 		case (0x4D38<<16)|0x105A:	/* Promise PDC20262 */
 		case (0x4D38<<16)|0x105A:	/* Promise PDC20262 */
+		case (0x4D30<<16)|0x105A:	/* Promise PDC202xx */
+		case (0x0004<<16)|0x1103:	/* HighPoint HPT-370 */
 			pi = 0x85;
 			pi = 0x85;
 			break;
 			break;
 		case (0x0640<<16)|0x1095:	/* CMD 640B */
 		case (0x0640<<16)|0x1095:	/* CMD 640B */
@@ -1366,6 +1368,7 @@ atapnp(void)
 		case (0x0571<<16)|0x1106:	/* VIA 82C686 */
 		case (0x0571<<16)|0x1106:	/* VIA 82C686 */
 		case (0x0211<<16)|0x1166:	/* ServerWorks IB6566 */
 		case (0x0211<<16)|0x1166:	/* ServerWorks IB6566 */
 		case (0x1230<<16)|0x8086:	/* 82371FB (PIIX) */
 		case (0x1230<<16)|0x8086:	/* 82371FB (PIIX) */
+		case (0x248A<<16)|0x8086:	/* 82801BAM ICH2-M */
 		case (0x7010<<16)|0x8086:	/* 82371SB (PIIX3) */
 		case (0x7010<<16)|0x8086:	/* 82371SB (PIIX3) */
 		case (0x7111<<16)|0x8086:	/* 82371[AE]B (PIIX4[E]) */
 		case (0x7111<<16)|0x8086:	/* 82371[AE]B (PIIX4[E]) */
 			break;
 			break;

+ 9 - 9
sys/src/cmd/1l/asm.c

@@ -41,7 +41,7 @@ asmb(void)
 		if(p->pc != pc) {
 		if(p->pc != pc) {
 			if(!debug['a'])
 			if(!debug['a'])
 				print("%P\n", curp);
 				print("%P\n", curp);
-			diag("phase error %.4lux sb %.4lux in %s\n", p->pc, pc, TNAME);
+			diag("phase error %.4lux sb %.4lux in %s", p->pc, pc, TNAME);
 			pc = p->pc;
 			pc = p->pc;
 		}
 		}
 		curp = p;
 		curp = p;
@@ -552,7 +552,7 @@ asmins(Prog *p)
 		if(p->as != ATEXT && p->as != ANOP) {
 		if(p->as != ATEXT && p->as != ANOP) {
 			if(!debug['a'])
 			if(!debug['a'])
 				print("%P\n", p);
 				print("%P\n", p);
-			diag("unimplemented instruction in %s\n", TNAME);
+			diag("unimplemented instruction in %s", TNAME);
 			return;
 			return;
 		}
 		}
 		op = opa;
 		op = opa;
@@ -1101,7 +1101,7 @@ asmins(Prog *p)
 bad:
 bad:
 	if(!debug['a'])
 	if(!debug['a'])
 		print("%P\n", p);
 		print("%P\n", p);
-	diag("bad combination of addressing in %s\n", TNAME);
+	diag("bad combination of addressing in %s", TNAME);
 	opa[0] = 0;
 	opa[0] = 0;
 }
 }
 
 
@@ -1161,7 +1161,7 @@ asmea(Prog *p, Adr *a)
 	case I_ADDR|D_EXTERN:
 	case I_ADDR|D_EXTERN:
 		t = a->sym->type;
 		t = a->sym->type;
 		if(t == 0 || t == SXREF) {
 		if(t == 0 || t == SXREF) {
-			diag("undefined external: %s in %s\n",
+			diag("undefined external: %s in %s",
 				a->sym->name, TNAME);
 				a->sym->name, TNAME);
 			a->sym->type = SDATA;
 			a->sym->type = SDATA;
 		}
 		}
@@ -1181,7 +1181,7 @@ asmea(Prog *p, Adr *a)
 			break;
 			break;
 
 
 		default:
 		default:
-			diag("unknown srcsp asmea in %s\n", TNAME);
+			diag("unknown srcsp asmea in %s", TNAME);
 		}
 		}
 		return (7<<3) | 4;
 		return (7<<3) | 4;
 
 
@@ -1220,7 +1220,7 @@ asmea(Prog *p, Adr *a)
 	case D_EXTERN:
 	case D_EXTERN:
 		t = a->sym->type;
 		t = a->sym->type;
 		if(t == 0 || t == SXREF) {
 		if(t == 0 || t == SXREF) {
-			diag("undefined external: %s in %s\n",
+			diag("undefined external: %s in %s",
 				a->sym->name, TNAME);
 				a->sym->name, TNAME);
 			a->sym->type = SDATA;
 			a->sym->type = SDATA;
 		}
 		}
@@ -1331,7 +1331,7 @@ datblk(long s, long n)
 		for(j=l+(c-i)-1; j>=l; j--)
 		for(j=l+(c-i)-1; j>=l; j--)
 			if(buf.dbuf[j]) {
 			if(buf.dbuf[j]) {
 				print("%P\n", p);
 				print("%P\n", p);
-				diag("multiple initialization\n");
+				diag("multiple initialization");
 				break;
 				break;
 			}
 			}
 		switch(p->to.type) {
 		switch(p->to.type) {
@@ -1394,7 +1394,7 @@ datblk(long s, long n)
 			cast = (char*)&fl;
 			cast = (char*)&fl;
 			switch(c) {
 			switch(c) {
 			default:
 			default:
-				diag("bad nuxi %d %d\n%P\n", c, i, curp);
+				diag("bad nuxi %d %d\n%P", c, i, curp);
 				break;
 				break;
 			case 1:
 			case 1:
 				if(debug['a'] && i == 0) {
 				if(debug['a'] && i == 0) {
@@ -1493,7 +1493,7 @@ gnuxi(Ieee *d, int i, int c)
 
 
 	switch(c) {
 	switch(c) {
 	default:
 	default:
-		diag("bad nuxi %d %d\n%P\n", c, i, curp);
+		diag("bad nuxi %d %d\n%P", c, i, curp);
 		return 0;
 		return 0;
 	
 	
 		/*
 		/*

+ 16 - 16
sys/src/cmd/1l/obj.c

@@ -71,7 +71,7 @@ main(int argc, char *argv[])
 	USED(argc);
 	USED(argc);
 
 
 	if(*argv == 0) {
 	if(*argv == 0) {
-		diag("usage: 2l [-options] objects\n");
+		diag("usage: 2l [-options] objects");
 		errorexit();
 		errorexit();
 	}
 	}
 	if(HEADTYPE == -1)
 	if(HEADTYPE == -1)
@@ -146,7 +146,7 @@ main(int argc, char *argv[])
 	Bflush(&bso);
 	Bflush(&bso);
 	for(i=1; optab[i].as; i++)
 	for(i=1; optab[i].as; i++)
 		if(i != optab[i].as) {
 		if(i != optab[i].as) {
-			diag("phase error in optab: %d\n", i);
+			diag("phase error in optab: %d", i);
 			errorexit();
 			errorexit();
 		}
 		}
 	maxop = i;
 	maxop = i;
@@ -196,7 +196,7 @@ main(int argc, char *argv[])
 	pc = 0;
 	pc = 0;
 	cout = create(outfile, 1, 0775);
 	cout = create(outfile, 1, 0775);
 	if(cout < 0) {
 	if(cout < 0) {
-		diag("cannot create %s\n", outfile);
+		diag("cannot create %s", outfile);
 		errorexit();
 		errorexit();
 	}
 	}
 	version = 0;
 	version = 0;
@@ -297,7 +297,7 @@ objfile(char *file)
 	Bflush(&bso);
 	Bflush(&bso);
 	f = open(file, 0);
 	f = open(file, 0);
 	if(f < 0) {
 	if(f < 0) {
-		diag("cannot open file: %s\n", file);
+		diag("cannot open file: %s", file);
 		errorexit();
 		errorexit();
 	}
 	}
 	l = read(f, magbuf, SARMAG);
 	l = read(f, magbuf, SARMAG);
@@ -312,11 +312,11 @@ objfile(char *file)
 
 
 	l = read(f, &arhdr, SAR_HDR);
 	l = read(f, &arhdr, SAR_HDR);
 	if(l != SAR_HDR) {
 	if(l != SAR_HDR) {
-		diag("%s: short read on archive file symbol header\n", file);
+		diag("%s: short read on archive file symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
-		diag("%s: first entry not symbol header\n", file);
+		diag("%s: first entry not symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 
 
@@ -364,7 +364,7 @@ objfile(char *file)
 			l = atolwhex(arhdr.size);
 			l = atolwhex(arhdr.size);
 			ldobj(f, l, pname);
 			ldobj(f, l, pname);
 			if(s->type == SXREF) {
 			if(s->type == SXREF) {
-				diag("%s: failed to load: %s\n", file, s->name);
+				diag("%s: failed to load: %s", file, s->name);
 				errorexit();
 				errorexit();
 			}
 			}
 			work = 1;
 			work = 1;
@@ -373,7 +373,7 @@ objfile(char *file)
 	return;
 	return;
 
 
 bad:
 bad:
-	diag("%s: bad or out of date archive\n", file);
+	diag("%s: bad or out of date archive", file);
 out:
 out:
 	close(f);
 	close(f);
 }
 }
@@ -690,7 +690,7 @@ loop:
 	if(o <= 0 || o >= maxop) {
 	if(o <= 0 || o >= maxop) {
 		if(o < 0)
 		if(o < 0)
 			goto eof;
 			goto eof;
-		diag("%s: opcode out of range %d\n", pn, o);
+		diag("%s: opcode out of range %d", pn, o);
 		print("	probably not a .2 file\n");
 		print("	probably not a .2 file\n");
 		errorexit();
 		errorexit();
 	}
 	}
@@ -787,7 +787,7 @@ loop:
 			s->value = 0;
 			s->value = 0;
 		}
 		}
 		if(s->type != SBSS) {
 		if(s->type != SBSS) {
-			diag("%s: redefinition: %s in %s\n",
+			diag("%s: redefinition: %s in %s",
 				pn, s->name, TNAME);
 				pn, s->name, TNAME);
 			s->type = SBSS;
 			s->type = SBSS;
 			s->value = 0;
 			s->value = 0;
@@ -803,7 +803,7 @@ loop:
 		goto loop;
 		goto loop;
 
 
 	case AGOK:
 	case AGOK:
-		diag("%s: unknown opcode in %s\n", pn, TNAME);
+		diag("%s: unknown opcode in %s", pn, TNAME);
 		pc++;
 		pc++;
 		goto loop;
 		goto loop;
 
 
@@ -819,7 +819,7 @@ loop:
 		p->pc = pc;
 		p->pc = pc;
 		s = p->from.sym;
 		s = p->from.sym;
 		if(s->type != 0 && s->type != SXREF)
 		if(s->type != 0 && s->type != SXREF)
-			diag("%s: redefinition: %s\n", pn, s->name);
+			diag("%s: redefinition: %s", pn, s->name);
 		s->type = STEXT;
 		s->type = STEXT;
 		s->value = p->pc;
 		s->value = p->pc;
 		pc++;
 		pc++;
@@ -982,7 +982,7 @@ loop:
 	goto loop;
 	goto loop;
 
 
 eof:
 eof:
-	diag("%s: truncated object file in %s\n", pn, TNAME);
+	diag("%s: truncated object file in %s", pn, TNAME);
 }
 }
 
 
 Sym*
 Sym*
@@ -1076,7 +1076,7 @@ gethunk(void)
 	}
 	}
 	h = mysbrk(nh);
 	h = mysbrk(nh);
 	if(h == (char*)-1) {
 	if(h == (char*)-1) {
-		diag("out of memory\n");
+		diag("out of memory");
 		errorexit();
 		errorexit();
 	}
 	}
 	hunk = h;
 	hunk = h;
@@ -1151,7 +1151,7 @@ doprof2(void)
 	s2 = lookup("_profin", 0);
 	s2 = lookup("_profin", 0);
 	s4 = lookup("_profout", 0);
 	s4 = lookup("_profout", 0);
 	if(s2->type != STEXT || s4->type != STEXT) {
 	if(s2->type != STEXT || s4->type != STEXT) {
-		diag("_profin/_profout not defined\n");
+		diag("_profin/_profout not defined");
 		return;
 		return;
 	}
 	}
 
 
@@ -1326,7 +1326,7 @@ ieeedtof(Ieee *e)
 		}
 		}
 	}
 	}
 	if(exp <= -126 || exp >= 130)
 	if(exp <= -126 || exp >= 130)
-		diag("double fp to single fp overflow\n");
+		diag("double fp to single fp overflow");
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= e->h & 0x80000000L;
 	v |= e->h & 0x80000000L;
 	return v;
 	return v;

+ 12 - 12
sys/src/cmd/1l/pass.c

@@ -16,11 +16,11 @@ dodata(void)
 		if(s->type == SBSS)
 		if(s->type == SBSS)
 			s->type = SDATA;
 			s->type = SDATA;
 		if(s->type != SDATA)
 		if(s->type != SDATA)
-			diag("initialize non-data (%d): %s\n%P\n",
+			diag("initialize non-data (%d): %s\n%P",
 				s->type, s->name, p);
 				s->type, s->name, p);
 		t = p->from.offset + p->from.displace;
 		t = p->from.offset + p->from.displace;
 		if(t > s->value)
 		if(t > s->value)
-			diag("initialize bounds (%ld): %s\n%P\n",
+			diag("initialize bounds (%ld): %s\n%P",
 				s->value, s->name, p);
 				s->value, s->name, p);
 	}
 	}
 
 
@@ -33,7 +33,7 @@ dodata(void)
 			continue;
 			continue;
 		t = s->value;
 		t = s->value;
 		if(t == 0) {
 		if(t == 0) {
-			diag("%s: no size\n", s->name);
+			diag("%s: no size", s->name);
 			t = 1;
 			t = 1;
 		}
 		}
 		t = rnd(t, 4);;
 		t = rnd(t, 4);;
@@ -262,7 +262,7 @@ relinv(int a)
 	case AFBNE:	return AFBEQ;
 	case AFBNE:	return AFBEQ;
 	case AFBT:	return AFBF;
 	case AFBT:	return AFBF;
 	}
 	}
-	diag("unknown relation: %s in %s\n", anames[a], TNAME);
+	diag("unknown relation: %s in %s", anames[a], TNAME);
 	return a;
 	return a;
 }
 }
 
 
@@ -289,7 +289,7 @@ patch(void)
 		if((p->as == ABSR || p->as == ARTS) && p->to.sym != S) {
 		if((p->as == ABSR || p->as == ARTS) && p->to.sym != S) {
 			s = p->to.sym;
 			s = p->to.sym;
 			if(s->type != STEXT) {
 			if(s->type != STEXT) {
-				diag("undefined: %s in %s\n", s->name, TNAME);
+				diag("undefined: %s in %s", s->name, TNAME);
 				s->type = STEXT;
 				s->type = STEXT;
 				s->value = vexit;
 				s->value = vexit;
 			}
 			}
@@ -310,7 +310,7 @@ patch(void)
 			q = q->link;
 			q = q->link;
 		}
 		}
 		if(q == P) {
 		if(q == P) {
-			diag("branch out of range in %s\n%P\n", TNAME, p);
+			diag("branch out of range in %s\n%P", TNAME, p);
 			p->to.type = D_NONE;
 			p->to.type = D_NONE;
 		}
 		}
 		p->pcond = q;
 		p->pcond = q;
@@ -411,7 +411,7 @@ dostkoff(void)
 				break;
 				break;
 			if(q->stkoff >= 0)
 			if(q->stkoff >= 0)
 				if(q->stkoff != s)
 				if(q->stkoff != s)
-					diag("stack offset %ld is %ld sb %ld in %s\n%P\n",
+					diag("stack offset %ld is %ld sb %ld in %s\n%P",
 						q->pc, q->stkoff, s, q, TNAME, p);
 						q->pc, q->stkoff, s, q, TNAME, p);
 			q->stkoff = s;
 			q->stkoff = s;
 			if(t++ > 100) {
 			if(t++ > 100) {
@@ -619,7 +619,7 @@ undef(void)
 	for(i=0; i<NHASH; i++)
 	for(i=0; i<NHASH; i++)
 	for(s = hash[i]; s != S; s = s->link)
 	for(s = hash[i]; s != S; s = s->link)
 		if(s->type == SXREF)
 		if(s->type == SXREF)
-			diag("%s: not defined\n", s->name);
+			diag("%s: not defined", s->name);
 }
 }
 
 
 void
 void
@@ -655,19 +655,19 @@ initmuldiv2(void)
 				prog_ccr = p;
 				prog_ccr = p;
 		}
 		}
 	if(prog_mull == P) {
 	if(prog_mull == P) {
-		diag("undefined: %s\n", s1->name);
+		diag("undefined: %s", s1->name);
 		prog_mull = curtext;
 		prog_mull = curtext;
 	}
 	}
 	if(prog_divsl == P) {
 	if(prog_divsl == P) {
-		diag("undefined: %s\n", s2->name);
+		diag("undefined: %s", s2->name);
 		prog_divsl = curtext;
 		prog_divsl = curtext;
 	}
 	}
 	if(prog_divul == P) {
 	if(prog_divul == P) {
-		diag("undefined: %s\n", s3->name);
+		diag("undefined: %s", s3->name);
 		prog_divul = curtext;
 		prog_divul = curtext;
 	}
 	}
 	if(prog_ccr == P) {
 	if(prog_ccr == P) {
-		diag("undefined: %s\n", s4->name);
+		diag("undefined: %s", s4->name);
 		prog_ccr = curtext;
 		prog_ccr = curtext;
 	}
 	}
 }
 }

+ 1 - 1
sys/src/cmd/1l/span.c

@@ -85,7 +85,7 @@ loop:
 		Bprint(&bso, "%5.2f span %d\n", cputime(), n);
 		Bprint(&bso, "%5.2f span %d\n", cputime(), n);
 	Bflush(&bso);
 	Bflush(&bso);
 	if(n > 60) {
 	if(n > 60) {
-		diag("span must be looping\n");
+		diag("span must be looping");
 		errorexit();
 		errorexit();
 	}
 	}
 	c = INITTEXT;
 	c = INITTEXT;

+ 12 - 12
sys/src/cmd/2l/asm.c

@@ -41,7 +41,7 @@ asmb(void)
 		if(p->pc != pc) {
 		if(p->pc != pc) {
 			if(!debug['a'])
 			if(!debug['a'])
 				print("%P\n", curp);
 				print("%P\n", curp);
-			diag("phase error %lux sb %lux in %s\n", p->pc, pc, TNAME);
+			diag("phase error %lux sb %lux in %s", p->pc, pc, TNAME);
 			pc = p->pc;
 			pc = p->pc;
 		}
 		}
 		curp = p;
 		curp = p;
@@ -532,7 +532,7 @@ asmins(Prog *p)
 		if(p->as != ATEXT && p->as != ANOP) {
 		if(p->as != ATEXT && p->as != ANOP) {
 			if(!debug['a'])
 			if(!debug['a'])
 				print("%P\n", p);
 				print("%P\n", p);
-			diag("unimplemented instruction in %s\n", TNAME);
+			diag("unimplemented instruction in %s", TNAME);
 			return;
 			return;
 		}
 		}
 		op = opa;
 		op = opa;
@@ -1100,7 +1100,7 @@ asmins(Prog *p)
 bad:
 bad:
 	if(!debug['a'])
 	if(!debug['a'])
 		print("%P\n", p);
 		print("%P\n", p);
-	diag("bad combination of addressing in %s\n", TNAME);
+	diag("bad combination of addressing in %s", TNAME);
 	opa[0] = 0;
 	opa[0] = 0;
 }
 }
 
 
@@ -1162,7 +1162,7 @@ asmea(Prog *p, Adr *a)
 	case I_ADDR|D_EXTERN:
 	case I_ADDR|D_EXTERN:
 		t = a->sym->type;
 		t = a->sym->type;
 		if(t == 0 || t == SXREF) {
 		if(t == 0 || t == SXREF) {
-			diag("undefined external: %s in %s\n",
+			diag("undefined external: %s in %s",
 				a->sym->name, TNAME);
 				a->sym->name, TNAME);
 			a->sym->type = SDATA;
 			a->sym->type = SDATA;
 		}
 		}
@@ -1180,7 +1180,7 @@ asmea(Prog *p, Adr *a)
 			break;
 			break;
 
 
 		default:
 		default:
-			diag("unknown srcsp asmea in %s\n", TNAME);
+			diag("unknown srcsp asmea in %s", TNAME);
 		}
 		}
 		return (7<<3) | 4;
 		return (7<<3) | 4;
 
 
@@ -1216,7 +1216,7 @@ asmea(Prog *p, Adr *a)
 	case D_EXTERN:
 	case D_EXTERN:
 		t = a->sym->type;
 		t = a->sym->type;
 		if(t == 0 || t == SXREF) {
 		if(t == 0 || t == SXREF) {
-			diag("undefined external: %s in %s\n",
+			diag("undefined external: %s in %s",
 				a->sym->name, TNAME);
 				a->sym->name, TNAME);
 			a->sym->type = SDATA;
 			a->sym->type = SDATA;
 		}
 		}
@@ -1250,7 +1250,7 @@ asmea(Prog *p, Adr *a)
 	}
 	}
 	if(!debug['a'])
 	if(!debug['a'])
 		print("%P\n", p);
 		print("%P\n", p);
-	diag("unknown addressing mode: %d in %s\n", t, TNAME);
+	diag("unknown addressing mode: %d in %s", t, TNAME);
 	return 0;
 	return 0;
 
 
 index:
 index:
@@ -1291,7 +1291,7 @@ index:
 	case D_EXTERN:
 	case D_EXTERN:
 		t = a->sym->type;
 		t = a->sym->type;
 		if(t == 0 || t == SXREF) {
 		if(t == 0 || t == SXREF) {
-			diag("undefined external: %s in %s\n",
+			diag("undefined external: %s in %s",
 				a->sym->name, TNAME);
 				a->sym->name, TNAME);
 			a->sym->type = SDATA;
 			a->sym->type = SDATA;
 		}
 		}
@@ -1348,7 +1348,7 @@ index:
 bad:
 bad:
 	if(!debug['a'])
 	if(!debug['a'])
 		print("%P\n", p);
 		print("%P\n", p);
-	diag("bad operand in %s\n", TNAME);
+	diag("bad operand in %s", TNAME);
 	return 0;
 	return 0;
 }
 }
 
 
@@ -1412,7 +1412,7 @@ datblk(long s, long n)
 		for(j=l+(c-i)-1; j>=l; j--)
 		for(j=l+(c-i)-1; j>=l; j--)
 			if(buf.dbuf[j]) {
 			if(buf.dbuf[j]) {
 				print("%P\n", p);
 				print("%P\n", p);
-				diag("multiple initialization\n");
+				diag("multiple initialization");
 				break;
 				break;
 			}
 			}
 		switch(p->to.type) {
 		switch(p->to.type) {
@@ -1475,7 +1475,7 @@ datblk(long s, long n)
 			cast = (char*)&fl;
 			cast = (char*)&fl;
 			switch(c) {
 			switch(c) {
 			default:
 			default:
-				diag("bad nuxi %d %d\n%P\n", c, i, curp);
+				diag("bad nuxi %d %d\n%P", c, i, curp);
 				break;
 				break;
 			case 1:
 			case 1:
 				if(debug['a'] && i == 0) {
 				if(debug['a'] && i == 0) {
@@ -1528,7 +1528,7 @@ gnuxi(Ieee *d, int i, int c)
 
 
 	switch(c) {
 	switch(c) {
 	default:
 	default:
-		diag("bad nuxi %d %d\n%P\n", c, i, curp);
+		diag("bad nuxi %d %d\n%P", c, i, curp);
 		return 0;
 		return 0;
 	
 	
 		/*
 		/*

+ 16 - 16
sys/src/cmd/2l/obj.c

@@ -75,7 +75,7 @@ main(int argc, char *argv[])
 	USED(argc);
 	USED(argc);
 
 
 	if(*argv == 0) {
 	if(*argv == 0) {
-		diag("usage: 2l [-options] objects\n");
+		diag("usage: 2l [-options] objects");
 		errorexit();
 		errorexit();
 	}
 	}
 	if(!debug['9'] && !debug['U'] && !debug['B'])
 	if(!debug['9'] && !debug['U'] && !debug['B'])
@@ -160,7 +160,7 @@ main(int argc, char *argv[])
 	Bflush(&bso);
 	Bflush(&bso);
 	for(i=1; optab[i].as; i++)
 	for(i=1; optab[i].as; i++)
 		if(i != optab[i].as) {
 		if(i != optab[i].as) {
-			diag("phase error in optab: %d\n", i);
+			diag("phase error in optab: %d", i);
 			errorexit();
 			errorexit();
 		}
 		}
 	maxop = i;
 	maxop = i;
@@ -211,7 +211,7 @@ main(int argc, char *argv[])
 	pc = 0;
 	pc = 0;
 	cout = create(outfile, 1, 0775);
 	cout = create(outfile, 1, 0775);
 	if(cout < 0) {
 	if(cout < 0) {
-		diag("cannot create %s\n", outfile);
+		diag("cannot create %s", outfile);
 		errorexit();
 		errorexit();
 	}
 	}
 	version = 0;
 	version = 0;
@@ -314,7 +314,7 @@ objfile(char *file)
 	Bflush(&bso);
 	Bflush(&bso);
 	f = open(file, 0);
 	f = open(file, 0);
 	if(f < 0) {
 	if(f < 0) {
-		diag("cannot open file: %s\n", file);
+		diag("cannot open file: %s", file);
 		errorexit();
 		errorexit();
 	}
 	}
 	l = read(f, magbuf, SARMAG);
 	l = read(f, magbuf, SARMAG);
@@ -329,11 +329,11 @@ objfile(char *file)
 
 
 	l = read(f, &arhdr, SAR_HDR);
 	l = read(f, &arhdr, SAR_HDR);
 	if(l != SAR_HDR) {
 	if(l != SAR_HDR) {
-		diag("%s: short read on archive file symbol header\n", file);
+		diag("%s: short read on archive file symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
-		diag("%s: first entry not symbol header\n", file);
+		diag("%s: first entry not symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 
 
@@ -381,7 +381,7 @@ objfile(char *file)
 			l = atolwhex(arhdr.size);
 			l = atolwhex(arhdr.size);
 			ldobj(f, l, pname);
 			ldobj(f, l, pname);
 			if(s->type == SXREF) {
 			if(s->type == SXREF) {
-				diag("%s: failed to load: %s\n", file, s->name);
+				diag("%s: failed to load: %s", file, s->name);
 				errorexit();
 				errorexit();
 			}
 			}
 			work = 1;
 			work = 1;
@@ -390,7 +390,7 @@ objfile(char *file)
 	return;
 	return;
 
 
 bad:
 bad:
-	diag("%s: bad or out of date archive\n", file);
+	diag("%s: bad or out of date archive", file);
 out:
 out:
 	close(f);
 	close(f);
 }
 }
@@ -716,7 +716,7 @@ loop:
 	if(o <= 0 || o >= maxop) {
 	if(o <= 0 || o >= maxop) {
 		if(o < 0)
 		if(o < 0)
 			goto eof;
 			goto eof;
-		diag("%s: opcode out of range %d\n", pn, o);
+		diag("%s: opcode out of range %d", pn, o);
 		print("	probably not a .2 file\n");
 		print("	probably not a .2 file\n");
 		errorexit();
 		errorexit();
 	}
 	}
@@ -813,7 +813,7 @@ loop:
 			s->value = 0;
 			s->value = 0;
 		}
 		}
 		if(s->type != SBSS) {
 		if(s->type != SBSS) {
-			diag("%s: redefinition: %s in %s\n",
+			diag("%s: redefinition: %s in %s",
 				pn, s->name, TNAME);
 				pn, s->name, TNAME);
 			s->type = SBSS;
 			s->type = SBSS;
 			s->value = 0;
 			s->value = 0;
@@ -833,7 +833,7 @@ loop:
 		goto loop;
 		goto loop;
 
 
 	case AGOK:
 	case AGOK:
-		diag("%s: unknown opcode in %s\n", pn, TNAME);
+		diag("%s: unknown opcode in %s", pn, TNAME);
 		pc++;
 		pc++;
 		goto loop;
 		goto loop;
 
 
@@ -849,7 +849,7 @@ loop:
 		p->pc = pc;
 		p->pc = pc;
 		s = p->from.sym;
 		s = p->from.sym;
 		if(s->type != 0 && s->type != SXREF)
 		if(s->type != 0 && s->type != SXREF)
-			diag("%s: redefinition: %s\n", pn, s->name);
+			diag("%s: redefinition: %s", pn, s->name);
 		s->type = STEXT;
 		s->type = STEXT;
 		s->value = p->pc;
 		s->value = p->pc;
 		pc++;
 		pc++;
@@ -1017,7 +1017,7 @@ loop:
 	goto loop;
 	goto loop;
 
 
 eof:
 eof:
-	diag("%s: truncated object file in %s\n", pn, TNAME);
+	diag("%s: truncated object file in %s", pn, TNAME);
 }
 }
 
 
 Sym*
 Sym*
@@ -1109,7 +1109,7 @@ gethunk(void)
 	}
 	}
 	h = mysbrk(nh);
 	h = mysbrk(nh);
 	if(h == (char*)-1) {
 	if(h == (char*)-1) {
-		diag("out of memory\n");
+		diag("out of memory");
 		errorexit();
 		errorexit();
 	}
 	}
 	hunk = h;
 	hunk = h;
@@ -1184,7 +1184,7 @@ doprof2(void)
 	s2 = lookup("_profin", 0);
 	s2 = lookup("_profin", 0);
 	s4 = lookup("_profout", 0);
 	s4 = lookup("_profout", 0);
 	if(s2->type != STEXT || s4->type != STEXT) {
 	if(s2->type != STEXT || s4->type != STEXT) {
-		diag("_profin/_profout not defined\n");
+		diag("_profin/_profout not defined");
 		return;
 		return;
 	}
 	}
 
 
@@ -1359,7 +1359,7 @@ ieeedtof(Ieee *e)
 		}
 		}
 	}
 	}
 	if(exp <= -126 || exp >= 130)
 	if(exp <= -126 || exp >= 130)
-		diag("double fp to single fp overflow\n");
+		diag("double fp to single fp overflow");
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= e->h & 0x80000000L;
 	v |= e->h & 0x80000000L;
 	return v;
 	return v;

+ 10 - 10
sys/src/cmd/2l/pass.c

@@ -16,11 +16,11 @@ dodata(void)
 		if(s->type == SBSS)
 		if(s->type == SBSS)
 			s->type = SDATA;
 			s->type = SDATA;
 		if(s->type != SDATA)
 		if(s->type != SDATA)
-			diag("initialize non-data (%d): %s\n%P\n",
+			diag("initialize non-data (%d): %s\n%P",
 				s->type, s->name, p);
 				s->type, s->name, p);
 		t = p->from.offset + p->from.displace;
 		t = p->from.offset + p->from.displace;
 		if(t > s->value)
 		if(t > s->value)
-			diag("initialize bounds (%ld): %s\n%P\n",
+			diag("initialize bounds (%ld): %s\n%P",
 				s->value, s->name, p);
 				s->value, s->name, p);
 	}
 	}
 
 
@@ -33,7 +33,7 @@ dodata(void)
 			continue;
 			continue;
 		t = s->value;
 		t = s->value;
 		if(t == 0) {
 		if(t == 0) {
-			diag("%s: no size\n", s->name);
+			diag("%s: no size", s->name);
 			t = 1;
 			t = 1;
 		}
 		}
 		t = rnd(t, 4);;
 		t = rnd(t, 4);;
@@ -132,7 +132,7 @@ follow(void)
 			if(s->type == SBSS)
 			if(s->type == SBSS)
 				s->type = SDATA;
 				s->type = SDATA;
 			if(s->type != SDATA)
 			if(s->type != SDATA)
-				diag("BCASE of non-data: %s in %s\n%P\n",
+				diag("BCASE of non-data: %s in %s\n%P",
 					s->name, TNAME, p);
 					s->name, TNAME, p);
 		}
 		}
 
 
@@ -271,7 +271,7 @@ relinv(int a)
 	case AFBNE:	return AFBEQ;
 	case AFBNE:	return AFBEQ;
 	case AFBT:	return AFBF;
 	case AFBT:	return AFBF;
 	}
 	}
-	diag("unknown relation: %s in %s\n", anames[a], TNAME);
+	diag("unknown relation: %s in %s", anames[a], TNAME);
 	return a;
 	return a;
 }
 }
 
 
@@ -298,7 +298,7 @@ patch(void)
 		if((p->as == ABSR || p->as == ARTS) && p->to.sym != S) {
 		if((p->as == ABSR || p->as == ARTS) && p->to.sym != S) {
 			s = p->to.sym;
 			s = p->to.sym;
 			if(s->type != STEXT) {
 			if(s->type != STEXT) {
-				diag("undefined: %s in %s\n", s->name, TNAME);
+				diag("undefined: %s in %s", s->name, TNAME);
 				s->type = STEXT;
 				s->type = STEXT;
 				s->value = vexit;
 				s->value = vexit;
 			}
 			}
@@ -319,7 +319,7 @@ patch(void)
 			q = q->link;
 			q = q->link;
 		}
 		}
 		if(q == P) {
 		if(q == P) {
-			diag("branch out of range in %s\n%P\n", TNAME, p);
+			diag("branch out of range in %s\n%P", TNAME, p);
 			p->to.type = D_NONE;
 			p->to.type = D_NONE;
 		}
 		}
 		p->pcond = q;
 		p->pcond = q;
@@ -419,7 +419,7 @@ dostkoff(void)
 				break;
 				break;
 			if(q->stkoff >= 0)
 			if(q->stkoff >= 0)
 				if(q->stkoff != s)
 				if(q->stkoff != s)
-					diag("stack offset %ld is %ld sb %ld in %s\n%P\n",
+					diag("stack offset %ld is %ld sb %ld in %s\n%P",
 						q->pc, q->stkoff, s, q, TNAME, p);
 						q->pc, q->stkoff, s, q, TNAME, p);
 			q->stkoff = s;
 			q->stkoff = s;
 		}
 		}
@@ -447,7 +447,7 @@ dostkoff(void)
 			continue;
 			continue;
 		}
 		}
 		if(p->link->as == ABCASE)
 		if(p->link->as == ABCASE)
-			diag("BCASE with stack offset in %s\n", TNAME);
+			diag("BCASE with stack offset in %s", TNAME);
 		t = q->stkoff - s;
 		t = q->stkoff - s;
 		s = q->stkoff;
 		s = q->stkoff;
 		p = appendp(p);
 		p = appendp(p);
@@ -534,5 +534,5 @@ undef(void)
 	for(i=0; i<NHASH; i++)
 	for(i=0; i<NHASH; i++)
 	for(s = hash[i]; s != S; s = s->link)
 	for(s = hash[i]; s != S; s = s->link)
 		if(s->type == SXREF)
 		if(s->type == SXREF)
-			diag("%s: not defined\n", s->name);
+			diag("%s: not defined", s->name);
 }
 }

+ 1 - 1
sys/src/cmd/2l/span.c

@@ -85,7 +85,7 @@ loop:
 		Bprint(&bso, "%5.2f span %d\n", cputime(), n);
 		Bprint(&bso, "%5.2f span %d\n", cputime(), n);
 	Bflush(&bso);
 	Bflush(&bso);
 	if(n > 60) {
 	if(n > 60) {
-		diag("span must be looping\n");
+		diag("span must be looping");
 		errorexit();
 		errorexit();
 	}
 	}
 	c = INITTEXT;
 	c = INITTEXT;

+ 1 - 1
sys/src/cmd/5l/asm.c

@@ -727,7 +727,7 @@ PP = p;
 				break;
 				break;
 		case C_ADDR:
 		case C_ADDR:
 			if(p->to.offset < 0 || p->to.offset >= (1 << UIXSHIFT))
 			if(p->to.offset < 0 || p->to.offset >= (1 << UIXSHIFT))
-				diag("reloc offset out of range: %s %ld\n", p->to.sym->name, p->to.offset);
+				diag("reloc offset out of range: %s %ld", p->to.sym->name, p->to.offset);
 			undefpc(p->pc);
 			undefpc(p->pc);
 		}
 		}
 		o1 = instoffset;
 		o1 = instoffset;

+ 5 - 5
sys/src/cmd/5l/noop.c

@@ -420,7 +420,7 @@ sdiv(Sym *s)
 	if(s->type == STEXT)
 	if(s->type == STEXT)
 		undefsym(s);
 		undefsym(s);
 	else
 	else
-		diag("undefined: %s\n", s->name);
+		diag("undefined: %s", s->name);
 	return s;
 	return s;
 }
 }
 
 
@@ -457,19 +457,19 @@ initdiv(void)
 				prog_modu = p;
 				prog_modu = p;
 		}
 		}
 	if(prog_div == P) {
 	if(prog_div == P) {
-		diag("undefined: %s\n", s2->name);
+		diag("undefined: %s", s2->name);
 		prog_div = curtext;
 		prog_div = curtext;
 	}
 	}
 	if(prog_divu == P) {
 	if(prog_divu == P) {
-		diag("undefined: %s\n", s3->name);
+		diag("undefined: %s", s3->name);
 		prog_divu = curtext;
 		prog_divu = curtext;
 	}
 	}
 	if(prog_mod == P) {
 	if(prog_mod == P) {
-		diag("undefined: %s\n", s4->name);
+		diag("undefined: %s", s4->name);
 		prog_mod = curtext;
 		prog_mod = curtext;
 	}
 	}
 	if(prog_modu == P) {
 	if(prog_modu == P) {
-		diag("undefined: %s\n", s5->name);
+		diag("undefined: %s", s5->name);
 		prog_modu = curtext;
 		prog_modu = curtext;
 	}
 	}
 }
 }

+ 23 - 23
sys/src/cmd/5l/obj.c

@@ -81,7 +81,7 @@ main(int argc, char *argv[])
 	USED(argc);
 	USED(argc);
 
 
 	if(*argv == 0) {
 	if(*argv == 0) {
-		diag("usage: 5l [-options] objects\n");
+		diag("usage: 5l [-options] objects");
 		errorexit();
 		errorexit();
 	}
 	}
 	if(!debug['9'] && debug['r']) {
 	if(!debug['9'] && debug['r']) {
@@ -183,7 +183,7 @@ main(int argc, char *argv[])
 		outfile = "5.out";
 		outfile = "5.out";
 	cout = create(outfile, 1, 0775);
 	cout = create(outfile, 1, 0775);
 	if(cout < 0) {
 	if(cout < 0) {
-		diag("%s: cannot create\n", outfile);
+		diag("%s: cannot create", outfile);
 		errorexit();
 		errorexit();
 	}
 	}
 	nuxiinit();
 	nuxiinit();
@@ -299,7 +299,7 @@ objfile(char *file)
 	Bflush(&bso);
 	Bflush(&bso);
 	f = open(file, 0);
 	f = open(file, 0);
 	if(f < 0) {
 	if(f < 0) {
-		diag("cannot open file: %s\n", file);
+		diag("cannot open file: %s", file);
 		errorexit();
 		errorexit();
 	}
 	}
 	l = read(f, magbuf, SARMAG);
 	l = read(f, magbuf, SARMAG);
@@ -316,11 +316,11 @@ objfile(char *file)
 		Bprint(&bso, "%5.2f ldlib: %s\n", cputime(), file);
 		Bprint(&bso, "%5.2f ldlib: %s\n", cputime(), file);
 	l = read(f, &arhdr, SAR_HDR);
 	l = read(f, &arhdr, SAR_HDR);
 	if(l != SAR_HDR) {
 	if(l != SAR_HDR) {
-		diag("%s: short read on archive file symbol header\n", file);
+		diag("%s: short read on archive file symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
-		diag("%s: first entry not symbol header\n", file);
+		diag("%s: first entry not symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 
 
@@ -368,7 +368,7 @@ objfile(char *file)
 			l = atolwhex(arhdr.size);
 			l = atolwhex(arhdr.size);
 			ldobj(f, l, pname);
 			ldobj(f, l, pname);
 			if(s->type == SXREF) {
 			if(s->type == SXREF) {
-				diag("%s: failed to load: %s\n", file, s->name);
+				diag("%s: failed to load: %s", file, s->name);
 				errorexit();
 				errorexit();
 			}
 			}
 			work = 1;
 			work = 1;
@@ -378,7 +378,7 @@ objfile(char *file)
 	return;
 	return;
 
 
 bad:
 bad:
-	diag("%s: bad or out of date archive\n", file);
+	diag("%s: bad or out of date archive", file);
 out:
 out:
 	close(f);
 	close(f);
 }
 }
@@ -694,7 +694,7 @@ loop:
 	}
 	}
 	o = bloc[0];		/* as */
 	o = bloc[0];		/* as */
 	if(o <= AXXX || o >= ALAST) {
 	if(o <= AXXX || o >= ALAST) {
-		diag("%s: line %ld: opcode out of range %d\n", pn, pc-ipc, o);
+		diag("%s: line %ld: opcode out of range %d", pn, pc-ipc, o);
 		print("	probably not a .5 file\n");
 		print("	probably not a .5 file\n");
 		errorexit();
 		errorexit();
 	}
 	}
@@ -760,7 +760,7 @@ loop:
 	c -= r;
 	c -= r;
 
 
 	if(p->reg < 0 || p->reg > NREG)
 	if(p->reg < 0 || p->reg > NREG)
-		diag("register out of range %d\n", p->reg);
+		diag("register out of range %d", p->reg);
 
 
 	p->link = P;
 	p->link = P;
 	p->cond = P;
 	p->cond = P;
@@ -794,7 +794,7 @@ loop:
 	case AGLOBL:
 	case AGLOBL:
 		s = p->from.sym;
 		s = p->from.sym;
 		if(s == S) {
 		if(s == S) {
-			diag("GLOBL must have a name\n%P\n", p);
+			diag("GLOBL must have a name\n%P", p);
 			errorexit();
 			errorexit();
 		}
 		}
 		if(s->type == 0 || s->type == SXREF) {
 		if(s->type == 0 || s->type == SXREF) {
@@ -802,7 +802,7 @@ loop:
 			s->value = 0;
 			s->value = 0;
 		}
 		}
 		if(s->type != SBSS) {
 		if(s->type != SBSS) {
-			diag("redefinition: %s\n%P\n", s->name, p);
+			diag("redefinition: %s\n%P", s->name, p);
 			s->type = SBSS;
 			s->type = SBSS;
 			s->value = 0;
 			s->value = 0;
 		}
 		}
@@ -812,7 +812,7 @@ loop:
 
 
 	case ADYNT:
 	case ADYNT:
 		if(p->to.sym == S) {
 		if(p->to.sym == S) {
-			diag("DYNT without a sym\n%P\n", p);
+			diag("DYNT without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		di = p->to.sym;
 		di = p->to.sym;
@@ -830,7 +830,7 @@ loop:
 		p->from.offset = di->value;
 		p->from.offset = di->value;
 		p->from.sym->type = SDATA;
 		p->from.sym->type = SDATA;
 		if(curtext == P) {
 		if(curtext == P) {
-			diag("DYNT not in text: %P\n", p);
+			diag("DYNT not in text: %P", p);
 			break;
 			break;
 		}
 		}
 		p->to.sym = curtext->from.sym;
 		p->to.sym = curtext->from.sym;
@@ -841,11 +841,11 @@ loop:
 
 
 	case AINIT:
 	case AINIT:
 		if(p->from.sym == S) {
 		if(p->from.sym == S) {
-			diag("INIT without a sym\n%P\n", p);
+			diag("INIT without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		if(di == S) {
 		if(di == S) {
-			diag("INIT without previous DYNT\n%P\n", p);
+			diag("INIT without previous DYNT\n%P", p);
 			break;
 			break;
 		}
 		}
 		p->from.offset = di->value;
 		p->from.offset = di->value;
@@ -856,7 +856,7 @@ loop:
 	
 	
 	case ADATA:
 	case ADATA:
 		if(p->from.sym == S) {
 		if(p->from.sym == S) {
-			diag("DATA without a sym\n%P\n", p);
+			diag("DATA without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		p->link = datap;
 		p->link = datap;
@@ -864,7 +864,7 @@ loop:
 		break;
 		break;
 
 
 	case AGOK:
 	case AGOK:
-		diag("unknown opcode\n%P\n", p);
+		diag("unknown opcode\n%P", p);
 		p->pc = pc;
 		p->pc = pc;
 		pc++;
 		pc++;
 		break;
 		break;
@@ -882,7 +882,7 @@ loop:
 		autosize += 4;
 		autosize += 4;
 		s = p->from.sym;
 		s = p->from.sym;
 		if(s == S) {
 		if(s == S) {
-			diag("TEXT must have a name\n%P\n", p);
+			diag("TEXT must have a name\n%P", p);
 			errorexit();
 			errorexit();
 		}
 		}
 		if(s->type != 0 && s->type != SXREF) {
 		if(s->type != 0 && s->type != SXREF) {
@@ -890,7 +890,7 @@ loop:
 				skip = 1;
 				skip = 1;
 				goto casedef;
 				goto casedef;
 			}
 			}
-			diag("redefinition: %s\n%P\n", s->name, p);
+			diag("redefinition: %s\n%P", s->name, p);
 		}
 		}
 		s->type = STEXT;
 		s->type = STEXT;
 		s->value = pc;
 		s->value = pc;
@@ -1000,7 +1000,7 @@ loop:
 	goto loop;
 	goto loop;
 
 
 eof:
 eof:
-	diag("truncated object file: %s\n", pn);
+	diag("truncated object file: %s", pn);
 }
 }
 
 
 Sym*
 Sym*
@@ -1069,7 +1069,7 @@ gethunk(void)
 	}
 	}
 	h = mysbrk(nh);
 	h = mysbrk(nh);
 	if(h == (char*)-1) {
 	if(h == (char*)-1) {
-		diag("out of memory\n");
+		diag("out of memory");
 		errorexit();
 		errorexit();
 	}
 	}
 	hunk = h;
 	hunk = h;
@@ -1177,7 +1177,7 @@ doprof2(void)
 	s2 = lookup("_profin", 0);
 	s2 = lookup("_profin", 0);
 	s4 = lookup("_profout", 0);
 	s4 = lookup("_profout", 0);
 	if(s2->type != STEXT || s4->type != STEXT) {
 	if(s2->type != STEXT || s4->type != STEXT) {
-		diag("_profin/_profout not defined\n");
+		diag("_profin/_profout not defined");
 		return;
 		return;
 	}
 	}
 	ps2 = P;
 	ps2 = P;
@@ -1322,7 +1322,7 @@ ieeedtof(Ieee *ieeep)
 		}
 		}
 	}
 	}
 	if(exp <= -126 || exp >= 130)
 	if(exp <= -126 || exp >= 130)
-		diag("double fp to single fp overflow\n");
+		diag("double fp to single fp overflow");
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= ieeep->h & 0x80000000L;
 	v |= ieeep->h & 0x80000000L;
 	return v;
 	return v;

+ 7 - 7
sys/src/cmd/5l/pass.c

@@ -18,11 +18,11 @@ dodata(void)
 		if(s->type == SBSS)
 		if(s->type == SBSS)
 			s->type = SDATA;
 			s->type = SDATA;
 		if(s->type != SDATA)
 		if(s->type != SDATA)
-			diag("initialize non-data (%d): %s\n%P\n",
+			diag("initialize non-data (%d): %s\n%P",
 				s->type, s->name, p);
 				s->type, s->name, p);
 		v = p->from.offset + p->reg;
 		v = p->from.offset + p->reg;
 		if(v > s->value)
 		if(v > s->value)
-			diag("initialize bounds (%ld): %s\n%P\n",
+			diag("initialize bounds (%ld): %s\n%P",
 				s->value, s->name, p);
 				s->value, s->name, p);
 	}
 	}
 
 
@@ -51,7 +51,7 @@ dodata(void)
 			continue;
 			continue;
 		v = s->value;
 		v = s->value;
 		if(v == 0) {
 		if(v == 0) {
-			diag("%s: no size\n", s->name);
+			diag("%s: no size", s->name);
 			v = 1;
 			v = 1;
 		}
 		}
 		while(v & 3)
 		while(v & 3)
@@ -117,7 +117,7 @@ undef(void)
 	for(i=0; i<NHASH; i++)
 	for(i=0; i<NHASH; i++)
 	for(s = hash[i]; s != S; s = s->link)
 	for(s = hash[i]; s != S; s = s->link)
 		if(s->type == SXREF)
 		if(s->type == SXREF)
-			diag("%s: not defined\n", s->name);
+			diag("%s: not defined", s->name);
 }
 }
 
 
 Prog*
 Prog*
@@ -154,7 +154,7 @@ relinv(int a)
 	case ABGT:	return ABLE;
 	case ABGT:	return ABLE;
 	case ABLE:	return ABGT;
 	case ABLE:	return ABGT;
 	}
 	}
-	diag("unknown relation: %s\n", anames[a]);
+	diag("unknown relation: %s", anames[a]);
 	return a;
 	return a;
 }
 }
 
 
@@ -299,7 +299,7 @@ patch(void)
 		   p->to.type != D_BRANCH && p->to.sym != S) {
 		   p->to.type != D_BRANCH && p->to.sym != S) {
 			s = p->to.sym;
 			s = p->to.sym;
 			if(s->type != STEXT) {
 			if(s->type != STEXT) {
-				diag("undefined: %s\n%P\n", s->name, p);
+				diag("undefined: %s\n%P", s->name, p);
 				s->type = STEXT;
 				s->type = STEXT;
 				s->value = vexit;
 				s->value = vexit;
 			}
 			}
@@ -324,7 +324,7 @@ patch(void)
 			q = q->link;
 			q = q->link;
 		}
 		}
 		if(q == P) {
 		if(q == P) {
-			diag("branch out of range %ld\n%P\n", c, p);
+			diag("branch out of range %ld\n%P", c, p);
 			p->to.type = D_NONE;
 			p->to.type = D_NONE;
 		}
 		}
 		p->cond = q;
 		p->cond = q;

+ 7 - 7
sys/src/cmd/5l/span.c

@@ -40,7 +40,7 @@ span(void)
 				otxt = c;
 				otxt = c;
 				continue;
 				continue;
 			}
 			}
-			diag("zero-width instruction\n%P\n", p);
+			diag("zero-width instruction\n%P", p);
 			continue;
 			continue;
 		}
 		}
 		switch(o->flag & (LFROM|LTO|LPOOL)) {
 		switch(o->flag & (LFROM|LTO|LPOOL)) {
@@ -108,7 +108,7 @@ span(void)
 						p->from.sym->value = c;
 						p->from.sym->value = c;
 					continue;
 					continue;
 				}
 				}
-				diag("zero-width instruction\n%P\n", p);
+				diag("zero-width instruction\n%P", p);
 				continue;
 				continue;
 			}
 			}
 			c += m;
 			c += m;
@@ -342,7 +342,7 @@ aclass(Adr *a)
 			s = a->sym;
 			s = a->sym;
 			t = s->type;
 			t = s->type;
 			if(t == 0 || t == SXREF) {
 			if(t == 0 || t == SXREF) {
-				diag("undefined external: %s in %s\n",
+				diag("undefined external: %s in %s",
 					s->name, TNAME);
 					s->name, TNAME);
 				s->type = SDATA;
 				s->type = SDATA;
 			}
 			}
@@ -427,7 +427,7 @@ aclass(Adr *a)
 			s = a->sym;
 			s = a->sym;
 			t = s->type;
 			t = s->type;
 			if(t == 0 || t == SXREF) {
 			if(t == 0 || t == SXREF) {
-				diag("undefined external: %s in %s\n",
+				diag("undefined external: %s in %s",
 					s->name, TNAME);
 					s->name, TNAME);
 				s->type = SDATA;
 				s->type = SDATA;
 			}
 			}
@@ -469,7 +469,7 @@ aclass(Adr *a)
 			switch(t) {
 			switch(t) {
 			case 0:
 			case 0:
 			case SXREF:
 			case SXREF:
-				diag("undefined external: %s in %s\n",
+				diag("undefined external: %s in %s",
 					s->name, TNAME);
 					s->name, TNAME);
 				s->type = SDATA;
 				s->type = SDATA;
 				break;
 				break;
@@ -561,7 +561,7 @@ oplook(Prog *p)
 			p->optab = (o-optab)+1;
 			p->optab = (o-optab)+1;
 			return o;
 			return o;
 		}
 		}
-	diag("illegal combination %A %d %d %d\n",
+	diag("illegal combination %A %d %d %d",
 		p->as, a1, a2, a3);
 		p->as, a1, a2, a3);
 	prasm(p);
 	prasm(p);
 	if(o == 0)
 	if(o == 0)
@@ -682,7 +682,7 @@ buildop(void)
 		switch(r)
 		switch(r)
 		{
 		{
 		default:
 		default:
-			diag("unknown op in build: %A\n", r);
+			diag("unknown op in build: %A", r);
 			errorexit();
 			errorexit();
 		case AADD:
 		case AADD:
 			oprange[AAND] = oprange[r];
 			oprange[AAND] = oprange[r];

+ 5 - 5
sys/src/cmd/6l/asm.c

@@ -41,7 +41,7 @@ asmb(void)
 		if(p->pc != pc) {
 		if(p->pc != pc) {
 			if(!debug['a'])
 			if(!debug['a'])
 				print("%P\n", curp);
 				print("%P\n", curp);
-			diag("phase error %lux sb %lux in %s\n", p->pc, pc, TNAME);
+			diag("phase error %lux sb %lux in %s", p->pc, pc, TNAME);
 			pc = p->pc;
 			pc = p->pc;
 		}
 		}
 		curp = p;
 		curp = p;
@@ -68,7 +68,7 @@ asmb(void)
 	cflush();
 	cflush();
 	switch(HEADTYPE) {
 	switch(HEADTYPE) {
 	default:
 	default:
-		diag("unknown header type %d\n", HEADTYPE);
+		diag("unknown header type %d", HEADTYPE);
 	case 0:
 	case 0:
 		seek(cout, rnd(HEADR+textsize, 8192), 0);
 		seek(cout, rnd(HEADR+textsize, 8192), 0);
 		break;
 		break;
@@ -297,7 +297,7 @@ datblk(long s, long n)
 		for(j=l+(c-i)-1; j>=l; j--)
 		for(j=l+(c-i)-1; j>=l; j--)
 			if(buf.dbuf[j]) {
 			if(buf.dbuf[j]) {
 				print("%P\n", p);
 				print("%P\n", p);
-				diag("multiple initialization\n");
+				diag("multiple initialization");
 				break;
 				break;
 			}
 			}
 		switch(p->to.type) {
 		switch(p->to.type) {
@@ -350,7 +350,7 @@ datblk(long s, long n)
 			fl = p->to.offset;
 			fl = p->to.offset;
 			if(p->to.type == D_ADDR) {
 			if(p->to.type == D_ADDR) {
 				if(p->to.index != D_STATIC && p->to.index != D_EXTERN)
 				if(p->to.index != D_STATIC && p->to.index != D_EXTERN)
-					diag("DADDR type%P\n", p);
+					diag("DADDR type%P", p);
 				if(p->to.sym) {
 				if(p->to.sym) {
 					fl += p->to.sym->value;
 					fl += p->to.sym->value;
 					if(p->to.sym->type != STEXT && p->to.sym->type != SLEAF)
 					if(p->to.sym->type != STEXT && p->to.sym->type != SLEAF)
@@ -360,7 +360,7 @@ datblk(long s, long n)
 			cast = (char*)&fl;
 			cast = (char*)&fl;
 			switch(c) {
 			switch(c) {
 			default:
 			default:
-				diag("bad nuxi %d %d\n%P\n", c, i, curp);
+				diag("bad nuxi %d %d\n%P", c, i, curp);
 				break;
 				break;
 			case 1:
 			case 1:
 				if(debug['a'] && i == 0) {
 				if(debug['a'] && i == 0) {

+ 16 - 16
sys/src/cmd/6l/obj.c

@@ -72,7 +72,7 @@ main(int argc, char *argv[])
 	} ARGEND
 	} ARGEND
 	USED(argc);
 	USED(argc);
 	if(*argv == 0) {
 	if(*argv == 0) {
-		diag("usage: 6l [-options] objects\n");
+		diag("usage: 6l [-options] objects");
 		errorexit();
 		errorexit();
 	}
 	}
 	if(!debug['9'] && !debug['U'] && !debug['B'])
 	if(!debug['9'] && !debug['U'] && !debug['B'])
@@ -145,7 +145,7 @@ main(int argc, char *argv[])
 	Bflush(&bso);
 	Bflush(&bso);
 	for(i=1; optab[i].as; i++)
 	for(i=1; optab[i].as; i++)
 		if(i != optab[i].as) {
 		if(i != optab[i].as) {
-			diag("phase error in optab: %d\n", i);
+			diag("phase error in optab: %d", i);
 			errorexit();
 			errorexit();
 		}
 		}
 	maxop = i;
 	maxop = i;
@@ -182,7 +182,7 @@ main(int argc, char *argv[])
 	pc = 0;
 	pc = 0;
 	cout = create(outfile, 1, 0775);
 	cout = create(outfile, 1, 0775);
 	if(cout < 0) {
 	if(cout < 0) {
-		diag("cannot create %s\n", outfile);
+		diag("cannot create %s", outfile);
 		errorexit();
 		errorexit();
 	}
 	}
 	version = 0;
 	version = 0;
@@ -281,7 +281,7 @@ objfile(char *file)
 	Bflush(&bso);
 	Bflush(&bso);
 	f = open(file, 0);
 	f = open(file, 0);
 	if(f < 0) {
 	if(f < 0) {
-		diag("cannot open file: %s\n", file);
+		diag("cannot open file: %s", file);
 		errorexit();
 		errorexit();
 	}
 	}
 	l = read(f, magbuf, SARMAG);
 	l = read(f, magbuf, SARMAG);
@@ -298,11 +298,11 @@ objfile(char *file)
 		Bprint(&bso, "%5.2f ldlib: %s\n", cputime(), file);
 		Bprint(&bso, "%5.2f ldlib: %s\n", cputime(), file);
 	l = read(f, &arhdr, SAR_HDR);
 	l = read(f, &arhdr, SAR_HDR);
 	if(l != SAR_HDR) {
 	if(l != SAR_HDR) {
-		diag("%s: short read on archive file symbol header\n", file);
+		diag("%s: short read on archive file symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
-		diag("%s: first entry not symbol header\n", file);
+		diag("%s: first entry not symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 
 
@@ -350,7 +350,7 @@ objfile(char *file)
 			l = atolwhex(arhdr.size);
 			l = atolwhex(arhdr.size);
 			ldobj(f, l, pname);
 			ldobj(f, l, pname);
 			if(s->type == SXREF) {
 			if(s->type == SXREF) {
-				diag("%s: failed to load: %s\n", file, s->name);
+				diag("%s: failed to load: %s", file, s->name);
 				errorexit();
 				errorexit();
 			}
 			}
 			work = 1;
 			work = 1;
@@ -359,7 +359,7 @@ objfile(char *file)
 	return;
 	return;
 
 
 bad:
 bad:
-	diag("%s: bad or out of date archive\n", file);
+	diag("%s: bad or out of date archive", file);
 out:
 out:
 	close(f);
 	close(f);
 }
 }
@@ -636,7 +636,7 @@ loop:
 	if(o <= 0 || o >= maxop) {
 	if(o <= 0 || o >= maxop) {
 		if(o < 0)
 		if(o < 0)
 			goto eof;
 			goto eof;
-		diag("%s: opcode out of range %d\n", pn, o);
+		diag("%s: opcode out of range %d", pn, o);
 		print("	probably not a .8 file\n");
 		print("	probably not a .8 file\n");
 		errorexit();
 		errorexit();
 	}
 	}
@@ -743,7 +743,7 @@ loop:
 			s->value = 0;
 			s->value = 0;
 		}
 		}
 		if(s->type != SBSS) {
 		if(s->type != SBSS) {
-			diag("%s: redefinition: %s in %s\n",
+			diag("%s: redefinition: %s in %s",
 				pn, s->name, TNAME);
 				pn, s->name, TNAME);
 			s->type = SBSS;
 			s->type = SBSS;
 			s->value = 0;
 			s->value = 0;
@@ -762,7 +762,7 @@ loop:
 		goto loop;
 		goto loop;
 
 
 	case AGOK:
 	case AGOK:
-		diag("%s: GOK opcode in %s\n", pn, TNAME);
+		diag("%s: GOK opcode in %s", pn, TNAME);
 		pc++;
 		pc++;
 		goto loop;
 		goto loop;
 
 
@@ -778,11 +778,11 @@ loop:
 		p->pc = pc;
 		p->pc = pc;
 		s = p->from.sym;
 		s = p->from.sym;
 		if(s == S) {
 		if(s == S) {
-			diag("%s: no TEXT symbol: %P\n", pn, p);
+			diag("%s: no TEXT symbol: %P", pn, p);
 			errorexit();
 			errorexit();
 		}
 		}
 		if(s->type != 0 && s->type != SXREF)
 		if(s->type != 0 && s->type != SXREF)
-			diag("%s: redefinition: %s\n", pn, s->name);
+			diag("%s: redefinition: %s", pn, s->name);
 		s->type = STEXT;
 		s->type = STEXT;
 		s->value = p->pc;
 		s->value = p->pc;
 		pc++;
 		pc++;
@@ -841,7 +841,7 @@ loop:
 	goto loop;
 	goto loop;
 
 
 eof:
 eof:
-	diag("truncated object file: %s\n", pn);
+	diag("truncated object file: %s", pn);
 }
 }
 
 
 Sym*
 Sym*
@@ -933,7 +933,7 @@ gethunk(void)
 	}
 	}
 	h = sbrk(nh);
 	h = sbrk(nh);
 	if(h == (char*)-1) {
 	if(h == (char*)-1) {
-		diag("out of memory\n");
+		diag("out of memory");
 		errorexit();
 		errorexit();
 	}
 	}
 	hunk = h;
 	hunk = h;
@@ -1035,7 +1035,7 @@ ieeedtof(Ieee *e)
 		}
 		}
 	}
 	}
 	if(exp <= -126 || exp >= 130)
 	if(exp <= -126 || exp >= 130)
-		diag("double fp to single fp overflow\n");
+		diag("double fp to single fp overflow");
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= e->h & 0x80000000L;
 	v |= e->h & 0x80000000L;
 	return v;
 	return v;

+ 8 - 8
sys/src/cmd/6l/pass.c

@@ -16,11 +16,11 @@ dodata(void)
 		if(s->type == SBSS)
 		if(s->type == SBSS)
 			s->type = SDATA;
 			s->type = SDATA;
 		if(s->type != SDATA)
 		if(s->type != SDATA)
-			diag("initialize non-data (%d): %s\n%P\n",
+			diag("initialize non-data (%d): %s\n%P",
 				s->type, s->name, p);
 				s->type, s->name, p);
 		t = p->from.offset + p->width;
 		t = p->from.offset + p->width;
 		if(t > s->value)
 		if(t > s->value)
-			diag("initialize bounds (%ld): %s\n%P\n",
+			diag("initialize bounds (%ld): %s\n%P",
 				s->value, s->name, p);
 				s->value, s->name, p);
 	}
 	}
 
 
@@ -33,7 +33,7 @@ dodata(void)
 			continue;
 			continue;
 		t = s->value;
 		t = s->value;
 		if(t == 0) {
 		if(t == 0) {
-			diag("%s: no size\n", s->name);
+			diag("%s: no size", s->name);
 			t = 1;
 			t = 1;
 		}
 		}
 		t = rnd(t, 4);;
 		t = rnd(t, 4);;
@@ -236,7 +236,7 @@ relinv(int a)
 	case ABO:	return ABNO;
 	case ABO:	return ABNO;
 	case ABNO:	return ABO;
 	case ABNO:	return ABO;
 	}
 	}
-	diag("unknown relation: %s in %s\n", anames[a], TNAME);
+	diag("unknown relation: %s in %s", anames[a], TNAME);
 	return a;
 	return a;
 }
 }
 
 
@@ -253,7 +253,7 @@ doinit(void)
 			continue;
 			continue;
 		s = p->to.sym;
 		s = p->to.sym;
 		if(s->type == 0 || s->type == SXREF)
 		if(s->type == 0 || s->type == SXREF)
-			diag("undefined %s initializer of %s\n",
+			diag("undefined %s initializer of %s",
 				s->name, p->from.sym->name);
 				s->name, p->from.sym->name);
 		p->to.offset += s->value;
 		p->to.offset += s->value;
 		p->to.type = D_CONST;
 		p->to.type = D_CONST;
@@ -286,7 +286,7 @@ patch(void)
 			s = p->to.sym;
 			s = p->to.sym;
 			if(s) {
 			if(s) {
 				if(s->type != STEXT && s->type != SLEAF) {
 				if(s->type != STEXT && s->type != SLEAF) {
-					diag("undefined: %s in %s\n", s->name, TNAME);
+					diag("undefined: %s in %s", s->name, TNAME);
 					s->type = STEXT;
 					s->type = STEXT;
 					s->value = vexit;
 					s->value = vexit;
 				}
 				}
@@ -308,7 +308,7 @@ patch(void)
 			q = q->link;
 			q = q->link;
 		}
 		}
 		if(q == P) {
 		if(q == P) {
-			diag("branch out of range in %s\n%P\n", TNAME, p);
+			diag("branch out of range in %s\n%P", TNAME, p);
 			p->to.type = D_NONE;
 			p->to.type = D_NONE;
 		}
 		}
 		p->cond = q;
 		p->cond = q;
@@ -427,5 +427,5 @@ undef(void)
 	for(i=0; i<NHASH; i++)
 	for(i=0; i<NHASH; i++)
 	for(s = hash[i]; s != S; s = s->link)
 	for(s = hash[i]; s != S; s = s->link)
 		if(s->type == SXREF)
 		if(s->type == SXREF)
-			diag("%s: not defined\n", s->name);
+			diag("%s: not defined", s->name);
 }
 }

+ 6 - 6
sys/src/cmd/6l/span.c

@@ -417,7 +417,7 @@ dormem(int o, int r, Adr *a)
 	case D_EXTERN:
 	case D_EXTERN:
 		t = a->sym->type;
 		t = a->sym->type;
 		if(t == 0 || t == SXREF) {
 		if(t == 0 || t == SXREF) {
-			diag("undefined external: %s in %s\n",
+			diag("undefined external: %s in %s",
 				a->sym->name, TNAME);
 				a->sym->name, TNAME);
 			a->sym->type = SDATA;
 			a->sym->type = SDATA;
 		}
 		}
@@ -474,7 +474,7 @@ asm:
 	i |= (r & 0x1f) << 19;
 	i |= (r & 0x1f) << 19;
 	switch(t) {
 	switch(t) {
 	default:
 	default:
-		diag("dormem mode %lux %D\n", t, a);
+		diag("dormem mode %lux %D", t, a);
 		break;
 		break;
 
 
 	case 0:
 	case 0:
@@ -599,7 +599,7 @@ doir(Adr *a, int dst)
 				break;
 				break;
 			t = a->sym->type;
 			t = a->sym->type;
 			if(t == 0 || t == SXREF) {
 			if(t == 0 || t == SXREF) {
-				diag("undefined external: %s in %s\n",
+				diag("undefined external: %s in %s",
 					a->sym->name, TNAME);
 					a->sym->name, TNAME);
 				a->sym->type = SDATA;
 				a->sym->type = SDATA;
 			}
 			}
@@ -641,7 +641,7 @@ doasm(Prog *p)
 	tt = oclass(&p->to) * Ymax;
 	tt = oclass(&p->to) * Ymax;
 	t = o->ytab;
 	t = o->ytab;
 	if(t == 0) {
 	if(t == 0) {
-		diag("asmins: noproto %P\n", p);
+		diag("asmins: noproto %P", p);
 		return;
 		return;
 	}
 	}
 	for(z=0; *t; z+=t[4], t+=5)
 	for(z=0; *t; z+=t[4], t+=5)
@@ -650,14 +650,14 @@ doasm(Prog *p)
 		if(ycover[tt+t[2]])
 		if(ycover[tt+t[2]])
 			goto found;
 			goto found;
 
 
-	diag("asmins: notfound <%d,%d,%d> %P\n",
+	diag("asmins: notfound <%d,%d,%d> %P",
 		ft/Ymax, mt/Ymax, tt/Ymax, p);
 		ft/Ymax, mt/Ymax, tt/Ymax, p);
 	return;
 	return;
 
 
 found:
 found:
 	switch(t[3]) {
 	switch(t[3]) {
 	default:
 	default:
-		diag("asmins: unknown z %d %P\n", t[3], p);
+		diag("asmins: unknown z %d %P", t[3], p);
 		return;
 		return;
 
 
 	case Zpseudo:
 	case Zpseudo:

+ 11 - 11
sys/src/cmd/7l/asm.c

@@ -83,7 +83,7 @@ asmb(void)
 			autosize = p->to.offset + 8;
 			autosize = p->to.offset + 8;
 		}
 		}
 		if(p->pc != pc) {
 		if(p->pc != pc) {
-			diag("phase error %lux sb %lux\n",
+			diag("phase error %lux sb %lux",
 				p->pc, pc);
 				p->pc, pc);
 			if(!debug['a'])
 			if(!debug['a'])
 				prasm(curp);
 				prasm(curp);
@@ -482,13 +482,13 @@ datblk(long s, long n)
 			for(j=l+(c-i)-1; j>=l; j--)
 			for(j=l+(c-i)-1; j>=l; j--)
 				if(buf.dbuf[j]) {
 				if(buf.dbuf[j]) {
 					print("%P\n", p);
 					print("%P\n", p);
-					diag("multiple initialization\n");
+					diag("multiple initialization");
 					break;
 					break;
 				}
 				}
 		}
 		}
 		switch(p->to.type) {
 		switch(p->to.type) {
 		default:
 		default:
-			diag("unknown mode in initialization\n%P\n", p);
+			diag("unknown mode in initialization\n%P", p);
 			break;
 			break;
 
 
 		case D_FCONST:
 		case D_FCONST:
@@ -533,7 +533,7 @@ datblk(long s, long n)
 			cast = (char*)&d;
 			cast = (char*)&d;
 			switch(c) {
 			switch(c) {
 			default:
 			default:
-				diag("bad nuxi %d %d\n%P\n", c, i, curp);
+				diag("bad nuxi %d %d\n%P", c, i, curp);
 				break;
 				break;
 			case 1:
 			case 1:
 				for(; i<c; i++) {
 				for(; i<c; i++) {
@@ -595,7 +595,7 @@ asmout(Prog *p, Optab *o)
 	o6 = 0;
 	o6 = 0;
 	switch(o->type) {
 	switch(o->type) {
 	default:
 	default:
-		diag("unknown type %d\n", o->type);
+		diag("unknown type %d", o->type);
 		if(!debug['a'])
 		if(!debug['a'])
 			prasm(p);
 			prasm(p);
 		break;
 		break;
@@ -728,7 +728,7 @@ asmout(Prog *p, Optab *o)
 	case 13:	/* <op> $scon,[r2],r3 */
 	case 13:	/* <op> $scon,[r2],r3 */
 		v = regoff(&p->from);
 		v = regoff(&p->from);
 		if(p->to.reg == REGTMP || p->reg == REGTMP)
 		if(p->to.reg == REGTMP || p->reg == REGTMP)
-			diag("cant synthesize large constant\n%P\n", p);
+			diag("cant synthesize large constant\n%P", p);
 		r = p->reg;
 		r = p->reg;
 		if(r == NREG)
 		if(r == NREG)
 			r = p->to.reg;
 			r = p->to.reg;
@@ -741,7 +741,7 @@ asmout(Prog *p, Optab *o)
 		if(v & 0x8000)
 		if(v & 0x8000)
 			v += 0x10000;
 			v += 0x10000;
 		if(p->to.reg == REGTMP || p->reg == REGTMP)
 		if(p->to.reg == REGTMP || p->reg == REGTMP)
-			diag("cant synthesize large constant\n%P\n", p);
+			diag("cant synthesize large constant\n%P", p);
 		r = p->reg;
 		r = p->reg;
 		if(r == NREG)
 		if(r == NREG)
 			r = p->to.reg;
 			r = p->to.reg;
@@ -850,7 +850,7 @@ asmout(Prog *p, Optab *o)
 
 
 	case 23:	/* <op> $qcon,r1 */
 	case 23:	/* <op> $qcon,r1 */
 		if(p->to.reg == REGTMP || p->reg == REGTMP)
 		if(p->to.reg == REGTMP || p->reg == REGTMP)
-			diag("cant synthesize large constant\n%P\n", p);
+			diag("cant synthesize large constant\n%P", p);
 		v = regoff(&p->from);
 		v = regoff(&p->from);
 		r = p->reg;
 		r = p->reg;
 		if(r == NREG)
 		if(r == NREG)
@@ -912,7 +912,7 @@ asmout(Prog *p, Optab *o)
 			r = o->param;
 			r = o->param;
 		v = regoff(&p->to);
 		v = regoff(&p->to);
 		if (v < -0x800 || v >= 0x800)
 		if (v < -0x800 || v >= 0x800)
-			diag("physical store out of range\n%P\n", p);
+			diag("physical store out of range\n%P", p);
 		v &= 0xfff;
 		v &= 0xfff;
 		o1 = OP_MEM(opcode(p->as+AEND), v, r, p->from.reg);
 		o1 = OP_MEM(opcode(p->as+AEND), v, r, p->from.reg);
 		break;
 		break;
@@ -923,7 +923,7 @@ asmout(Prog *p, Optab *o)
 			r = o->param;
 			r = o->param;
 		v = regoff(&p->from);
 		v = regoff(&p->from);
 		if (v < -0x800 || v >= 0x800)
 		if (v < -0x800 || v >= 0x800)
-			diag("physical load out of range\n%P\n", p);
+			diag("physical load out of range\n%P", p);
 		v &= 0xfff;
 		v &= 0xfff;
 		o1 = OP_MEM(opcode(p->as), v, r, p->to.reg);
 		o1 = OP_MEM(opcode(p->as), v, r, p->to.reg);
 		break;
 		break;
@@ -1214,7 +1214,7 @@ diag("opcode(AMOVW)");
 	case AADDQ+AEND:	return OP(25,0);	/* HW_MFPR */
 	case AADDQ+AEND:	return OP(25,0);	/* HW_MFPR */
 	case ASUBQ+AEND:	return OP(29,0);	/* HW_MTPR */
 	case ASUBQ+AEND:	return OP(29,0);	/* HW_MTPR */
 	}
 	}
-	diag("bad op %A(%d)\n", a, a);
+	diag("bad op %A(%d)", a, a);
 	return 0;
 	return 0;
 }
 }
 
 

+ 8 - 8
sys/src/cmd/7l/noop.c

@@ -660,35 +660,35 @@ initdiv(void)
 				prog_modlu = p;
 				prog_modlu = p;
 		}
 		}
 	if(prog_divq == P) {
 	if(prog_divq == P) {
-		diag("undefined: %s\n", s1->name);
+		diag("undefined: %s", s1->name);
 		prog_divq = curtext;
 		prog_divq = curtext;
 	}
 	}
 	if(prog_divqu == P) {
 	if(prog_divqu == P) {
-		diag("undefined: %s\n", s2->name);
+		diag("undefined: %s", s2->name);
 		prog_divqu = curtext;
 		prog_divqu = curtext;
 	}
 	}
 	if(prog_modq == P) {
 	if(prog_modq == P) {
-		diag("undefined: %s\n", s3->name);
+		diag("undefined: %s", s3->name);
 		prog_modq = curtext;
 		prog_modq = curtext;
 	}
 	}
 	if(prog_modqu == P) {
 	if(prog_modqu == P) {
-		diag("undefined: %s\n", s4->name);
+		diag("undefined: %s", s4->name);
 		prog_modqu = curtext;
 		prog_modqu = curtext;
 	}
 	}
 	if(prog_divl == P) {
 	if(prog_divl == P) {
-		diag("undefined: %s\n", s5->name);
+		diag("undefined: %s", s5->name);
 		prog_divl = curtext;
 		prog_divl = curtext;
 	}
 	}
 	if(prog_divlu == P) {
 	if(prog_divlu == P) {
-		diag("undefined: %s\n", s6->name);
+		diag("undefined: %s", s6->name);
 		prog_divlu = curtext;
 		prog_divlu = curtext;
 	}
 	}
 	if(prog_modl == P) {
 	if(prog_modl == P) {
-		diag("undefined: %s\n", s7->name);
+		diag("undefined: %s", s7->name);
 		prog_modl = curtext;
 		prog_modl = curtext;
 	}
 	}
 	if(prog_modlu == P) {
 	if(prog_modlu == P) {
-		diag("undefined: %s\n", s8->name);
+		diag("undefined: %s", s8->name);
 		prog_modlu = curtext;
 		prog_modlu = curtext;
 	}
 	}
 }
 }

+ 23 - 23
sys/src/cmd/7l/obj.c

@@ -74,7 +74,7 @@ main(int argc, char *argv[])
 	USED(argc);
 	USED(argc);
 
 
 	if(*argv == 0) {
 	if(*argv == 0) {
-		diag("usage: 1l [-options] objects\n");
+		diag("usage: 1l [-options] objects");
 		errorexit();
 		errorexit();
 	}
 	}
 	if(!debug['9'] && !debug['B'] && !debug['U'])
 	if(!debug['9'] && !debug['B'] && !debug['U'])
@@ -153,7 +153,7 @@ main(int argc, char *argv[])
 		outfile = "7.out";
 		outfile = "7.out";
 	cout = create(outfile, 1, 0775);
 	cout = create(outfile, 1, 0775);
 	if(cout < 0) {
 	if(cout < 0) {
-		diag("%s: cannot create\n", outfile);
+		diag("%s: cannot create", outfile);
 		errorexit();
 		errorexit();
 	}
 	}
 	nuxiinit();
 	nuxiinit();
@@ -265,7 +265,7 @@ objfile(char *file)
 	Bflush(&bso);
 	Bflush(&bso);
 	f = open(file, 0);
 	f = open(file, 0);
 	if(f < 0) {
 	if(f < 0) {
-		diag("cannot open file: %s\n", file);
+		diag("cannot open file: %s", file);
 		errorexit();
 		errorexit();
 	}
 	}
 	l = read(f, magbuf, SARMAG);
 	l = read(f, magbuf, SARMAG);
@@ -282,11 +282,11 @@ objfile(char *file)
 		Bprint(&bso, "%5.2f ldlib: %s\n", cputime(), file);
 		Bprint(&bso, "%5.2f ldlib: %s\n", cputime(), file);
 	l = read(f, &arhdr, SAR_HDR);
 	l = read(f, &arhdr, SAR_HDR);
 	if(l != SAR_HDR) {
 	if(l != SAR_HDR) {
-		diag("%s: short read on archive file symbol header\n", file);
+		diag("%s: short read on archive file symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
-		diag("%s: first entry not symbol header\n", file);
+		diag("%s: first entry not symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 
 
@@ -334,7 +334,7 @@ objfile(char *file)
 			l = atolwhex(arhdr.size);
 			l = atolwhex(arhdr.size);
 			ldobj(f, l, pname);
 			ldobj(f, l, pname);
 			if(s->type == SXREF) {
 			if(s->type == SXREF) {
-				diag("%s: failed to load: %s\n", file, s->name);
+				diag("%s: failed to load: %s", file, s->name);
 				errorexit();
 				errorexit();
 			}
 			}
 			work = 1;
 			work = 1;
@@ -344,7 +344,7 @@ objfile(char *file)
 	return;
 	return;
 
 
 bad:
 bad:
-	diag("%s: bad or out of date archive\n", file);
+	diag("%s: bad or out of date archive", file);
 out:
 out:
 	close(f);
 	close(f);
 }
 }
@@ -656,7 +656,7 @@ loop:
 	}
 	}
 	o = bloc[0];		/* as */
 	o = bloc[0];		/* as */
 	if(o <= AXXX || o >= ALAST) {
 	if(o <= AXXX || o >= ALAST) {
-		diag("%s: line %ld: opcode out of range %d\n", pn, pc-ipc, o);
+		diag("%s: line %ld: opcode out of range %d", pn, pc-ipc, o);
 		print("	probably not a .7 file\n");
 		print("	probably not a .7 file\n");
 		errorexit();
 		errorexit();
 	}
 	}
@@ -723,7 +723,7 @@ loop:
 	c -= r;
 	c -= r;
 
 
 	if(p->reg < 0 || p->reg > NREG)
 	if(p->reg < 0 || p->reg > NREG)
-		diag("register out of range %d\n", p->reg);
+		diag("register out of range %d", p->reg);
 
 
 	p->link = P;
 	p->link = P;
 	p->cond = P;
 	p->cond = P;
@@ -757,7 +757,7 @@ loop:
 	case AGLOBL:
 	case AGLOBL:
 		s = p->from.sym;
 		s = p->from.sym;
 		if(s == S) {
 		if(s == S) {
-			diag("GLOBL must have a name\n%P\n", p);
+			diag("GLOBL must have a name\n%P", p);
 			errorexit();
 			errorexit();
 		}
 		}
 		if(s->type == 0 || s->type == SXREF) {
 		if(s->type == 0 || s->type == SXREF) {
@@ -765,7 +765,7 @@ loop:
 			s->value = 0;
 			s->value = 0;
 		}
 		}
 		if(s->type != SBSS) {
 		if(s->type != SBSS) {
-			diag("redefinition: %s\n%P\n", s->name, p);
+			diag("redefinition: %s\n%P", s->name, p);
 			s->type = SBSS;
 			s->type = SBSS;
 			s->value = 0;
 			s->value = 0;
 		}
 		}
@@ -775,7 +775,7 @@ loop:
 
 
 	case ADYNT:
 	case ADYNT:
 		if(p->to.sym == S) {
 		if(p->to.sym == S) {
-			diag("DYNT without a sym\n%P\n", p);
+			diag("DYNT without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		di = p->to.sym;
 		di = p->to.sym;
@@ -793,7 +793,7 @@ loop:
 		p->from.offset = di->value;
 		p->from.offset = di->value;
 		p->from.sym->type = SDATA;
 		p->from.sym->type = SDATA;
 		if(curtext == P) {
 		if(curtext == P) {
-			diag("DYNT not in text: %P\n", p);
+			diag("DYNT not in text: %P", p);
 			break;
 			break;
 		}
 		}
 		p->to.sym = curtext->from.sym;
 		p->to.sym = curtext->from.sym;
@@ -804,11 +804,11 @@ loop:
 
 
 	case AINIT:
 	case AINIT:
 		if(p->from.sym == S) {
 		if(p->from.sym == S) {
-			diag("INIT without a sym\n%P\n", p);
+			diag("INIT without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		if(di == S) {
 		if(di == S) {
-			diag("INIT without previous DYNT\n%P\n", p);
+			diag("INIT without previous DYNT\n%P", p);
 			break;
 			break;
 		}
 		}
 		p->from.offset = di->value;
 		p->from.offset = di->value;
@@ -819,7 +819,7 @@ loop:
 	
 	
 	case ADATA:
 	case ADATA:
 		if(p->from.sym == S) {
 		if(p->from.sym == S) {
-			diag("DATA without a sym\n%P\n", p);
+			diag("DATA without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		p->link = datap;
 		p->link = datap;
@@ -827,7 +827,7 @@ loop:
 		break;
 		break;
 
 
 	case AGOK:
 	case AGOK:
-		diag("unknown opcode\n%P\n", p);
+		diag("unknown opcode\n%P", p);
 		p->pc = pc;
 		p->pc = pc;
 		pc++;
 		pc++;
 		break;
 		break;
@@ -847,7 +847,7 @@ loop:
 		autosize += 8;
 		autosize += 8;
 		s = p->from.sym;
 		s = p->from.sym;
 		if(s == S) {
 		if(s == S) {
-			diag("TEXT must have a name\n%P\n", p);
+			diag("TEXT must have a name\n%P", p);
 			errorexit();
 			errorexit();
 		}
 		}
 		if(s->type != 0 && s->type != SXREF) {
 		if(s->type != 0 && s->type != SXREF) {
@@ -855,7 +855,7 @@ loop:
 				skip = 1;
 				skip = 1;
 				goto casedef;
 				goto casedef;
 			}
 			}
-			diag("redefinition: %s\n%P\n", s->name, p);
+			diag("redefinition: %s\n%P", s->name, p);
 		}
 		}
 		s->type = STEXT;
 		s->type = STEXT;
 		s->value = pc;
 		s->value = pc;
@@ -965,7 +965,7 @@ loop:
 	goto loop;
 	goto loop;
 
 
 eof:
 eof:
-	diag("truncated object file: %s\n", pn);
+	diag("truncated object file: %s", pn);
 }
 }
 
 
 Sym*
 Sym*
@@ -1034,7 +1034,7 @@ gethunk(void)
 	}
 	}
 	h = sbrk(nh);
 	h = sbrk(nh);
 	if(h == (char*)-1) {
 	if(h == (char*)-1) {
-		diag("out of memory\n");
+		diag("out of memory");
 		errorexit();
 		errorexit();
 	}
 	}
 	hunk = h;
 	hunk = h;
@@ -1142,7 +1142,7 @@ doprof2(void)
 	s2 = lookup("_profin", 0);
 	s2 = lookup("_profin", 0);
 	s4 = lookup("_profout", 0);
 	s4 = lookup("_profout", 0);
 	if(s2->type != STEXT || s4->type != STEXT) {
 	if(s2->type != STEXT || s4->type != STEXT) {
-		diag("_profin/_profout not defined\n");
+		diag("_profin/_profout not defined");
 		return;
 		return;
 	}
 	}
 
 
@@ -1287,7 +1287,7 @@ ieeedtof(Ieee *ieee)
 		}
 		}
 	}
 	}
 	if(exp <= -126 || exp >= 130)
 	if(exp <= -126 || exp >= 130)
-		diag("double fp to single fp overflow\n");
+		diag("double fp to single fp overflow");
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= ieee->h & 0x80000000L;
 	v |= ieee->h & 0x80000000L;
 	return v;
 	return v;

+ 6 - 6
sys/src/cmd/7l/pass.c

@@ -19,11 +19,11 @@ dodata(void)
 		if(s->type == SBSS)
 		if(s->type == SBSS)
 			s->type = SDATA;
 			s->type = SDATA;
 		if(s->type != SDATA)
 		if(s->type != SDATA)
-			diag("initialize non-data (%d): %s\n%P\n",
+			diag("initialize non-data (%d): %s\n%P",
 				s->type, s->name, p);
 				s->type, s->name, p);
 		v = p->from.offset + p->reg;
 		v = p->from.offset + p->reg;
 		if(v > s->value)
 		if(v > s->value)
-			diag("initialize bounds (%ld): %s\n%P\n",
+			diag("initialize bounds (%ld): %s\n%P",
 				s->value, s->name, p);
 				s->value, s->name, p);
 	}
 	}
 
 
@@ -41,7 +41,7 @@ dodata(void)
 			continue;
 			continue;
 		v = s->value;
 		v = s->value;
 		if(v == 0) {
 		if(v == 0) {
-			diag("%s: no size\n", s->name);
+			diag("%s: no size", s->name);
 			v = 1;
 			v = 1;
 		}
 		}
 		while(v & 3)
 		while(v & 3)
@@ -216,7 +216,7 @@ undef(void)
 	for(i=0; i<NHASH; i++)
 	for(i=0; i<NHASH; i++)
 	for(s = hash[i]; s != S; s = s->link)
 	for(s = hash[i]; s != S; s = s->link)
 		if(s->type == SXREF)
 		if(s->type == SXREF)
-			diag("%s: not defined\n", s->name);
+			diag("%s: not defined", s->name);
 }
 }
 
 
 void
 void
@@ -347,7 +347,7 @@ patch(void)
 		   p->to.type != D_BRANCH && p->to.sym != S) {
 		   p->to.type != D_BRANCH && p->to.sym != S) {
 			s = p->to.sym;
 			s = p->to.sym;
 			if(s->type != STEXT) {
 			if(s->type != STEXT) {
-				diag("undefined: %s\n%P\n", s->name, p);
+				diag("undefined: %s\n%P", s->name, p);
 				s->type = STEXT;
 				s->type = STEXT;
 				s->value = vexit;
 				s->value = vexit;
 			}
 			}
@@ -368,7 +368,7 @@ patch(void)
 			q = q->link;
 			q = q->link;
 		}
 		}
 		if(q == P) {
 		if(q == P) {
-			diag("branch out of range %ld\n%P\n", c, p);
+			diag("branch out of range %ld\n%P", c, p);
 			p->to.type = D_NONE;
 			p->to.type = D_NONE;
 		}
 		}
 		p->cond = q;
 		p->cond = q;

+ 5 - 5
sys/src/cmd/7l/span.c

@@ -25,7 +25,7 @@ span(void)
 					p->from.sym->value = c;
 					p->from.sym->value = c;
 				continue;
 				continue;
 			}
 			}
-			diag("zero-width instruction\n%P\n", p);
+			diag("zero-width instruction\n%P", p);
 			continue;
 			continue;
 		}
 		}
 		c += m;
 		c += m;
@@ -105,7 +105,7 @@ aclass(Adr *a)
 			}
 			}
 			t = a->sym->type;
 			t = a->sym->type;
 			if(t == 0 || t == SXREF) {
 			if(t == 0 || t == SXREF) {
-				diag("undefined external: %s in %s\n",
+				diag("undefined external: %s in %s",
 					a->sym->name, TNAME);
 					a->sym->name, TNAME);
 				a->sym->type = SDATA;
 				a->sym->type = SDATA;
 			}
 			}
@@ -181,7 +181,7 @@ aclass(Adr *a)
 			}
 			}
 			t = s->type;
 			t = s->type;
 			if(t == 0 || t == SXREF) {
 			if(t == 0 || t == SXREF) {
-				diag("undefined external: %s in %s\n",
+				diag("undefined external: %s in %s",
 					s->name, TNAME);
 					s->name, TNAME);
 				s->type = SDATA;
 				s->type = SDATA;
 			}
 			}
@@ -275,7 +275,7 @@ oplook(Prog *p)
 			p->optab = (o-optab)+1;
 			p->optab = (o-optab)+1;
 			return o;
 			return o;
 		}
 		}
-	diag("illegal combination %A %d %d %d (opcross %d)\n",
+	diag("illegal combination %A %d %d %d (opcross %d)",
 		p->as, p->from.class-1, a2, a3, a1);
 		p->as, p->from.class-1, a2, a3, a1);
 	if(!debug['a'])
 	if(!debug['a'])
 		prasm(p);
 		prasm(p);
@@ -388,7 +388,7 @@ buildop(void)
 		switch(r)
 		switch(r)
 		{
 		{
 		default:
 		default:
-			diag("unknown op in build: %A\n", r);
+			diag("unknown op in build: %A", r);
 			errorexit();
 			errorexit();
 		case AADDQ:
 		case AADDQ:
 			oprange[AS4ADDQ] = oprange[r];
 			oprange[AS4ADDQ] = oprange[r];

+ 6 - 6
sys/src/cmd/8l/asm.c

@@ -63,7 +63,7 @@ asmb(void)
 		if(p->pc != pc) {
 		if(p->pc != pc) {
 			if(!debug['a'])
 			if(!debug['a'])
 				print("%P\n", curp);
 				print("%P\n", curp);
-			diag("phase error %lux sb %lux in %s\n", p->pc, pc, TNAME);
+			diag("phase error %lux sb %lux in %s", p->pc, pc, TNAME);
 			pc = p->pc;
 			pc = p->pc;
 		}
 		}
 		curp = p;
 		curp = p;
@@ -81,7 +81,7 @@ asmb(void)
 			if(p->as == ATEXT)
 			if(p->as == ATEXT)
 				reloca = nil;
 				reloca = nil;
 			else if(reloca != nil)
 			else if(reloca != nil)
-				diag("reloc failure: %P\n", curp);
+				diag("reloc failure: %P", curp);
 		}
 		}
 		memmove(cbp, and, a);
 		memmove(cbp, and, a);
 		cbp += a;
 		cbp += a;
@@ -91,7 +91,7 @@ asmb(void)
 	cflush();
 	cflush();
 	switch(HEADTYPE) {
 	switch(HEADTYPE) {
 	default:
 	default:
-		diag("unknown header type %d\n", HEADTYPE);
+		diag("unknown header type %d", HEADTYPE);
 	case 0:
 	case 0:
 		seek(cout, rnd(HEADR+textsize, 8192), 0);
 		seek(cout, rnd(HEADR+textsize, 8192), 0);
 		break;
 		break;
@@ -360,7 +360,7 @@ datblk(long s, long n)
 			for(j=l+(c-i)-1; j>=l; j--)
 			for(j=l+(c-i)-1; j>=l; j--)
 				if(buf.dbuf[j]) {
 				if(buf.dbuf[j]) {
 					print("%P\n", p);
 					print("%P\n", p);
-					diag("multiple initialization\n");
+					diag("multiple initialization");
 					break;
 					break;
 				}
 				}
 		}
 		}
@@ -414,7 +414,7 @@ datblk(long s, long n)
 			fl = p->to.offset;
 			fl = p->to.offset;
 			if(p->to.type == D_ADDR) {
 			if(p->to.type == D_ADDR) {
 				if(p->to.index != D_STATIC && p->to.index != D_EXTERN)
 				if(p->to.index != D_STATIC && p->to.index != D_EXTERN)
-					diag("DADDR type%P\n", p);
+					diag("DADDR type%P", p);
 				if(p->to.sym) {
 				if(p->to.sym) {
 					if(reloc)
 					if(reloc)
 						wreloc(p->to.sym, l+s+INITDAT);
 						wreloc(p->to.sym, l+s+INITDAT);
@@ -426,7 +426,7 @@ datblk(long s, long n)
 			cast = (char*)&fl;
 			cast = (char*)&fl;
 			switch(c) {
 			switch(c) {
 			default:
 			default:
-				diag("bad nuxi %d %d\n%P\n", c, i, curp);
+				diag("bad nuxi %d %d\n%P", c, i, curp);
 				break;
 				break;
 			case 1:
 			case 1:
 				if(debug['a'] && i == 0) {
 				if(debug['a'] && i == 0) {

+ 1 - 1
sys/src/cmd/8l/list.c

@@ -285,7 +285,7 @@ diag(char *fmt, ...)
 	print("%s: %s\n", tn, buf);
 	print("%s: %s\n", tn, buf);
 
 
 	nerrors++;
 	nerrors++;
-	if(nerrors > 10) {
+	if(nerrors > 20) {
 		print("too many errors\n");
 		print("too many errors\n");
 		errorexit();
 		errorexit();
 	}
 	}

+ 21 - 21
sys/src/cmd/8l/obj.c

@@ -79,7 +79,7 @@ main(int argc, char *argv[])
 	} ARGEND
 	} ARGEND
 	USED(argc);
 	USED(argc);
 	if(*argv == 0) {
 	if(*argv == 0) {
-		diag("usage: 8l [-options] objects\n");
+		diag("usage: 8l [-options] objects");
 		errorexit();
 		errorexit();
 	}
 	}
 	if(!debug['9'] && debug['r']) {
 	if(!debug['9'] && debug['r']) {
@@ -161,7 +161,7 @@ main(int argc, char *argv[])
 	Bflush(&bso);
 	Bflush(&bso);
 	for(i=1; optab[i].as; i++)
 	for(i=1; optab[i].as; i++)
 		if(i != optab[i].as) {
 		if(i != optab[i].as) {
-			diag("phase error in optab: %d\n", i);
+			diag("phase error in optab: %d", i);
 			errorexit();
 			errorexit();
 		}
 		}
 	maxop = i;
 	maxop = i;
@@ -234,7 +234,7 @@ main(int argc, char *argv[])
 	dtype = 4;
 	dtype = 4;
 	cout = create(outfile, 1, 0775);
 	cout = create(outfile, 1, 0775);
 	if(cout < 0) {
 	if(cout < 0) {
-		diag("cannot create %s\n", outfile);
+		diag("cannot create %s", outfile);
 		errorexit();
 		errorexit();
 	}
 	}
 	version = 0;
 	version = 0;
@@ -347,7 +347,7 @@ objfile(char *file)
 	Bflush(&bso);
 	Bflush(&bso);
 	f = open(file, 0);
 	f = open(file, 0);
 	if(f < 0) {
 	if(f < 0) {
-		diag("cannot open file: %s\n", file);
+		diag("cannot open file: %s", file);
 		errorexit();
 		errorexit();
 	}
 	}
 	l = read(f, magbuf, SARMAG);
 	l = read(f, magbuf, SARMAG);
@@ -362,11 +362,11 @@ objfile(char *file)
 
 
 	l = read(f, &arhdr, SAR_HDR);
 	l = read(f, &arhdr, SAR_HDR);
 	if(l != SAR_HDR) {
 	if(l != SAR_HDR) {
-		diag("%s: short read on archive file symbol header\n", file);
+		diag("%s: short read on archive file symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
-		diag("%s: first entry not symbol header\n", file);
+		diag("%s: first entry not symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 
 
@@ -414,7 +414,7 @@ objfile(char *file)
 			l = atolwhex(arhdr.size);
 			l = atolwhex(arhdr.size);
 			ldobj(f, l, pname);
 			ldobj(f, l, pname);
 			if(s->type == SXREF) {
 			if(s->type == SXREF) {
-				diag("%s: failed to load: %s\n", file, s->name);
+				diag("%s: failed to load: %s", file, s->name);
 				errorexit();
 				errorexit();
 			}
 			}
 			work = 1;
 			work = 1;
@@ -424,7 +424,7 @@ objfile(char *file)
 	return;
 	return;
 
 
 bad:
 bad:
-	diag("%s: bad or out of date archive\n", file);
+	diag("%s: bad or out of date archive", file);
 out:
 out:
 	close(f);
 	close(f);
 }
 }
@@ -710,7 +710,7 @@ loop:
 	if(o <= AXXX || o >= ALAST) {
 	if(o <= AXXX || o >= ALAST) {
 		if(o < 0)
 		if(o < 0)
 			goto eof;
 			goto eof;
-		diag("%s: opcode out of range %d\n", pn, o);
+		diag("%s: opcode out of range %d", pn, o);
 		print("	probably not a .8 file\n");
 		print("	probably not a .8 file\n");
 		errorexit();
 		errorexit();
 	}
 	}
@@ -807,7 +807,7 @@ loop:
 			s->value = 0;
 			s->value = 0;
 		}
 		}
 		if(s->type != SBSS) {
 		if(s->type != SBSS) {
-			diag("%s: redefinition: %s in %s\n",
+			diag("%s: redefinition: %s in %s",
 				pn, s->name, TNAME);
 				pn, s->name, TNAME);
 			s->type = SBSS;
 			s->type = SBSS;
 			s->value = 0;
 			s->value = 0;
@@ -818,7 +818,7 @@ loop:
 
 
 	case ADYNT:
 	case ADYNT:
 		if(p->to.sym == S) {
 		if(p->to.sym == S) {
-			diag("DYNT without a sym\n%P\n", p);
+			diag("DYNT without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		di = p->to.sym;
 		di = p->to.sym;
@@ -836,7 +836,7 @@ loop:
 		p->from.offset = di->value;
 		p->from.offset = di->value;
 		p->from.sym->type = SDATA;
 		p->from.sym->type = SDATA;
 		if(curtext == P) {
 		if(curtext == P) {
-			diag("DYNT not in text: %P\n", p);
+			diag("DYNT not in text: %P", p);
 			break;
 			break;
 		}
 		}
 		p->to.sym = curtext->from.sym;
 		p->to.sym = curtext->from.sym;
@@ -846,11 +846,11 @@ loop:
 
 
 	case AINIT:
 	case AINIT:
 		if(p->from.sym == S) {
 		if(p->from.sym == S) {
-			diag("INIT without a sym\n%P\n", p);
+			diag("INIT without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		if(di == S) {
 		if(di == S) {
-			diag("INIT without previous DYNT\n%P\n", p);
+			diag("INIT without previous DYNT\n%P", p);
 			break;
 			break;
 		}
 		}
 		p->from.offset = di->value;
 		p->from.offset = di->value;
@@ -868,7 +868,7 @@ loop:
 		goto loop;
 		goto loop;
 
 
 	case AGOK:
 	case AGOK:
-		diag("%s: GOK opcode in %s\n", pn, TNAME);
+		diag("%s: GOK opcode in %s", pn, TNAME);
 		pc++;
 		pc++;
 		goto loop;
 		goto loop;
 
 
@@ -882,7 +882,7 @@ loop:
 		curtext = p;
 		curtext = p;
 		s = p->from.sym;
 		s = p->from.sym;
 		if(s == S) {
 		if(s == S) {
-			diag("%s: no TEXT symbol: %P\n", pn, p);
+			diag("%s: no TEXT symbol: %P", pn, p);
 			errorexit();
 			errorexit();
 		}
 		}
 		if(s->type != 0 && s->type != SXREF) {
 		if(s->type != 0 && s->type != SXREF) {
@@ -890,7 +890,7 @@ loop:
 				skip = 1;
 				skip = 1;
 				goto casdef;
 				goto casdef;
 			}
 			}
-			diag("%s: redefinition: %s\n%P\n", pn, s->name, p);
+			diag("%s: redefinition: %s\n%P", pn, s->name, p);
 		}
 		}
 		s->type = STEXT;
 		s->type = STEXT;
 		s->value = pc;
 		s->value = pc;
@@ -1016,7 +1016,7 @@ loop:
 	goto loop;
 	goto loop;
 
 
 eof:
 eof:
-	diag("truncated object file: %s\n", pn);
+	diag("truncated object file: %s", pn);
 }
 }
 
 
 Sym*
 Sym*
@@ -1108,7 +1108,7 @@ gethunk(void)
 	}
 	}
 	h = mysbrk(nh);
 	h = mysbrk(nh);
 	if(h == (char*)-1) {
 	if(h == (char*)-1) {
-		diag("out of memory\n");
+		diag("out of memory");
 		errorexit();
 		errorexit();
 	}
 	}
 	hunk = h;
 	hunk = h;
@@ -1188,7 +1188,7 @@ doprof2(void)
 	s2 = lookup("_profin", 0);
 	s2 = lookup("_profin", 0);
 	s4 = lookup("_profout", 0);
 	s4 = lookup("_profout", 0);
 	if(s2->type != STEXT || s4->type != STEXT) {
 	if(s2->type != STEXT || s4->type != STEXT) {
-		diag("_profin/_profout not defined\n");
+		diag("_profin/_profout not defined");
 		return;
 		return;
 	}
 	}
 
 
@@ -1352,7 +1352,7 @@ ieeedtof(Ieee *e)
 		}
 		}
 	}
 	}
 	if(exp <= -126 || exp >= 130)
 	if(exp <= -126 || exp >= 130)
-		diag("double fp to single fp overflow\n");
+		diag("double fp to single fp overflow");
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= e->h & 0x80000000L;
 	v |= e->h & 0x80000000L;
 	return v;
 	return v;

+ 8 - 8
sys/src/cmd/8l/pass.c

@@ -18,11 +18,11 @@ dodata(void)
 		if(s->type == SBSS)
 		if(s->type == SBSS)
 			s->type = SDATA;
 			s->type = SDATA;
 		if(s->type != SDATA)
 		if(s->type != SDATA)
-			diag("initialize non-data (%d): %s\n%P\n",
+			diag("initialize non-data (%d): %s\n%P",
 				s->type, s->name, p);
 				s->type, s->name, p);
 		t = p->from.offset + p->width;
 		t = p->from.offset + p->width;
 		if(t > s->value)
 		if(t > s->value)
-			diag("initialize bounds (%ld): %s\n%P\n",
+			diag("initialize bounds (%ld): %s\n%P",
 				s->value, s->name, p);
 				s->value, s->name, p);
 	}
 	}
 	/* allocate small guys */
 	/* allocate small guys */
@@ -34,7 +34,7 @@ dodata(void)
 			continue;
 			continue;
 		t = s->value;
 		t = s->value;
 		if(t == 0) {
 		if(t == 0) {
-			diag("%s: no size\n", s->name);
+			diag("%s: no size", s->name);
 			t = 1;
 			t = 1;
 		}
 		}
 		t = rnd(t, 4);;
 		t = rnd(t, 4);;
@@ -255,7 +255,7 @@ relinv(int a)
 	case AJOS:	return AJOC;
 	case AJOS:	return AJOC;
 	case AJOC:	return AJOS;
 	case AJOC:	return AJOS;
 	}
 	}
-	diag("unknown relation: %s in %s\n", anames[a], TNAME);
+	diag("unknown relation: %s in %s", anames[a], TNAME);
 	return a;
 	return a;
 }
 }
 
 
@@ -272,7 +272,7 @@ doinit(void)
 			continue;
 			continue;
 		s = p->to.sym;
 		s = p->to.sym;
 		if(s->type == 0 || s->type == SXREF)
 		if(s->type == 0 || s->type == SXREF)
-			diag("undefined %s initializer of %s\n",
+			diag("undefined %s initializer of %s",
 				s->name, p->from.sym->name);
 				s->name, p->from.sym->name);
 		p->to.offset += s->value;
 		p->to.offset += s->value;
 		p->to.type = D_CONST;
 		p->to.type = D_CONST;
@@ -315,7 +315,7 @@ patch(void)
 					p->to.offset = 0;
 					p->to.offset = 0;
 					break;
 					break;
 				default:
 				default:
-					diag("undefined: %s in %s\n", s->name, TNAME);
+					diag("undefined: %s in %s", s->name, TNAME);
 					s->type = STEXT;
 					s->type = STEXT;
 					s->value = vexit;
 					s->value = vexit;
 				}
 				}
@@ -336,7 +336,7 @@ patch(void)
 			q = q->link;
 			q = q->link;
 		}
 		}
 		if(q == P) {
 		if(q == P) {
-			diag("branch out of range in %s\n%P\n", TNAME, p);
+			diag("branch out of range in %s\n%P", TNAME, p);
 			p->to.type = D_NONE;
 			p->to.type = D_NONE;
 		}
 		}
 		p->pcond = q;
 		p->pcond = q;
@@ -613,5 +613,5 @@ undef(void)
 	for(i=0; i<NHASH; i++)
 	for(i=0; i<NHASH; i++)
 	for(s = hash[i]; s != S; s = s->link)
 	for(s = hash[i]; s != S; s = s->link)
 		if(s->type == SXREF)
 		if(s->type == SXREF)
-			diag("%s: not defined\n", s->name);
+			diag("%s: not defined", s->name);
 }
 }

+ 7 - 7
sys/src/cmd/8l/span.c

@@ -502,7 +502,7 @@ bas:
 	*andptr++ = i;
 	*andptr++ = i;
 	return;
 	return;
 bad:
 bad:
-	diag("asmidx: bad address %D\n", a);
+	diag("asmidx: bad address %D", a);
 	*andptr++ = 0;
 	*andptr++ = 0;
 	return;
 	return;
 }
 }
@@ -722,7 +722,7 @@ asmand(Adr *a, int r)
 	asmand(&aa, r);
 	asmand(&aa, r);
 	return;
 	return;
 bad:
 bad:
-	diag("asmand: bad address %D\n", a);
+	diag("asmand: bad address %D", a);
 	return;
 	return;
 }
 }
 
 
@@ -885,7 +885,7 @@ doasm(Prog *p)
 	tt = oclass(&p->to) * Ymax;
 	tt = oclass(&p->to) * Ymax;
 	t = o->ytab;
 	t = o->ytab;
 	if(t == 0) {
 	if(t == 0) {
-		diag("asmins: noproto %P\n", p);
+		diag("asmins: noproto %P", p);
 		return;
 		return;
 	}
 	}
 	for(z=0; *t; z+=t[3],t+=4)
 	for(z=0; *t; z+=t[3],t+=4)
@@ -916,7 +916,7 @@ found:
 	op = o->op[z];
 	op = o->op[z];
 	switch(t[2]) {
 	switch(t[2]) {
 	default:
 	default:
-		diag("asmins: unknown z %d %P\n", t[2], p);
+		diag("asmins: unknown z %d %P", t[2], p);
 		return;
 		return;
 
 
 	case Zpseudo:
 	case Zpseudo:
@@ -1123,7 +1123,7 @@ found:
 		if(q) {
 		if(q) {
 			v = q->pc - p->pc - 2;
 			v = q->pc - p->pc - 2;
 			if(v < -128 && v > 127)
 			if(v < -128 && v > 127)
-				diag("loop too far: %P\n", p);
+				diag("loop too far: %P", p);
 			*andptr++ = op;
 			*andptr++ = op;
 			*andptr++ = v;
 			*andptr++ = v;
 		}
 		}
@@ -1194,13 +1194,13 @@ bad:
 		}
 		}
 		return;
 		return;
 	}
 	}
-	diag("doasm: notfound t2=%lux from=%lux to=%lux %P\n", t[2], p->from.type, p->to.type, p);
+	diag("doasm: notfound t2=%lux from=%lux to=%lux %P", t[2], p->from.type, p->to.type, p);
 	return;
 	return;
 
 
 mfound:
 mfound:
 	switch(t[3]) {
 	switch(t[3]) {
 	default:
 	default:
-		diag("asmins: unknown mov %d %P\n", t[3], p);
+		diag("asmins: unknown mov %d %P", t[3], p);
 		break;
 		break;
 
 
 	case 0:	/* lit */
 	case 0:	/* lit */

+ 11 - 11
sys/src/cmd/9l/asm.c

@@ -71,7 +71,7 @@ asmb(void)
 			autosize = p->to.offset + 4;
 			autosize = p->to.offset + 4;
 		}
 		}
 		if(p->pc != pc) {
 		if(p->pc != pc) {
-			diag("phase error %lux sb %lux\n",
+			diag("phase error %lux sb %lux",
 				p->pc, pc);
 				p->pc, pc);
 			if(!debug['a'])
 			if(!debug['a'])
 				prasm(curp);
 				prasm(curp);
@@ -592,13 +592,13 @@ datblk(long s, long n)
 			for(j=l+(c-i)-1; j>=l; j--)
 			for(j=l+(c-i)-1; j>=l; j--)
 				if(buf.dbuf[j]) {
 				if(buf.dbuf[j]) {
 					print("%P\n", p);
 					print("%P\n", p);
-					diag("multiple initialization\n");
+					diag("multiple initialization");
 					break;
 					break;
 				}
 				}
 		}
 		}
 		switch(p->to.type) {
 		switch(p->to.type) {
 		default:
 		default:
-			diag("unknown mode in initialization\n%P\n", p);
+			diag("unknown mode in initialization\n%P", p);
 			break;
 			break;
 
 
 		case D_FCONST:
 		case D_FCONST:
@@ -643,7 +643,7 @@ datblk(long s, long n)
 			cast = (char*)&d;
 			cast = (char*)&d;
 			switch(c) {
 			switch(c) {
 			default:
 			default:
-				diag("bad nuxi %d %d\n%P\n", c, i, curp);
+				diag("bad nuxi %d %d\n%P", c, i, curp);
 				break;
 				break;
 			case 1:
 			case 1:
 				for(; i<c; i++) {
 				for(; i<c; i++) {
@@ -696,7 +696,7 @@ opas(int a)
 	case AJMPF:	return BJMPF;
 	case AJMPF:	return BJMPF;
 	case AJMPT:	return BJMPT;
 	case AJMPT:	return BJMPT;
 	}
 	}
-	diag("bad opas %A\n", a);
+	diag("bad opas %A", a);
 	return 0;
 	return 0;
 }
 }
 
 
@@ -715,7 +715,7 @@ asmout(Prog *p, Optab *o, int aflag)
 	a = p->as;
 	a = p->as;
 	switch(o->type) {
 	switch(o->type) {
 	default:
 	default:
-		diag("unknown type %d\n%P\n", o->type, p);
+		diag("unknown type %d\n%P", o->type, p);
 		break;
 		break;
 
 
 	case 0:		/* pseudo ops */
 	case 0:		/* pseudo ops */
@@ -1210,7 +1210,7 @@ oprrr(int a, int rb, int ra, int rc)
 
 
 	switch(a) {
 	switch(a) {
 	default:
 	default:
-		diag("bad oprrr %A\n", a);
+		diag("bad oprrr %A", a);
 	case AMOVL:	o = 0x00<<24; break;
 	case AMOVL:	o = 0x00<<24; break;
 
 
 	case AADDL:	o = 0x14<<24; break;
 	case AADDL:	o = 0x14<<24; break;
@@ -1293,22 +1293,22 @@ opmem(int m, int a, int ir, int r)
 
 
 	switch(a) {
 	switch(a) {
 	default:
 	default:
-		diag("bad opmem %A\n", a);
+		diag("bad opmem %A", a);
 	case ALOADSET:
 	case ALOADSET:
 		if(m != BLOAD)
 		if(m != BLOAD)
-			diag("bad loadset code %A\n", a);
+			diag("bad loadset code %A", a);
 		o = 0x00<<16;
 		o = 0x00<<16;
 		m = BLOADSET;
 		m = BLOADSET;
 		break;
 		break;
 	case ALOADM:
 	case ALOADM:
 		if(m != BLOAD)
 		if(m != BLOAD)
-			diag("bad loadm code %A\n", a);
+			diag("bad loadm code %A", a);
 		o = 0x00<<16;
 		o = 0x00<<16;
 		m = BLOADM;
 		m = BLOADM;
 		break;
 		break;
 	case ASTOREM:
 	case ASTOREM:
 		if(m != BSTORE)
 		if(m != BSTORE)
-			diag("bad storem code %A\n", a);
+			diag("bad storem code %A", a);
 		o = 0x00<<16;
 		o = 0x00<<16;
 		m = BSTOREM;
 		m = BSTOREM;
 		break;
 		break;

+ 6 - 6
sys/src/cmd/9l/noop.c

@@ -444,19 +444,19 @@ initmul(void)
 				prog_mulmul = p;
 				prog_mulmul = p;
 		}
 		}
 	if(prog_mull == P) {
 	if(prog_mull == P) {
-		diag("undefined: %s\n", s1->name);
+		diag("undefined: %s", s1->name);
 		prog_mull = curtext;
 		prog_mull = curtext;
 	}
 	}
 	if(prog_mulul == P) {
 	if(prog_mulul == P) {
-		diag("undefined: %s\n", s2->name);
+		diag("undefined: %s", s2->name);
 		prog_mulul = curtext;
 		prog_mulul = curtext;
 	}
 	}
 	if(prog_mulml == P) {
 	if(prog_mulml == P) {
-		diag("undefined: %s\n", s3->name);
+		diag("undefined: %s", s3->name);
 		prog_mulml = curtext;
 		prog_mulml = curtext;
 	}
 	}
 	if(prog_mulmul == P) {
 	if(prog_mulmul == P) {
-		diag("undefined: %s\n", s4->name);
+		diag("undefined: %s", s4->name);
 		prog_mulmul = curtext;
 		prog_mulmul = curtext;
 	}
 	}
 }
 }
@@ -477,11 +477,11 @@ initdiv(void)
 				prog_divul = p;
 				prog_divul = p;
 		}
 		}
 	if(prog_divl == P) {
 	if(prog_divl == P) {
-		diag("undefined: %s\n", s5->name);
+		diag("undefined: %s", s5->name);
 		prog_divl = curtext;
 		prog_divl = curtext;
 	}
 	}
 	if(prog_divul == P) {
 	if(prog_divul == P) {
-		diag("undefined: %s\n", s6->name);
+		diag("undefined: %s", s6->name);
 		prog_divul = curtext;
 		prog_divul = curtext;
 	}
 	}
 }
 }

+ 23 - 23
sys/src/cmd/9l/obj.c

@@ -77,7 +77,7 @@ main(int argc, char *argv[])
 	USED(argc);
 	USED(argc);
 
 
 	if(*argv == 0) {
 	if(*argv == 0) {
-		diag("usage: vl [-options] objects\n");
+		diag("usage: vl [-options] objects");
 		errorexit();
 		errorexit();
 	}
 	}
 	if(!debug['9'] && !debug['U'] && !debug['B'])
 	if(!debug['9'] && !debug['U'] && !debug['B'])
@@ -174,7 +174,7 @@ main(int argc, char *argv[])
 		outfile = "9.out";
 		outfile = "9.out";
 	cout = create(outfile, 1, 0775);
 	cout = create(outfile, 1, 0775);
 	if(cout < 0) {
 	if(cout < 0) {
-		diag("%s: cannot create\n", outfile);
+		diag("%s: cannot create", outfile);
 		errorexit();
 		errorexit();
 	}
 	}
 	nuxiinit();
 	nuxiinit();
@@ -291,7 +291,7 @@ objfile(char *file)
 	Bflush(&bso);
 	Bflush(&bso);
 	f = open(file, 0);
 	f = open(file, 0);
 	if(f < 0) {
 	if(f < 0) {
-		diag("cannot open file: %s\n", file);
+		diag("cannot open file: %s", file);
 		errorexit();
 		errorexit();
 	}
 	}
 	l = read(f, magbuf, SARMAG);
 	l = read(f, magbuf, SARMAG);
@@ -308,11 +308,11 @@ objfile(char *file)
 		Bprint(&bso, "%5.2f ldlib: %s\n", cputime(), file);
 		Bprint(&bso, "%5.2f ldlib: %s\n", cputime(), file);
 	l = read(f, &arhdr, SAR_HDR);
 	l = read(f, &arhdr, SAR_HDR);
 	if(l != SAR_HDR) {
 	if(l != SAR_HDR) {
-		diag("%s: short read on archive file symbol header\n", file);
+		diag("%s: short read on archive file symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
 	if(strncmp(arhdr.name, symname, strlen(symname))) {
-		diag("%s: first entry not symbol header\n", file);
+		diag("%s: first entry not symbol header", file);
 		goto out;
 		goto out;
 	}
 	}
 
 
@@ -360,7 +360,7 @@ objfile(char *file)
 			l = atolwhex(arhdr.size);
 			l = atolwhex(arhdr.size);
 			ldobj(f, l, pname);
 			ldobj(f, l, pname);
 			if(s->type == SXREF) {
 			if(s->type == SXREF) {
-				diag("%s: failed to load: %s\n", file, s->name);
+				diag("%s: failed to load: %s", file, s->name);
 				errorexit();
 				errorexit();
 			}
 			}
 			work = 1;
 			work = 1;
@@ -369,7 +369,7 @@ objfile(char *file)
 	return;
 	return;
 
 
 bad:
 bad:
-	diag("%s: bad or out of date archive\n", file);
+	diag("%s: bad or out of date archive", file);
 out:
 out:
 	close(f);
 	close(f);
 }
 }
@@ -677,7 +677,7 @@ loop:
 	}
 	}
 	o = bloc[0];		/* as */
 	o = bloc[0];		/* as */
 	if(o <= AXXX || o >= ALAST) {
 	if(o <= AXXX || o >= ALAST) {
-		diag("%s: line %ld: opcode out of range %d\n", pn, pc-ipc, o);
+		diag("%s: line %ld: opcode out of range %d", pn, pc-ipc, o);
 		print("	probably not a .9 file\n");
 		print("	probably not a .9 file\n");
 		errorexit();
 		errorexit();
 	}
 	}
@@ -743,7 +743,7 @@ loop:
 	c -= r;
 	c -= r;
 
 
 	if(p->reg < 0 || p->reg > NREG)
 	if(p->reg < 0 || p->reg > NREG)
-		diag("register out of range %d\n", p->reg);
+		diag("register out of range %d", p->reg);
 
 
 	p->link = P;
 	p->link = P;
 	p->cond = P;
 	p->cond = P;
@@ -808,7 +808,7 @@ if(p->reg != NREG) {
 	case AGLOBL:
 	case AGLOBL:
 		s = p->from.sym;
 		s = p->from.sym;
 		if(s == S) {
 		if(s == S) {
-			diag("GLOBL must have a name\n%P\n", p);
+			diag("GLOBL must have a name\n%P", p);
 			errorexit();
 			errorexit();
 		}
 		}
 		if(s->type == 0 || s->type == SXREF) {
 		if(s->type == 0 || s->type == SXREF) {
@@ -816,7 +816,7 @@ if(p->reg != NREG) {
 			s->value = 0;
 			s->value = 0;
 		}
 		}
 		if(s->type != SBSS) {
 		if(s->type != SBSS) {
-			diag("redefinition: %s\n%P\n", s->name, p);
+			diag("redefinition: %s\n%P", s->name, p);
 			s->type = SBSS;
 			s->type = SBSS;
 			s->value = 0;
 			s->value = 0;
 		}
 		}
@@ -826,7 +826,7 @@ if(p->reg != NREG) {
 
 
 	case ADYNT:
 	case ADYNT:
 		if(p->to.sym == S) {
 		if(p->to.sym == S) {
-			diag("DYNT without a sym\n%P\n", p);
+			diag("DYNT without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		di = p->to.sym;
 		di = p->to.sym;
@@ -844,7 +844,7 @@ if(p->reg != NREG) {
 		p->from.offset = di->value;
 		p->from.offset = di->value;
 		p->from.sym->type = SDATA;
 		p->from.sym->type = SDATA;
 		if(curtext == P) {
 		if(curtext == P) {
-			diag("DYNT not in text: %P\n", p);
+			diag("DYNT not in text: %P", p);
 			break;
 			break;
 		}
 		}
 		p->to.sym = curtext->from.sym;
 		p->to.sym = curtext->from.sym;
@@ -855,11 +855,11 @@ if(p->reg != NREG) {
 
 
 	case AINIT:
 	case AINIT:
 		if(p->from.sym == S) {
 		if(p->from.sym == S) {
-			diag("INIT without a sym\n%P\n", p);
+			diag("INIT without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		if(di == S) {
 		if(di == S) {
-			diag("INIT without previous DYNT\n%P\n", p);
+			diag("INIT without previous DYNT\n%P", p);
 			break;
 			break;
 		}
 		}
 		p->from.offset = di->value;
 		p->from.offset = di->value;
@@ -870,7 +870,7 @@ if(p->reg != NREG) {
 	
 	
 	case ADATA:
 	case ADATA:
 		if(p->from.sym == S) {
 		if(p->from.sym == S) {
-			diag("DATA without a sym\n%P\n", p);
+			diag("DATA without a sym\n%P", p);
 			break;
 			break;
 		}
 		}
 		p->link = datap;
 		p->link = datap;
@@ -878,7 +878,7 @@ if(p->reg != NREG) {
 		break;
 		break;
 
 
 	case AGOK:
 	case AGOK:
-		diag("unknown opcode\n%P\n", p);
+		diag("unknown opcode\n%P", p);
 		p->pc = pc;
 		p->pc = pc;
 		pc++;
 		pc++;
 		break;
 		break;
@@ -896,7 +896,7 @@ if(p->reg != NREG) {
 		autosize += 4;
 		autosize += 4;
 		s = p->from.sym;
 		s = p->from.sym;
 		if(s == S) {
 		if(s == S) {
-			diag("TEXT must have a name\n%P\n", p);
+			diag("TEXT must have a name\n%P", p);
 			errorexit();
 			errorexit();
 		}
 		}
 		if(s->type != 0 && s->type != SXREF) {
 		if(s->type != 0 && s->type != SXREF) {
@@ -904,7 +904,7 @@ if(p->reg != NREG) {
 				skip = 1;
 				skip = 1;
 				goto casedef;
 				goto casedef;
 			}
 			}
-			diag("redefinition: %s\n%P\n", s->name, p);
+			diag("redefinition: %s\n%P", s->name, p);
 		}
 		}
 		s->type = STEXT;
 		s->type = STEXT;
 		s->value = pc;
 		s->value = pc;
@@ -1017,7 +1017,7 @@ if(p->reg != NREG) {
 	goto loop;
 	goto loop;
 
 
 eof:
 eof:
-	diag("truncated object file: %s\n", pn);
+	diag("truncated object file: %s", pn);
 }
 }
 
 
 Sym*
 Sym*
@@ -1086,7 +1086,7 @@ gethunk(void)
 	}
 	}
 	h = sbrk(nh);
 	h = sbrk(nh);
 	if(h == (char*)-1) {
 	if(h == (char*)-1) {
-		diag("out of memory\n");
+		diag("out of memory");
 		errorexit();
 		errorexit();
 	}
 	}
 	hunk = h;
 	hunk = h;
@@ -1194,7 +1194,7 @@ doprof2(void)
 	s2 = lookup("_profin", 0);
 	s2 = lookup("_profin", 0);
 	s4 = lookup("_profout", 0);
 	s4 = lookup("_profout", 0);
 	if(s2->type != STEXT || s4->type != STEXT) {
 	if(s2->type != STEXT || s4->type != STEXT) {
-		diag("_profin/_profout not defined\n");
+		diag("_profin/_profout not defined");
 		return;
 		return;
 	}
 	}
 
 
@@ -1336,7 +1336,7 @@ ieeedtof(Ieee *ieee)
 		}
 		}
 	}
 	}
 	if(exp <= -126 || exp >= 130)
 	if(exp <= -126 || exp >= 130)
-		diag("double fp to single fp overflow\n");
+		diag("double fp to single fp overflow");
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= ((exp + 126) & 0xffL) << 23;
 	v |= ieee->h & 0x80000000L;
 	v |= ieee->h & 0x80000000L;
 	return v;
 	return v;

+ 6 - 6
sys/src/cmd/9l/pass.c

@@ -18,11 +18,11 @@ dodata(void)
 		if(s->type == SBSS)
 		if(s->type == SBSS)
 			s->type = SDATA;
 			s->type = SDATA;
 		if(s->type != SDATA)
 		if(s->type != SDATA)
-			diag("initialize non-data (%d): %s\n%P\n",
+			diag("initialize non-data (%d): %s\n%P",
 				s->type, s->name, p);
 				s->type, s->name, p);
 		v = p->from.offset + p->reg;
 		v = p->from.offset + p->reg;
 		if(v > s->value)
 		if(v > s->value)
-			diag("initialize bounds (%ld): %s\n%P\n",
+			diag("initialize bounds (%ld): %s\n%P",
 				s->value, s->name, p);
 				s->value, s->name, p);
 	}
 	}
 
 
@@ -38,7 +38,7 @@ dodata(void)
 			continue;
 			continue;
 		v = s->value;
 		v = s->value;
 		if(v == 0) {
 		if(v == 0) {
-			diag("%s: no size\n", s->name);
+			diag("%s: no size", s->name);
 			v = 1;
 			v = 1;
 		}
 		}
 		while(v & 3)
 		while(v & 3)
@@ -122,7 +122,7 @@ undef(void)
 	for(i=0; i<NHASH; i++)
 	for(i=0; i<NHASH; i++)
 	for(s = hash[i]; s != S; s = s->link)
 	for(s = hash[i]; s != S; s = s->link)
 		if(s->type == SXREF)
 		if(s->type == SXREF)
-			diag("%s: not defined\n", s->name);
+			diag("%s: not defined", s->name);
 }
 }
 
 
 void
 void
@@ -273,7 +273,7 @@ patch(void)
 		   p->to.type != D_BRANCH && p->to.sym != S) {
 		   p->to.type != D_BRANCH && p->to.sym != S) {
 			s = p->to.sym;
 			s = p->to.sym;
 			if(s->type != STEXT) {
 			if(s->type != STEXT) {
-				diag("undefined: %s\n%P\n", s->name, p);
+				diag("undefined: %s\n%P", s->name, p);
 				s->type = STEXT;
 				s->type = STEXT;
 				s->value = vexit;
 				s->value = vexit;
 			}
 			}
@@ -294,7 +294,7 @@ patch(void)
 			q = q->link;
 			q = q->link;
 		}
 		}
 		if(q == P) {
 		if(q == P) {
-			diag("branch out of range %ld\n%P\n", c, p);
+			diag("branch out of range %ld\n%P", c, p);
 			p->to.type = D_NONE;
 			p->to.type = D_NONE;
 		}
 		}
 		p->cond = q;
 		p->cond = q;

+ 7 - 7
sys/src/cmd/9l/span.c

@@ -44,7 +44,7 @@ loop:
 					p->from.sym->value = c;
 					p->from.sym->value = c;
 				continue;
 				continue;
 			}
 			}
-			diag("zero-width instruction\n%P\n", p);
+			diag("zero-width instruction\n%P", p);
 			continue;
 			continue;
 		}
 		}
 		c += m;
 		c += m;
@@ -132,7 +132,7 @@ aclass(Adr *a)
 			}
 			}
 			t = a->sym->type;
 			t = a->sym->type;
 			if(t == 0 || t == SXREF) {
 			if(t == 0 || t == SXREF) {
-				diag("undefined external: %s in %s\n",
+				diag("undefined external: %s in %s",
 					a->sym->name, TNAME);
 					a->sym->name, TNAME);
 				a->sym->type = SDATA;
 				a->sym->type = SDATA;
 			}
 			}
@@ -171,7 +171,7 @@ aclass(Adr *a)
 			s = a->sym;
 			s = a->sym;
 			t = s->type;
 			t = s->type;
 			if(t == 0 || t == SXREF) {
 			if(t == 0 || t == SXREF) {
-				diag("undefined external: %s in %s\n",
+				diag("undefined external: %s in %s",
 					s->name, TNAME);
 					s->name, TNAME);
 				s->type = SDATA;
 				s->type = SDATA;
 			}
 			}
@@ -202,7 +202,7 @@ aclass(Adr *a)
 			switch(t) {
 			switch(t) {
 			case 0:
 			case 0:
 			case SXREF:
 			case SXREF:
-				diag("undefined external: %s in %s\n",
+				diag("undefined external: %s in %s",
 					s->name, TNAME);
 					s->name, TNAME);
 				s->type = SDATA;
 				s->type = SDATA;
 				break;
 				break;
@@ -272,7 +272,7 @@ oplook(Prog *p)
 				p->optab = r;
 				p->optab = r;
 			return optab+r-1;
 			return optab+r-1;
 		}
 		}
-		diag("no combination %A %d %d %d\n%P\n",
+		diag("no combination %A %d %d %d\n%P",
 			p->as, a1, a2, a3, p);
 			p->as, a1, a2, a3, p);
 		return optab + opcross[repop[AMOVL]][C_REG][C_NONE][C_REG] - 1;
 		return optab + opcross[repop[AMOVL]][C_REG][C_NONE][C_REG] - 1;
 	}
 	}
@@ -287,7 +287,7 @@ oplook(Prog *p)
 				p->optab = (o-optab)+1;
 				p->optab = (o-optab)+1;
 			return o;
 			return o;
 		}
 		}
-	diag("illegal combination %A %d %d %d\n%P\n",
+	diag("illegal combination %A %d %d %d\n%P",
 		p->as, a1, a2, a3, p);
 		p->as, a1, a2, a3, p);
 	return o;
 	return o;
 }
 }
@@ -424,7 +424,7 @@ buildop(void)
 		switch(r)
 		switch(r)
 		{
 		{
 		default:
 		default:
-			diag("unknown op in build: %A\n", r);
+			diag("unknown op in build: %A", r);
 			errorexit();
 			errorexit();
 		case AMOVL:
 		case AMOVL:
 			buildrep(1, r);
 			buildrep(1, r);

+ 1 - 0
sys/src/cmd/acme/dat.h

@@ -198,6 +198,7 @@ int		textclickmatch(Text*, int, int, int, uint*);
 void		textclose(Text*);
 void		textclose(Text*);
 void		textcolumnate(Text*, Dirlist**, int);
 void		textcolumnate(Text*, Dirlist**, int);
 void		textcommit(Text*, int);
 void		textcommit(Text*, int);
+void		textconstrain(Text*, uint, uint, uint*, uint*);
 void		textdelete(Text*, uint, uint, int);
 void		textdelete(Text*, uint, uint, int);
 void		textdoubleclick(Text*, uint*, uint*);
 void		textdoubleclick(Text*, uint*, uint*);
 void		textfill(Text*);
 void		textfill(Text*);

+ 8 - 1
sys/src/cmd/acme/ecmd.c

@@ -111,6 +111,8 @@ cmdexec(Text *t, Cmd *cp)
 		if(cp->addr != nil)
 		if(cp->addr != nil)
 			dot = cmdaddress(cp->addr, dot, 0);
 			dot = cmdaddress(cp->addr, dot, 0);
 		for(cp = cp->cmd; cp; cp = cp->next){
 		for(cp = cp->cmd; cp; cp = cp->next){
+			if(dot.r.q1 > t->file->nc)
+				editerror("dot extends past end of buffer during { command");
 			t->q0 = dot.r.q0;
 			t->q0 = dot.r.q0;
 			t->q1 = dot.r.q1;
 			t->q1 = dot.r.q1;
 			cmdexec(t, cp);
 			cmdexec(t, cp);
@@ -207,6 +209,8 @@ int
 c_cmd(Text *t, Cmd *cp)
 c_cmd(Text *t, Cmd *cp)
 {
 {
 	elogreplace(t->file, addr.r.q0, addr.r.q1, cp->text->r, cp->text->n);
 	elogreplace(t->file, addr.r.q0, addr.r.q1, cp->text->r, cp->text->n);
+	t->q0 = addr.r.q0;
+	t->q1 = addr.r.q0+cp->text->n;
 	return TRUE;
 	return TRUE;
 }
 }
 
 
@@ -215,6 +219,8 @@ d_cmd(Text *t, Cmd*)
 {
 {
 	if(addr.r.q1 > addr.r.q0)
 	if(addr.r.q1 > addr.r.q0)
 		elogdelete(t->file, addr.r.q0, addr.r.q1);
 		elogdelete(t->file, addr.r.q0, addr.r.q1);
+	t->q0 = addr.r.q0;
+	t->q1 = addr.r.q0;
 	return TRUE;
 	return TRUE;
 }
 }
 
 
@@ -716,10 +722,11 @@ append(File *f, Cmd *cp, long p)
 {
 {
 	if(cp->text->n > 0)
 	if(cp->text->n > 0)
 		eloginsert(f, p, cp->text->r, cp->text->n);
 		eloginsert(f, p, cp->text->r, cp->text->n);
+	f->curtext->q0 = p;
+	f->curtext->q1 = p+cp->text->n;
 	return TRUE;
 	return TRUE;
 }
 }
 
 
-
 int
 int
 pdisplay(File *f)
 pdisplay(File *f)
 {
 {

+ 32 - 7
sys/src/cmd/acme/elog.c

@@ -218,7 +218,7 @@ elogapply(File *f)
 	Buflog b;
 	Buflog b;
 	Rune *buf;
 	Rune *buf;
 	uint i, n, up, mod;
 	uint i, n, up, mod;
-	uint q0, q1;
+	uint q0, q1, tq0, tq1;
 	Buffer *log;
 	Buffer *log;
 	Text *t;
 	Text *t;
 
 
@@ -236,6 +236,12 @@ elogapply(File *f)
 	 */
 	 */
 	q0 = t->q0;
 	q0 = t->q0;
 	q1 = t->q1;
 	q1 = t->q1;
+	/*
+	 * We constrain the addresses in here (with textconstrain()) because
+	 * overlapping changes will generate bogus addresses.   We will warn
+	 * about changes out of sequence but proceed anyway; here we must
+	 * keep things in range.
+	 */
 
 
 	while(log->nc > 0){
 	while(log->nc > 0){
 		up = log->nc-Buflogsize;
 		up = log->nc-Buflogsize;
@@ -251,14 +257,15 @@ elogapply(File *f)
 				mod = TRUE;
 				mod = TRUE;
 				filemark(f);
 				filemark(f);
 			}
 			}
-			textdelete(t, b.q0, b.q0+b.nd, TRUE);
+			textconstrain(t, b.q0, b.q0+b.nd, &tq0, &tq1);
+			textdelete(t, tq0, tq1, TRUE);
 			up -= b.nr;
 			up -= b.nr;
 			for(i=0; i<b.nr; i+=n){
 			for(i=0; i<b.nr; i+=n){
 				n = b.nr - i;
 				n = b.nr - i;
 				if(n > RBUFSIZE)
 				if(n > RBUFSIZE)
 					n = RBUFSIZE;
 					n = RBUFSIZE;
 				bufread(log, up+i, buf, n);
 				bufread(log, up+i, buf, n);
-				textinsert(t, b.q0+i, buf, n, TRUE);
+				textinsert(t, tq0+i, buf, n, TRUE);
 			}
 			}
 			break;
 			break;
 
 
@@ -267,7 +274,8 @@ elogapply(File *f)
 				mod = TRUE;
 				mod = TRUE;
 				filemark(f);
 				filemark(f);
 			}
 			}
-			textdelete(t, b.q0, b.q0+b.nd, TRUE);
+			textconstrain(t, b.q0, b.q0+b.nd, &tq0, &tq1);
+			textdelete(t, tq0, tq1, TRUE);
 			break;
 			break;
 
 
 		case Insert:
 		case Insert:
@@ -275,13 +283,14 @@ elogapply(File *f)
 				mod = TRUE;
 				mod = TRUE;
 				filemark(f);
 				filemark(f);
 			}
 			}
+			textconstrain(t, b.q0, b.q0, &tq0, &tq1);
 			up -= b.nr;
 			up -= b.nr;
 			for(i=0; i<b.nr; i+=n){
 			for(i=0; i<b.nr; i+=n){
 				n = b.nr - i;
 				n = b.nr - i;
 				if(n > RBUFSIZE)
 				if(n > RBUFSIZE)
 					n = RBUFSIZE;
 					n = RBUFSIZE;
 				bufread(log, up+i, buf, n);
 				bufread(log, up+i, buf, n);
-				textinsert(t, b.q0+i, buf, n, TRUE);
+				textinsert(t, tq0+i, buf, n, TRUE);
 			}
 			}
 			break;
 			break;
 
 
@@ -303,10 +312,26 @@ elogapply(File *f)
 		bufdelete(log, up, log->nc);
 		bufdelete(log, up, log->nc);
 	}
 	}
 	fbuffree(buf);
 	fbuffree(buf);
+	if(warned){
+		/*
+		 * Changes were out of order, so the q0 and q1
+		 * computed while generating those changes are not
+		 * to be trusted.
+		 */
+		q1 = min(q1, f->nc);
+		q0 = min(q0, q1);
+	}
 	elogterm(f);
 	elogterm(f);
 
 
+	/*
+	 * Bad addresses will cause bufload to crash, so double check.
+	 */
+	if(q0 > f->nc || q1 > f->nc || q0 > q1){
+		warning(nil, "elogapply: can't happen %d %d %d\n", q0, q1, f->nc);
+		q1 = min(q1, f->nc);
+		q0 = min(q0, q1);
+	}
+
 	t->q0 = q0;
 	t->q0 = q0;
 	t->q1 = q1;
 	t->q1 = q1;
-	if(t->q1 > f->nc)	/* can't happen */
-		t->q1 = f->nc;
 }
 }

+ 7 - 0
sys/src/cmd/acme/text.c

@@ -474,6 +474,13 @@ textdelete(Text *t, uint q0, uint q1, int tofile)
 	}
 	}
 }
 }
 
 
+void
+textconstrain(Text *t, uint q0, uint q1, uint *p0, uint *p1)
+{
+	*p0 = min(q0, t->file->nc);
+	*p1 = min(q1, t->file->nc);
+}
+
 Rune
 Rune
 textreadc(Text *t, uint q)
 textreadc(Text *t, uint q)
 {
 {

+ 1 - 10
sys/src/cmd/auth/authsrv.c

@@ -97,7 +97,7 @@ main(int argc, char *argv[])
 			break;
 			break;
 		default:
 		default:
 			syslog(0, AUTHLOG, "unknown ticket request type: %d", buf[0]);
 			syslog(0, AUTHLOG, "unknown ticket request type: %d", buf[0]);
-			break;
+			exits(0);
 		}
 		}
 	}
 	}
 	exits(0);
 	exits(0);
@@ -570,7 +570,6 @@ chap(Ticketreq *tr)
 	uchar digest[MD5dlen];
 	uchar digest[MD5dlen];
 	char chal[CHALLEN];
 	char chal[CHALLEN];
 	OChapreply reply;
 	OChapreply reply;
-	uchar md5buf[512];
 	int n;
 	int n;
 
 
 	/*
 	/*
@@ -604,14 +603,6 @@ chap(Ticketreq *tr)
 	md5((uchar*)secret, strlen(secret), 0, s);
 	md5((uchar*)secret, strlen(secret), 0, s);
 	md5((uchar*)chal, sizeof(chal), digest, s);
 	md5((uchar*)chal, sizeof(chal), digest, s);
 
 
-	md5buf[0] = reply.id;
-	n = 1;
-	memmove(md5buf+n, secret, strlen(secret));
-	n += strlen(secret);
-	memmove(md5buf+n, chal, sizeof(chal));
-	n += sizeof(chal);
-	md5(md5buf, n, digest, 0);
-
 	if(memcmp(digest, reply.resp, MD5dlen) != 0){
 	if(memcmp(digest, reply.resp, MD5dlen) != 0){
 		replyerror("chap-fail bad response %s", raddr);
 		replyerror("chap-fail bad response %s", raddr);
 		logfail(tr->uid);
 		logfail(tr->uid);

+ 1 - 0
sys/src/cmd/auth/lib/getexpiration.c

@@ -23,6 +23,7 @@ getdate(char *d)
 	date.mon = (d[0]-'0')*10 + d[1]-'0' - 1;
 	date.mon = (d[0]-'0')*10 + d[1]-'0' - 1;
 	d += 2;
 	d += 2;
 	date.mday = (d[0]-'0')*10 + d[1]-'0';
 	date.mday = (d[0]-'0')*10 + d[1]-'0';
+	date.yday = 0;
 	return date;
 	return date;
 }
 }
 
 

+ 96 - 10
sys/src/cmd/auth/login.c

@@ -76,32 +76,118 @@ setenv(char *var, char *val)
 	}
 	}
 }
 }
 
 
+/*
+ *  become the authenticated user
+ */
+void
+chuid(AuthInfo *ai)
+{
+	int rv, fd;
+
+	/* change uid */
+	fd = open("#¤/capuse", OWRITE);
+	if(fd < 0)
+		sysfatal("can't change uid: %r");
+	rv = write(fd, ai->cap, strlen(ai->cap));
+	close(fd);
+	if(rv < 0)
+		sysfatal("can't change uid: %r");
+}
+
+/*
+ *  mount a factotum
+ */
+void
+mountfactotum(char *srvname)
+{
+	int fd;
+
+	/* mount it */
+	fd = open(srvname, ORDWR);
+	if(fd < 0)
+		sysfatal("opening factotum: %r");
+	mount(fd, -1, "/mnt", MBEFORE, "");
+	close(fd);
+}
+
+/*
+ *  start a new factotum and pass it the username and password
+ */
+void
+startfactotum(char *user, char *password, char *srvname)
+{
+	int fd;
+
+	strcpy(srvname, "/srv/factotum.XXXXXXXXXXX");
+	mktemp(srvname);
+
+	switch(fork()){
+	case -1:
+		sysfatal("can't start factotum: %r");
+	case 0:
+		execl("/factotum", "loginfactotum", "-dns", srvname+5, 0);
+		sysfatal("starting factotum: %r");
+		break;
+	}
+
+	/* wait for agent to really be there */
+	while(access(srvname, 0) < 0)
+		sleep(250);
+
+	/* mount it */
+	mountfactotum(srvname);
+
+	/* write in new key */
+	fd = open("/mnt/factotum/ctl", ORDWR);
+	if(fd < 0)
+		sysfatal("opening factotum: %r");
+	fprint(fd, "key proto=p9sk1 dom=cs.bell-labs.com user=%q !password=%q", user, password);
+	close(fd);
+}
+
 void
 void
 main(int argc, char *argv[])
 main(int argc, char *argv[])
 {
 {
 	char pass[ANAMELEN];
 	char pass[ANAMELEN];
 	char buf[2*ANAMELEN];
 	char buf[2*ANAMELEN];
 	char home[2*ANAMELEN];
 	char home[2*ANAMELEN];
+	char srvname[2*ANAMELEN];
 	char *user, *sysname, *tz, *cputype, *service;
 	char *user, *sysname, *tz, *cputype, *service;
+	AuthInfo *ai;
+
+	ARGBEGIN{
+	}ARGEND;
 
 
 	rfork(RFENVG|RFNAMEG);
 	rfork(RFENVG|RFNAMEG);
 
 
 	service = getenv("service");
 	service = getenv("service");
-	if(strcmp(service, "cpu") == 0){
-		fprint(2, "not from a cpu server!\n");
-		exits("fail");
-	}
-	if(argc != 2){
+	if(strcmp(service, "cpu") == 0)
+		sysfatal("not from a cpu server!");
+	if(argc != 1){
 		fprint(2, "usage: login username\n");
 		fprint(2, "usage: login username\n");
 		exits("usage");
 		exits("usage");
 	}
 	}
-	user = argv[1];
+	user = argv[0];
 	memset(pass, 0, sizeof(pass));
 	memset(pass, 0, sizeof(pass));
 	readln("Password: ", pass, sizeof(pass), 1);
 	readln("Password: ", pass, sizeof(pass), 1);
-	if(login(argv[1], pass, nil) < 0){
-		fprint(2, "login failed: %r\n");
-		exits("fail");
-	}
+
+	/* authenticate */
+	ai = auth_userpasswd(user, pass);
+	if(ai == nil || ai->cap == nil)
+		sysfatal("login incorrect");
+
+	/* change uid */
+	chuid(ai);
+
+	/* start a new factotum and hand it a new key */
+	startfactotum(user, pass, srvname);
+
+	/* set up new namespace */
+	newns(ai->cuid, nil);
+	auth_freeAI(ai);
+
+	/* remount the factotum */
+	mountfactotum(srvname);
 
 
 	/* set up a new environment */
 	/* set up a new environment */
 	cputype = getenv("cputype");
 	cputype = getenv("cputype");

+ 0 - 4
sys/src/cmd/auth/secstore/aescbc.c

@@ -3,10 +3,6 @@
 	16byte initialization vector,
 	16byte initialization vector,
 	AES-CBC(key, random | file),
 	AES-CBC(key, random | file),
     HMAC_SHA1(md5(key), AES-CBC(random | file))
     HMAC_SHA1(md5(key), AES-CBC(random | file))
-
-With CBC, if the first plaintext block is 0, the first ciphertext block is E(IV).
-Using the overflow technique adopted for compatibility with cryptolib makes the
-last cipertext block decryptable.  Hence the random prefix to file.
 */
 */
 #include <u.h>
 #include <u.h>
 #include <libc.h>
 #include <libc.h>

Some files were not shown because too many files changed in this diff