Browse Source

Plan 9 from Bell Labs 2008-03-20

David du Colombier 13 years ago
parent
commit
837e72a82e

+ 15 - 9
dist/replica/_plan9.db

@@ -320,6 +320,7 @@
 386/bin/ip/tftpd - 775 sys sys 1204292520 131963
 386/bin/ip/traceroute - 775 sys sys 1198211710 72783
 386/bin/ip/udpecho - 775 sys sys 1178508500 43095
+386/bin/ip/wol - 775 sys sys 1205983484 47866
 386/bin/join - 775 sys sys 1168402330 114382
 386/bin/jpg - 775 sys sys 1179372097 174971
 386/bin/kbmap - 775 sys sys 1197732770 144079
@@ -5845,7 +5846,7 @@ sys/games - 20000000775 sys sys 1117225532 0
 sys/games/lib - 20000000775 sys sys 1165337608 0
 sys/games/lib/4scores - 10000000666 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000666 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1203873355 268816
+sys/games/lib/fortunes - 664 sys sys 1205934831 268872
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -7430,7 +7431,7 @@ sys/man/1/leak - 664 sys sys 1196638935 4373
 sys/man/1/lens - 664 sys sys 1196638932 1272
 sys/man/1/lex - 664 sys sys 1196638932 1520
 sys/man/1/look - 664 sys sys 1196638932 1357
-sys/man/1/lp - 664 sys sys 1196638935 3329
+sys/man/1/lp - 664 sys sys 1205952886 3350
 sys/man/1/ls - 664 sys sys 1196638932 2890
 sys/man/1/mail - 664 sys sys 1196638935 2158
 sys/man/1/man - 664 sys sys 1196638932 2006
@@ -7452,7 +7453,7 @@ sys/man/1/ns - 664 sys sys 1196638935 895
 sys/man/1/p - 664 sys sys 1196638933 504
 sys/man/1/page - 664 sys sys 1196638935 5839
 sys/man/1/passwd - 664 sys sys 1201730866 1591
-sys/man/1/patch - 664 sys sys 1196638936 2588
+sys/man/1/patch - 664 sys sys 1205952914 3356
 sys/man/1/pcc - 664 sys sys 1196638933 3478
 sys/man/1/pic - 664 sys sys 1196638933 8229
 sys/man/1/pipefile - 664 sys sys 1196638936 1861
@@ -7754,7 +7755,7 @@ sys/man/4/snap - 664 sys sys 1196638944 1908
 sys/man/4/srv - 664 sys sys 1196638944 4970
 sys/man/4/tapefs - 664 sys sys 1196638944 1861
 sys/man/4/telco - 664 sys sys 1196638944 4359
-sys/man/4/u9fs - 664 sys sys 1196638944 4748
+sys/man/4/u9fs - 664 sys sys 1205964618 5225
 sys/man/4/upasfs - 664 sys sys 1196638944 6212
 sys/man/4/usb - 664 sys sys 1203552814 5677
 sys/man/4/usbd - 664 sys sys 1202846392 1035
@@ -7805,6 +7806,7 @@ sys/man/6/regexp - 664 sys sys 1196638945 2050
 sys/man/6/rewrite - 664 sys sys 1196638945 3235
 sys/man/6/smtpd - 664 sys sys 1196638945 8178
 sys/man/6/snap - 664 sys sys 1196638945 2402
+sys/man/6/style - 664 sys sys 1205985568 2659
 sys/man/6/thumbprint - 664 sys sys 1196638945 1124
 sys/man/6/users - 664 sys sys 1196638945 1392
 sys/man/6/utf - 664 sys sys 1196638945 2430
@@ -7850,11 +7852,11 @@ sys/man/8/getflags - 664 sys sys 1196638947 1713
 sys/man/8/gpsfs - 664 sys sys 1196638947 4918
 sys/man/8/httpd - 664 sys sys 1196638947 6866
 sys/man/8/init - 664 sys sys 1196638947 1430
-sys/man/8/ipconfig - 664 sys sys 1204424262 8203
+sys/man/8/ipconfig - 664 sys sys 1205960389 8284
 sys/man/8/ipserv - 664 sys sys 1202161489 3268
 sys/man/8/kfscmd - 664 sys sys 1196638947 4514
 sys/man/8/listen - 664 sys sys 1205796105 4090
-sys/man/8/lp - 664 sys sys 1196638947 2491
+sys/man/8/lp - 664 sys sys 1205960257 2490
 sys/man/8/mk9660 - 664 sys sys 1196638947 3946
 sys/man/8/mkfs - 664 sys sys 1196638947 3427
 sys/man/8/mkpaqfs - 664 sys sys 1196638947 890
@@ -7897,6 +7899,7 @@ sys/man/8/venti - 664 sys sys 1197570117 12190
 sys/man/8/venti-backup - 664 sys sys 1202925137 2290
 sys/man/8/venti-fmt - 664 sys sys 1196638948 8626
 sys/man/8/vga - 664 sys sys 1196638948 4129
+sys/man/8/wol - 664 sys sys 1205960109 743
 sys/man/fonts - 664 sys sys 1196638948 218
 sys/man/index.html - 664 sys sys 1196638948 1859
 sys/man/mkfile - 664 sys sys 1196638948 2264
@@ -12547,7 +12550,7 @@ sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1204591120 575
 sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1184880751 1046
 sys/src/cmd/ip/linklocal.c - 664 sys sys 1197673397 1751
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
-sys/src/cmd/ip/mkfile - 664 sys sys 1185920805 1267
+sys/src/cmd/ip/mkfile - 664 sys sys 1205960050 1273
 sys/src/cmd/ip/ping.c - 664 sys sys 1198188930 10554
 sys/src/cmd/ip/ppp - 20000000775 sys sys 1065963823 0
 sys/src/cmd/ip/ppp/block.c - 664 sys sys 1015090266 5353
@@ -12621,6 +12624,7 @@ sys/src/cmd/ip/telnetd.c - 664 sys sys 1135487948 11772
 sys/src/cmd/ip/tftpd.c - 664 sys sys 1106943821 7646
 sys/src/cmd/ip/traceroute.c - 664 sys sys 1198186109 8747
 sys/src/cmd/ip/udpecho.c - 664 sys sys 1178483004 789
+sys/src/cmd/ip/wol.c - 664 sys sys 1205960041 1615
 sys/src/cmd/join.c - 664 sys sys 1158251357 7550
 sys/src/cmd/jpg - 20000000775 sys sys 1132458749 0
 sys/src/cmd/jpg/bmp.c - 664 sys sys 1108852826 4222
@@ -14110,7 +14114,7 @@ sys/src/cmd/unix/u9fs/fcallconv.c - 664 sys sys 1043768485 5467
 sys/src/cmd/unix/u9fs/makefile - 664 sys sys 1048969298 1064
 sys/src/cmd/unix/u9fs/oldfcall.c - 664 sys sys 1015092352 7595
 sys/src/cmd/unix/u9fs/oldfcall.h - 664 sys sys 1015092352 914
-sys/src/cmd/unix/u9fs/plan9.h - 664 sys sys 1095185027 5748
+sys/src/cmd/unix/u9fs/plan9.h - 664 sys sys 1205963190 5772
 sys/src/cmd/unix/u9fs/print.c - 664 sys sys 1095185028 1329
 sys/src/cmd/unix/u9fs/random.c - 664 sys sys 1015092352 812
 sys/src/cmd/unix/u9fs/readn.c - 664 sys sys 1015092353 220
@@ -14120,7 +14124,7 @@ sys/src/cmd/unix/u9fs/safecpy.c - 664 sys sys 1043768486 212
 sys/src/cmd/unix/u9fs/strecpy.c - 664 sys sys 1015092353 193
 sys/src/cmd/unix/u9fs/sun-inttypes.h - 664 sys sys 1039110816 441
 sys/src/cmd/unix/u9fs/tokenize.c - 664 sys sys 1015092353 602
-sys/src/cmd/unix/u9fs/u9fs.c - 664 sys sys 1095185027 30960
+sys/src/cmd/unix/u9fs/u9fs.c - 664 sys sys 1205963230 31901
 sys/src/cmd/unix/u9fs/u9fs.h - 664 sys sys 1043768488 649
 sys/src/cmd/unix/u9fs/u9fsauth.h - 664 sys sys 1015092354 126
 sys/src/cmd/unix/u9fs/utfrune.c - 664 sys sys 1015092354 387
@@ -15869,3 +15873,5 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+sys/src/9/pc/sdata.c - 664 sys sys 1205986828 53185
+sys/src/cmd/ndb/query.c - 664 sys sys 1205986702 1913

+ 15 - 11
dist/replica/plan9.db

@@ -320,6 +320,7 @@
 386/bin/ip/tftpd - 775 sys sys 1204292520 131963
 386/bin/ip/traceroute - 775 sys sys 1198211710 72783
 386/bin/ip/udpecho - 775 sys sys 1178508500 43095
+386/bin/ip/wol - 775 sys sys 1205983484 47866
 386/bin/join - 775 sys sys 1168402330 114382
 386/bin/jpg - 775 sys sys 1179372097 174971
 386/bin/kbmap - 775 sys sys 1197732770 144079
@@ -5845,7 +5846,7 @@ sys/games - 20000000775 sys sys 1117225532 0
 sys/games/lib - 20000000775 sys sys 1165337608 0
 sys/games/lib/4scores - 10000000666 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000666 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1203873355 268816
+sys/games/lib/fortunes - 664 sys sys 1205934831 268872
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -7430,7 +7431,7 @@ sys/man/1/leak - 664 sys sys 1196638935 4373
 sys/man/1/lens - 664 sys sys 1196638932 1272
 sys/man/1/lex - 664 sys sys 1196638932 1520
 sys/man/1/look - 664 sys sys 1196638932 1357
-sys/man/1/lp - 664 sys sys 1196638935 3329
+sys/man/1/lp - 664 sys sys 1205952886 3350
 sys/man/1/ls - 664 sys sys 1196638932 2890
 sys/man/1/mail - 664 sys sys 1196638935 2158
 sys/man/1/man - 664 sys sys 1196638932 2006
@@ -7452,7 +7453,7 @@ sys/man/1/ns - 664 sys sys 1196638935 895
 sys/man/1/p - 664 sys sys 1196638933 504
 sys/man/1/page - 664 sys sys 1196638935 5839
 sys/man/1/passwd - 664 sys sys 1201730866 1591
-sys/man/1/patch - 664 sys sys 1196638936 2588
+sys/man/1/patch - 664 sys sys 1205952914 3356
 sys/man/1/pcc - 664 sys sys 1196638933 3478
 sys/man/1/pic - 664 sys sys 1196638933 8229
 sys/man/1/pipefile - 664 sys sys 1196638936 1861
@@ -7754,7 +7755,7 @@ sys/man/4/snap - 664 sys sys 1196638944 1908
 sys/man/4/srv - 664 sys sys 1196638944 4970
 sys/man/4/tapefs - 664 sys sys 1196638944 1861
 sys/man/4/telco - 664 sys sys 1196638944 4359
-sys/man/4/u9fs - 664 sys sys 1196638944 4748
+sys/man/4/u9fs - 664 sys sys 1205964618 5225
 sys/man/4/upasfs - 664 sys sys 1196638944 6212
 sys/man/4/usb - 664 sys sys 1203552814 5677
 sys/man/4/usbd - 664 sys sys 1202846392 1035
@@ -7805,6 +7806,7 @@ sys/man/6/regexp - 664 sys sys 1196638945 2050
 sys/man/6/rewrite - 664 sys sys 1196638945 3235
 sys/man/6/smtpd - 664 sys sys 1196638945 8178
 sys/man/6/snap - 664 sys sys 1196638945 2402
+sys/man/6/style - 664 sys sys 1205985568 2659
 sys/man/6/thumbprint - 664 sys sys 1196638945 1124
 sys/man/6/users - 664 sys sys 1196638945 1392
 sys/man/6/utf - 664 sys sys 1196638945 2430
@@ -7850,11 +7852,11 @@ sys/man/8/getflags - 664 sys sys 1196638947 1713
 sys/man/8/gpsfs - 664 sys sys 1196638947 4918
 sys/man/8/httpd - 664 sys sys 1196638947 6866
 sys/man/8/init - 664 sys sys 1196638947 1430
-sys/man/8/ipconfig - 664 sys sys 1204424262 8203
+sys/man/8/ipconfig - 664 sys sys 1205960389 8284
 sys/man/8/ipserv - 664 sys sys 1202161489 3268
 sys/man/8/kfscmd - 664 sys sys 1196638947 4514
 sys/man/8/listen - 664 sys sys 1205796105 4090
-sys/man/8/lp - 664 sys sys 1196638947 2491
+sys/man/8/lp - 664 sys sys 1205960257 2490
 sys/man/8/mk9660 - 664 sys sys 1196638947 3946
 sys/man/8/mkfs - 664 sys sys 1196638947 3427
 sys/man/8/mkpaqfs - 664 sys sys 1196638947 890
@@ -7897,6 +7899,7 @@ sys/man/8/venti - 664 sys sys 1197570117 12190
 sys/man/8/venti-backup - 664 sys sys 1202925137 2290
 sys/man/8/venti-fmt - 664 sys sys 1196638948 8626
 sys/man/8/vga - 664 sys sys 1196638948 4129
+sys/man/8/wol - 664 sys sys 1205960109 743
 sys/man/fonts - 664 sys sys 1196638948 218
 sys/man/index.html - 664 sys sys 1196638948 1859
 sys/man/mkfile - 664 sys sys 1196638948 2264
@@ -8175,7 +8178,7 @@ sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1170456695 55276
 sys/src/9/pc/sd53c8xx.i - 664 sys sys 1128547230 28453
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sdata.c - 664 sys sys 1202251523 53036
+sys/src/9/pc/sdata.c - 664 sys sys 1205986828 53185
 sys/src/9/pc/sdiahci.c - 664 sys sys 1200348596 38496
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1204232564 34031
 sys/src/9/pc/sdmylex.c - 664 sys sys 1189229947 28395
@@ -12547,7 +12550,7 @@ sys/src/cmd/ip/ipconfig/mkfile - 664 sys sys 1204591120 575
 sys/src/cmd/ip/ipconfig/ppp.c - 664 sys sys 1184880751 1046
 sys/src/cmd/ip/linklocal.c - 664 sys sys 1197673397 1751
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
-sys/src/cmd/ip/mkfile - 664 sys sys 1185920805 1267
+sys/src/cmd/ip/mkfile - 664 sys sys 1205960050 1273
 sys/src/cmd/ip/ping.c - 664 sys sys 1198188930 10554
 sys/src/cmd/ip/ppp - 20000000775 sys sys 1065963823 0
 sys/src/cmd/ip/ppp/block.c - 664 sys sys 1015090266 5353
@@ -12621,6 +12624,7 @@ sys/src/cmd/ip/telnetd.c - 664 sys sys 1135487948 11772
 sys/src/cmd/ip/tftpd.c - 664 sys sys 1106943821 7646
 sys/src/cmd/ip/traceroute.c - 664 sys sys 1198186109 8747
 sys/src/cmd/ip/udpecho.c - 664 sys sys 1178483004 789
+sys/src/cmd/ip/wol.c - 664 sys sys 1205960041 1615
 sys/src/cmd/join.c - 664 sys sys 1158251357 7550
 sys/src/cmd/jpg - 20000000775 sys sys 1132458749 0
 sys/src/cmd/jpg/bmp.c - 664 sys sys 1108852826 4222
@@ -12844,7 +12848,7 @@ sys/src/cmd/ndb/mkdb.c - 664 sys sys 957402054 2886
 sys/src/cmd/ndb/mkfile - 664 sys sys 1205354106 2000
 sys/src/cmd/ndb/mkhash.c - 664 sys sys 1014926160 2899
 sys/src/cmd/ndb/mkhosts.c - 664 sys sys 957402054 4294
-sys/src/cmd/ndb/query.c - 664 sys sys 1188422202 1793
+sys/src/cmd/ndb/query.c - 664 sys sys 1205986702 1913
 sys/src/cmd/netstat.c - 664 sys sys 1128255434 4086
 sys/src/cmd/news.c - 664 sys sys 1014926614 3778
 sys/src/cmd/nfs.c - 664 sys sys 1050068720 31096
@@ -14110,7 +14114,7 @@ sys/src/cmd/unix/u9fs/fcallconv.c - 664 sys sys 1043768485 5467
 sys/src/cmd/unix/u9fs/makefile - 664 sys sys 1048969298 1064
 sys/src/cmd/unix/u9fs/oldfcall.c - 664 sys sys 1015092352 7595
 sys/src/cmd/unix/u9fs/oldfcall.h - 664 sys sys 1015092352 914
-sys/src/cmd/unix/u9fs/plan9.h - 664 sys sys 1095185027 5748
+sys/src/cmd/unix/u9fs/plan9.h - 664 sys sys 1205963190 5772
 sys/src/cmd/unix/u9fs/print.c - 664 sys sys 1095185028 1329
 sys/src/cmd/unix/u9fs/random.c - 664 sys sys 1015092352 812
 sys/src/cmd/unix/u9fs/readn.c - 664 sys sys 1015092353 220
@@ -14120,7 +14124,7 @@ sys/src/cmd/unix/u9fs/safecpy.c - 664 sys sys 1043768486 212
 sys/src/cmd/unix/u9fs/strecpy.c - 664 sys sys 1015092353 193
 sys/src/cmd/unix/u9fs/sun-inttypes.h - 664 sys sys 1039110816 441
 sys/src/cmd/unix/u9fs/tokenize.c - 664 sys sys 1015092353 602
-sys/src/cmd/unix/u9fs/u9fs.c - 664 sys sys 1095185027 30960
+sys/src/cmd/unix/u9fs/u9fs.c - 664 sys sys 1205963230 31901
 sys/src/cmd/unix/u9fs/u9fs.h - 664 sys sys 1043768488 649
 sys/src/cmd/unix/u9fs/u9fsauth.h - 664 sys sys 1015092354 126
 sys/src/cmd/unix/u9fs/utfrune.c - 664 sys sys 1015092354 387

+ 16 - 0
dist/replica/plan9.log

@@ -18811,3 +18811,19 @@
 1205857803 1 c sys/man/4/usbdisk - 664 sys sys 1205857582 3044
 1205874004 0 c sys/src/cmd/stats.c - 664 sys sys 1205873637 28451
 1205897405 0 c 386/bin/stats - 775 sys sys 1205897310 191360
+1205935204 0 c sys/games/lib/fortunes - 664 sys sys 1205934831 268872
+1205953204 0 c sys/man/1/lp - 664 sys sys 1205952886 3350
+1205953204 1 c sys/man/1/patch - 664 sys sys 1205952914 3356
+1205953204 2 a sys/man/6/style - 664 sys sys 1205952863 2619
+1205960405 0 c sys/man/8/ipconfig - 664 sys sys 1205960389 8284
+1205960405 1 c sys/man/8/lp - 664 sys sys 1205960257 2490
+1205960405 2 a sys/man/8/wol - 664 sys sys 1205960109 743
+1205960405 3 c sys/src/cmd/ip/mkfile - 664 sys sys 1205960050 1273
+1205960405 4 a sys/src/cmd/ip/wol.c - 664 sys sys 1205960041 1615
+1205964004 0 c sys/src/cmd/unix/u9fs/plan9.h - 664 sys sys 1205963190 5772
+1205964004 1 c sys/src/cmd/unix/u9fs/u9fs.c - 664 sys sys 1205963230 31901
+1205965804 0 c sys/man/4/u9fs - 664 sys sys 1205964618 5225
+1205983805 0 a 386/bin/ip/wol - 775 sys sys 1205983484 47866
+1205985604 0 c sys/man/6/style - 664 sys sys 1205985568 2659
+1205987404 0 c sys/src/9/pc/sdata.c - 664 sys sys 1205986828 53185
+1205987404 1 c sys/src/cmd/ndb/query.c - 664 sys sys 1205986702 1913

+ 1 - 0
sys/games/lib/fortunes

@@ -4216,3 +4216,4 @@ ADDITIONAL METAPHOR SPOILER ALERT: ``The Old Man and the Sea'' is not just about
 I claim that Mach people (and apparently FreeBSD) are incompetent idiots. Playing games with VM is bad. memory copies are _also_ bad, but quite frankly, memory copies often have _less_ downside than VM games, and bigger caches will only continue to drive that point home. - Linus Torvalds on vmsplice() versus COW
 Nothing is more hateful to wisdom than excessive cleverness - Seneca (according to Poe)
 Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. - Antoine de Saint-Exupery
+  bucket = Buckets + pe; /* bucket = &(Buckets[pe]); */

+ 8 - 6
sys/man/1/lp

@@ -15,7 +15,7 @@ is a generalized output printing service.
 It can be used to queue files for printing,
 check a queue, or kill jobs in a queue.
 The options are:
-.TF -p\ \fIproc\fP
+.TF -d\ \fIde\fP
 .TP
 .BI -d " dest"
 Select the destination printer.
@@ -60,7 +60,7 @@ entry in
 .LR /sys/lib/lp/devices .
 .TP
 .B -k
-Kill the job(s) given as subsequent arguments instead of file names
+Kill the job(s) given as subsequent arguments, instead of file names,
 for the given destination.
 .TP
 .BI -p " proc"
@@ -88,7 +88,7 @@ before running this command.
 .PP
 The remaining options may be used to affect the output at a given device.
 These options may not be applicable to all devices.
-.TF "-p\ \fIproc\fP"
+.TF "-p\ \fIpr\fP"
 .TP
 .BI -c " n"
 Print
@@ -106,11 +106,11 @@ Suppress printing of header page.
 Select paper input tray.
 .I n
 may be a number 0-9, the word
-.I man
+.L man
 for the manual feed slot, and/or
-.I simplex
+.L simplex
 or
-.I duplex
+.L duplex
 to get single or double sided output.
 Multiple input tray options may be specified if they are
 separated by commas.
@@ -176,7 +176,9 @@ Print a file in a small font at 100 lines per page.
 lp -dstdout /dev/windows/3/window > doc.ps
 Convert an image to a postscript file.
 .SH SOURCE
+.nf
 .B /rc/bin/lp
+.B /sys/src/cmd/lp
 .SH SEE ALSO
 .IR lp (8)
 .br

+ 32 - 4
sys/man/1/patch

@@ -47,12 +47,31 @@ a description of the patch from standard input:
 please provide an explanation of what the change is supposed to do,
 some context, and a rationale for the change.
 Test data or pointers to same to verify that the fix works are also welcome.
+When sending a patch, follow these guidelines:
+.IP • 3
+If this is a bug fix, explain the bug clearly.
+Don't assume the bug is obvious from the fix.
+.IP •
+If this is a new feature, explain it clearly.
+Don't assume it is obvious from the change.
+.IP •
+Make the new code look as much like the old code as possible:
+don't make gratuitous changes, and do follow the style of the old code.
+See
+.IR style (6)
+for the canonical Plan 9 coding style.
+.IP •
+If your patch changes externally-visible behaviour,
+update the manual page.
+.PP
 The
 .I email
 address, if not
 .LR - ,
-will be sent notification messages when the patch is applied
+will be sent notification messages when the patch is applied, rejected,
 or commented on.
+If rejected, the e-mail will contain a note explaining why and
+probably listing suggested changes and encouraging you to resubmit.
 .PP
 .I Patch/list
 displays information about the named patches,
@@ -64,8 +83,9 @@ source files and the patched source files.
 .PP
 .I Patch/apply
 applies the patch to the current source tree.
-It is intended to be run by the Plan 9 developers 
-with emelie as their root file system.
+It is intended to be run by the Plan 9 developers  with
+.B yoshimi
+as their root file system.
 If the source has changed since the patch was
 created,
 .I apply
@@ -84,10 +104,10 @@ being replaced is not byte-identical to the one
 created by 
 .I patch/apply.
 .SH EXAMPLES
-.PP
 Propose a change to
 .IR pwd ,
 which you have modified locally:
+.IP
 .EX
 % patch/create pwd-errors user@host.dom /sys/src/cmd/pwd.c
 Fix pwd to print errors to fd 2 rather than 1.
@@ -96,23 +116,29 @@ Fix pwd to print errors to fd 2 rather than 1.
 .EE
 .PP
 Then the developers at Bell Labs run
+.IP
 .EX
 patch/diff pwd-errors
 .EE
+.PP
 to inspect the change (possibly viewing
 .B /n/sources/patch/pwd-errors/pwd.c
 to see the larger context).
 To make the change, they run
+.IP
 .EX
 patch/apply pwd-errors
 .EE
+.LP
 Otherwise they run
+.IP
 .EX
 % patch/note pwd-errors
 Pwd should definitely print errors to fd 1 because ...
 ^D
 % 
 .EE
+.PP
 to add a note to the 
 .B /n/sources/pwd-errors/notes
 file.
@@ -122,3 +148,5 @@ file.
 .B /rc/bin/patch
 .SH SEE ALSO
 .IR diff (1)
+.br
+.B http://plan9.bell-labs.com/wiki/plan9/How_to_contribute

+ 52 - 24
sys/man/4/u9fs

@@ -30,7 +30,7 @@ u9fs \- serve 9P from Unix
 .I U9fs
 is
 .I not
-a Plan 9 program.  Instead it is a program that 
+a Plan 9 program.  Instead it is a program that
 serves Unix files to Plan 9 machines using the 9P protocol
 (see
 .IR intro (5)).
@@ -44,26 +44,32 @@ It typically runs as user
 and multiplexes access to multiple Plan 9 clients over the single wire.
 It assumes Plan 9 uids match Unix login names,
 and changes to the corresponding Unix effective uid when processing requests.
+Characters in file and directory names unacceptable to Plan 9 are translated
+into a three-character sequence:
+.L \e
+followed by two hexadecimal digits.
 .I U9fs
 serves both 9P1 (the 9P protocol as used by
 the second and third editions of Plan 9) and 9P2000.
 .PP
 The options are:
+.TF "\f(CW-A \fIautharg"
+.PD
 .TP
 .B -D
-Write very chatty debugging output to the log file (see 
-.B -l 
+Write very chatty debugging output to the log file (see
+.B -l
 option below).
 .TP
 .B -n
-Signals that 
+Signals that
 .I u9fs
-is 
+is
 .I not
 being invoked with a network connection
 on standard input and output, and thus should
 not try to determine the remote address of the connection.
-This is useful when 
+This is useful when
 .I u9fs
 is not invoked from
 .I inetd
@@ -71,7 +77,7 @@ is not invoked from
 .TP
 .B -z
 Truncate the log file on startup.  This is useful mainly when debugging
-with 
+with
 .BR -D .
 .TP
 .BI -a " authtype
@@ -85,26 +91,27 @@ or
 The default is
 .BR rhosts ,
 which uses the
-.I ruserok 
+.I ruserok
 library call to authenticate users by entries in
 .B /etc/hosts.equiv
 or
 .BR $HOME/.rhosts .
 This default is discouraged for all but the most controlled networks.
-Specifying 
+Specifying
 .B none
 turns off authentication altogether.
-This is useful when 
+This is useful when
 .I u9fs
 is not invoked from
 .I inetd
 (see examples below, or
 .I srvssh
-in .IR srv (4)).
+in
+.IR srv (4)).
 Specifying
 .B p9any
 uses the fourth edition Plan 9 authentication mechanisms.
-The file 
+The file
 .BR /etc/u9fs.key ,
 or
 .I autharg
@@ -112,10 +119,27 @@ if specified
 (see the
 .B -A
 option),
-is consulted for the authentication data.
-The file must contain exactly three lines:
-the plaintext password, the user id, and
-the authentication domain.
+is consulted for the authentication data
+and should be suitably protected.
+This file must contain exactly three lines:
+.I secret
+(plaintext password),
+.I u9fs-user
+(user id),
+and
+.I plan9-auth.dom
+(authentication domain).
+.RS
+.LP
+Finally,
+.I factotum
+must be taught a key of the form:
+.LP
+.EX
+.B
+key proto=p9sk1 dom=\fIplan9-auth.dom\fP user=\fIu9fs-user\fP !password=\fIsecret\fP
+.EE
+.RE
 .TP
 .BI -A " autharg
 Used to specify an argument to the authentication method.
@@ -128,20 +152,19 @@ The out-of-the-box compile-time default is
 .BR /tmp/u9fs.log .
 .TP
 .BI -m " msize
-Set 
+Set
 .I msize
 for 9P2000
 (see
 .IR open (5)).
 .TP
 .BI -u " user
-Treat all attaches as coming from 
+Treat all attaches as coming from
 .IR user .
 This is useful in some cases when running without
 .IR inetd ;
 see the examples.
-.SH
-EXAMPLES
+.SH EXAMPLES
 .PP
 Plan 9 calls 9P file service
 .B 9fs
@@ -224,14 +247,19 @@ On systems where listeners cannot be started,
 .IR execnet (4)
 is useful for running
 .I u9fs
-via mechanisms like
-.IR ssh .
+via other network mechanisms; the script
+.I srvssh
+in
+.IR srv (4)
+provides this for the
+.I ssh
+protocol.
 .SH SOURCE
 .B /sys/src/cmd/unix/u9fs
 .SH DIAGNOSTICS
 Problems are reported to the
 log file specified with the
-.B -l 
+.B -l
 option (default
 .BR /tmp/u9fs.log ).
 The
@@ -247,6 +275,6 @@ flag enables chatty debugging.
 The implementation of devices is unsatisfactory.
 .LP
 Semantics like remove-on-close or the
-atomicity of 
+atomicity of
 .B wstat
 are hard to provide exactly.

+ 96 - 0
sys/man/6/style

@@ -0,0 +1,96 @@
+.TH STYLE 6
+.SH NAME
+style \- Plan 9 coding conventions for C
+.SH DESCRIPTION
+Plan 9 C code has its own conventions.
+You would do well to follow them.
+Here are a few:
+.IP • 3
+don't use
+.L //
+comments; some old Plan 9 code does, but we're converting it as we touch it.
+We do sometimes use
+.L //
+to comment-out a few lines of code.
+.IP •
+avoid
+.BR goto s.
+.IP •
+no tabs expanded to spaces.
+.IP •
+surround a binary operator (particular a low precedence one) with spaces;
+don't try to write the most compact code possible
+but rather the most readable.
+.IP •
+no white space before opening braces.
+.IP •
+no white space after the keywords
+.LR if ,
+.LR for ,
+.LR while ,
+etc.
+.IP •
+no braces around single-line blocks (e.g.,
+.LR if ,
+.LR for ,
+and
+.L while
+bodies).
+.IP •
+integer-valued functions return -1 on error, 0 or positive on success.
+.IP •
+functions that return errors should set
+.IR errstr (2).
+.IP •
+variable and function names are all lowercase, with no underscores.
+.IP •
+.B enum
+or
+.BR #define d
+constants should be Uppercase (or UPPERCASE).
+.IP •
+.B struct
+tags are Uppercase, with matching
+.BR typedef s.
+.IP •
+automatic variables (local variables inside a function) are
+never initialized at declaration.
+.IP •
+follow the standard idioms: use
+.L "x < 0"
+not
+.LR "0 > x" ,
+etc.
+.PP
+Ultimately, the goal is to write code that fits in with the other code
+around it and the system as a whole.  If the file you are editing
+already deviates from these guidelines, do what it does.  After you
+edit a file, a reader should not be able to tell just from coding
+style which parts you worked on.
+.SS COMMENTS
+If your code is readable, you shouldn't need many comments.  A line or
+two comment above a function explaining what it does is always welcome.
+.PP
+Comment any code you find yourself wondering about for more than 2
+seconds, even if it's to say that you don't understand what's going
+on.  Explain why.
+.PP
+Don't use commenting as an excuse for writing confusing code.  Rewrite
+the code to make it clear.
+.SS EFFICIENCY
+Do the simple thing.  Don't optimize unless you've measured the code
+and it is too slow.  Fix the data structures and the algorithms
+instead of going for little 5% tunings.
+.SH SEE ALSO
+``Notes on Programming in C'', Rob Pike,
+.br
+.B http://www.literateprogramming.com/pikestyle.pdf
+.SH BUGS
+Some programs use very different styles, for example,
+.IR rc .
+.PP
+Some programs and programmers diverge from the above rules due to
+habits formed long before these rules.
+Notably, some programs have a single space after a keyword and
+before an opening brace,
+and some initialize automatic variables at declaration.

+ 4 - 0
sys/man/8/ipconfig

@@ -82,6 +82,7 @@ may be
 .BR ether ,
 .BR gbe ,
 .BR ppp ,
+.BR pkt ,
 or
 .BR loopback .
 The
@@ -89,6 +90,9 @@ The
 type is equivalent to
 .B ether
 except that it allows jumbo packets (up to ~9KB).
+The
+.B pkt
+interface passes all IP packets to and from a user program.
 For
 .B ppp
 the device can be any byte stream device.

+ 1 - 1
sys/man/8/lp

@@ -21,7 +21,7 @@ The list of processors follows;
 after each description is a bracketed list of
 .I lp
 options to which the processor responds:
-.TF \fIp9bitpost\fP
+.TF \fIp9bitpos\fP
 .TP
 .I dpost
 converts

+ 42 - 0
sys/man/8/wol

@@ -0,0 +1,42 @@
+.TH WOL 8
+.SH NAME
+wol \- send wake-on-lan Ethernet packet
+.SH SYNOPSIS
+.B ip/wol
+[
+.B -v
+] [
+.B -a
+.I dialstr
+] [
+.B -c
+.I password
+]
+.I macaddr
+.SH DESCRIPTION
+.I Wol
+sends a magic wake-on-lan Ethernet packet to
+.IR dialstr
+(default
+.BR udp!255.255.255.255!0 ,
+the IPv4 broadcast address),
+intended to wake up the machine with an Ethernet interface with the MAC
+address
+.IR macaddr .
+.I Macaddr
+is not used to route the packet, but is inserted into the magic packet
+as required by the wake-on-lan protocol.
+.PP
+An optional
+.I password
+of at most six bytes can be sent.
+The option
+.B -v
+prints verbose information about the packet sent.
+.SH "SEE ALSO"
+.IR dial (2),
+.I parseether
+in
+.IR ip (2)
+.br
+.B http://en.wikipedia.org/wiki/Wake-on-LAN

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

@@ -1955,6 +1955,9 @@ atapnp(void)
 			r = pcicfgr8(p, 0x46);
 			pcicfgw8(p, 0x46, (r & 0x0C)|0xF0);
 			/*FALLTHROUGH*/
+		case (0x7401<<16)|0x1022:	/* AMD 755 Cobra */
+		case (0x7409<<16)|0x1022:	/* AMD 756 Viper */
+		case (0x7410<<16)|0x1022:	/* AMD 766 Viper Plus */
 		case (0x7469<<16)|0x1022:	/* AMD 3111 */
 			/*
 			 * This can probably be lumped in with the 768 above.

+ 1 - 0
sys/src/cmd/ip/mkfile

@@ -20,6 +20,7 @@ TARG = 	6in4\
 	tftpd\
 	traceroute\
 	udpecho\
+	wol\
 
 DIRS=ftpfs dhcpd httpd ipconfig ppp imap4d snoopy
 

+ 101 - 0
sys/src/cmd/ip/wol.c

@@ -0,0 +1,101 @@
+/* send wake-on-lan magic ethernet packet */
+#include <u.h>
+#include <libc.h>
+#include <ip.h>
+
+enum {
+	Eaddrlen = 6,	/* 48 bits */
+};
+
+typedef struct Wolpack Wolpack;
+struct Wolpack{
+	uchar	magic[6];
+	uchar	macs[16][Eaddrlen];
+	char	pass[6+1];
+};
+
+int verbose;
+
+void
+usage(void)
+{
+	fprint(2, "usage: wol [-v] [-a dialstr] [-c password] macaddr\n");
+	exits("usage");
+}
+
+void
+fillmac(Wolpack *w, uchar *mac)
+{
+	int i;
+
+	for(i = 0; i < nelem(w->macs); i++)
+		memmove(w->macs[i], mac, Eaddrlen);
+}
+
+void
+dumppack(Wolpack *w)
+{
+	int i;
+
+	print("packet: [\n");
+	print("\t%E\n", w->magic);
+	for(i = 0; i < nelem(w->macs); i++)
+		print("\t%E\n", w->macs[i]);
+	print("\t%6s\n", w->pass);
+	print("]\n");
+}
+
+void
+main(int argc, char* argv[])
+{
+	int fd, nw;
+	char *argmac, *pass, *address;
+	uchar mac[Eaddrlen];
+	static Wolpack w = {
+		.magic { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }
+	};
+
+	address = pass = nil;
+	fmtinstall('E', eipfmt);
+
+	ARGBEGIN{
+	case 'a':
+		address = EARGF(usage());
+		break;
+	case 'c':
+		pass = EARGF(usage());
+		break;
+	case 'v':
+		verbose++;
+		break;
+	default:
+		usage();
+	}ARGEND
+
+	if(argc != 1)
+		usage();
+	argmac = argv[0];
+	if(verbose)
+		print("mac is %s, pass is %s\n", argmac, pass);
+
+	parseether(mac, argmac);
+	fillmac(&w, mac);
+	if(pass){
+		if(strlen(pass) > 6)
+			sysfatal("password greater than 6 bytes\n");
+		strcpy(w.pass, pass);
+	}
+	if(verbose)
+		dumppack(&w);
+
+	if(!address)
+		address = "udp!255.255.255.255!0";
+
+	fd = dial(address, nil, nil, nil);
+	if(fd < 0)
+		sysfatal("%s: %r", address);
+	nw = write(fd, &w, sizeof w);
+	if(nw != sizeof w)
+		sysfatal("error sending: %r");
+	exits(0);
+}

+ 10 - 7
sys/src/cmd/ndb/query.c

@@ -7,6 +7,7 @@
 #include <ndb.h>
 
 static int all, multiple;
+static Biobuf bout;
 
 void
 usage(void)
@@ -22,7 +23,7 @@ prmatch(Ndbtuple *nt, char *rattr)
 {
 	for(; nt; nt = nt->entry)
 		if (strcmp(nt->attr, rattr) == 0)
-			print("%s\n", nt->val);
+			Bprint(&bout, "%s\n", nt->val);
 }
 
 void
@@ -38,7 +39,7 @@ search(Ndb *db, char *attr, char *val, char *rattr)
 		if (multiple)
 			prmatch(t, rattr);
 		else if(p)
-			print("%s\n", p);
+			Bprint(&bout, "%s\n", p);
 		ndbfree(t);
 		free(p);
 		return;
@@ -57,8 +58,8 @@ search(Ndb *db, char *attr, char *val, char *rattr)
 	/* all entries */
 	for(t = ndbsearch(db, &s, attr, val); t; t = ndbsnext(&s, attr, val)){
 		for(nt = t; nt; nt = nt->entry)
-			print("%s=%s ", nt->attr, nt->val);
-		print("\n");
+			Bprint(&bout, "%s=%s ", nt->attr, nt->val);
+		Bprint(&bout, "\n");
 		ndbfree(t);
 	}
 }
@@ -69,7 +70,7 @@ main(int argc, char **argv)
 	int reps = 1;
 	char *rattr = nil, *dbfile = nil;
 	Ndb *db;
-
+	
 	ARGBEGIN{
 	case 'a':
 		all++;
@@ -78,7 +79,7 @@ main(int argc, char **argv)
 		multiple++;
 		break;
 	case 'f':
-		dbfile = ARGF();
+		dbfile = EARGF(usage());
 		break;
 	default:
 		usage();
@@ -97,7 +98,9 @@ main(int argc, char **argv)
 	default:
 		usage();
 	}
-	
+
+	if(Binit(&bout, 1, OWRITE) == -1)
+		sysfatal("Binit: %r");
 	db = ndbopen(dbfile);
 	if(db == nil){
 		fprint(2, "%s: no db files\n", argv0);

+ 2 - 0
sys/src/cmd/unix/u9fs/plan9.h

@@ -62,7 +62,9 @@ typedef ushort Rune;
 
 #define nil ((void*)0)
 #define	nelem(x)	(sizeof(x)/sizeof((x)[0]))
+#ifndef offsetof
 #define	offsetof(s, m)	(ulong)(&(((s*)0)->m))
+#endif
 #define	assert(x)	if(x);else _assert("x")
 
 extern char *argv0;

+ 66 - 11
sys/src/cmd/unix/u9fs/u9fs.c

@@ -69,7 +69,7 @@ struct Fid {
 void*	emalloc(size_t);
 void*	erealloc(void*, size_t);
 char*	estrdup(char*);
-char*	estrpath(char*, char*);
+char*	estrpath(char*, char*, int);
 void	sysfatal(char*, ...);
 int	okuser(char*);
 
@@ -156,6 +156,20 @@ Auth *authmethods[] = {	/* first is default */
 
 Auth *auth;
 
+/*
+ * frogs: characters not valid in plan9
+ * filenames, keep this list in sync with
+ * /sys/src/9/port/chan.c:1656
+ */
+char isfrog[256]={
+	/*NUL*/	1, 1, 1, 1, 1, 1, 1, 1,
+	/*BKS*/	1, 1, 1, 1, 1, 1, 1, 1,
+	/*DLE*/	1, 1, 1, 1, 1, 1, 1, 1,
+	/*CAN*/	1, 1, 1, 1, 1, 1, 1, 1,
+	['/']	1,
+	[0x7f]	1,
+};
+
 void
 getfcallnew(int fd, Fcall *fc, int have)
 {
@@ -611,7 +625,10 @@ stat2qid(struct stat *st)
 	memmove(p, &st->st_ino, q-p);
 	q = q+sizeof(dev_t);
 	if(q > ep){
-/*		fprint(2, "warning: inode number + device number too big %d+%d\n", sizeof(ino_t), sizeof(dev_t)); */
+/*
+ *		fprint(2, "warning: inode number + device number too big %d+%d\n",
+ *			sizeof(ino_t), sizeof(dev_t));
+ */
 		q = ep - sizeof(dev_t);
 		if(q < p)
 			fprint(2, "warning: device number too big by itself\n");
@@ -624,11 +641,45 @@ stat2qid(struct stat *st)
 	return qid;
 }
 
+char *
+enfrog(char *src)
+{
+	char *d, *dst;
+	uchar *s;
+
+	d = dst = emalloc(strlen(src)*3 + 1);
+	for (s = (uchar *)src; *s; s++)
+		if(isfrog[*s] || *s == '\\')
+			d += sprintf(d, "\\%02x", *s);
+		else
+			*d++ = *s;
+	*d = 0;
+	return dst;
+}
+
+char *
+defrog(char *s)
+{
+	char *d, *dst, buf[3];
+
+	d = dst = emalloc(strlen(s) + 1);
+	for(; *s; s++)
+		if(*s == '\\' && strlen(s) >= 3){
+			buf[0] = *++s;			/* skip \ */
+			buf[1] = *++s;
+			buf[2] = 0;
+			*d++ = strtoul(buf, NULL, 16);
+		} else
+			*d++ = *s;
+	*d = 0;
+	return dst;
+}
+
 void
 stat2dir(char *path, struct stat *st, Dir *d)
 {
 	User *u;
-	char *q;
+	char *q, *p, *npath;
 
 	memset(d, 0, sizeof(*d));
 	d->qid = stat2qid(st);
@@ -642,9 +693,9 @@ stat2dir(char *path, struct stat *st, Dir *d)
 	d->muid = "";
 
 	if((q = strrchr(path, '/')) != nil)
-		d->name = q+1;
+		d->name = enfrog(q+1);
 	else
-		d->name = path;
+		d->name = enfrog(path);
 }
 
 void
@@ -703,7 +754,7 @@ rread(Fcall *rx, Fcall *tx)
 				fid->dirent = nil;
 				continue;
 			}
-			path = estrpath(fid->path, fid->dirent->d_name);
+			path = estrpath(fid->path, fid->dirent->d_name, 0);
 			memset(&st, 0, sizeof st);
 			if(stat(path, &st) < 0){
 				fprint(2, "dirread: stat(%s) failed: %s\n", path, strerror(errno));
@@ -938,8 +989,7 @@ rwstat(Fcall *rx, Fcall *tx)
 			seterror(tx, "whoops: can't happen in u9fs");
 			return;
 		}
-	
-		new = estrpath(dir, d.name);
+		new = estrpath(dir, d.name, 1);
 		if(strcmp(old, new) != 0 && rename(old, new) < 0){
 			if(chatty9p)
 				fprint(2, "rename(%s, %s) failed\n", old, new);
@@ -1139,7 +1189,7 @@ estrdup(char *p)
 }
 
 char*
-estrpath(char *p, char *q)
+estrpath(char *p, char *q, int frog)
 {
 	char *r, *s;
 
@@ -1152,11 +1202,16 @@ estrpath(char *p, char *q)
 		return r;
 	}
 
+	if(frog)
+		q = defrog(q);
+	else
+		q = strdup(q);
 	r = emalloc(strlen(p)+1+strlen(q)+1);
 	strcpy(r, p);
 	if(r[0]=='\0' || r[strlen(r)-1] != '/')
 		strcat(r, "/");
 	strcat(r, q);
+	free(q);
 	return r;
 }
 
@@ -1424,7 +1479,7 @@ userwalk(User *u, char **path, char *elem, Qid *qid, char **ep)
 	char *npath;
 	struct stat st;
 
-	npath = estrpath(*path, elem);
+	npath = estrpath(*path, elem, 1);
 	if(stat(npath, &st) < 0){
 		free(npath);
 		*ep = strerror(errno);
@@ -1529,7 +1584,7 @@ usercreate(Fid *fid, char *elem, int omode, long perm, char **ep)
 	m = (perm & DMDIR) ? 0777 : 0666;
 	perm = perm & (~m | (fid->st.st_mode & m));
 
-	npath = estrpath(fid->path, elem);
+	npath = estrpath(fid->path, elem, 1);
 	if(perm & DMDIR){
 		if((omode&~ORCLOSE) != OREAD){
 			*ep = Eperm;