diff --git a/.gitignore b/.gitignore index f590cf28..98370cdb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,296 @@ -plan9.log -plan9-reverse.log -state -state.old -state.journal -*.o *.a -man/man?/*.html -src/**/o.* -y.tab.[ch] -src/cmd/rc/x.tab.h -unix/*.tgz -bin/ -log/ -dict/ -postscript/font/ -sky/here -sky/*.scat +*.o *.orig +LOCAL.config +bin/" +bin/"" +bin/9660srv +bin/9import +bin/9p +bin/9pfuse +bin/9pserve +bin/9term +bin/Mail +bin/Netfiles +bin/acid +bin/acidtypes +bin/acme +bin/acmeevent +bin/aescbc +bin/ascii +bin/asn12dsa +bin/asn12rsa +bin/astro +bin/auxclog +bin/auxstats +bin/awk +bin/basename +bin/bc +bin/bmp +bin/bunzip2 +bin/bzip2 +bin/cal +bin/calendar +bin/cat +bin/cb +bin/cleanname +bin/clock +bin/cmapcube +bin/cmp +bin/col +bin/colors +bin/comm +bin/compress +bin/core +bin/crop +bin/date +bin/db +bin/dc +bin/dd +bin/delatex +bin/deroff +bin/devdraw +bin/dial +bin/dict +bin/diff +bin/disk/mkext +bin/disk/mkfs +bin/disknfs +bin/dns +bin/dnsdebug +bin/dnsquery +bin/dnstcp +bin/dsa2pub +bin/dsa2ssh +bin/dsagen +bin/dsasign +bin/du +bin/dump9660 +bin/echo +bin/ed +bin/eqn +bin/factor +bin/factotum +bin/file +bin/fmt +bin/fontsrv +bin/fortune +bin/fossil/conf +bin/fossil/flchk +bin/fossil/flfmt +bin/fossil/fossil +bin/fossil/last +bin/fossil/view +bin/freq +bin/fs/32vfs +bin/fs/cpiofs +bin/fs/tapfs +bin/fs/tarfs +bin/fs/tpfs +bin/fs/v10fs +bin/fs/v6fs +bin/fs/zipfs +bin/fsize +bin/getflags +bin/gif +bin/grap +bin/graph +bin/grep +bin/gunzip +bin/gview +bin/gzip +bin/hget +bin/hist +bin/hoc +bin/htmlfmt +bin/htmlroff +bin/ico +bin/iconv +bin/idiff +bin/img +bin/import +bin/join +bin/jpg +bin/lex +bin/listen1 +bin/look +bin/ls +bin/macargv +bin/mapd +bin/mc +bin/md5sum +bin/mk +bin/mk9660 +bin/mkdir +bin/mklatinkbd +bin/mtime +bin/namespace +bin/ndbipquery +bin/ndbmkdb +bin/ndbmkhash +bin/ndbmkhosts +bin/ndbquery +bin/netfileget +bin/netfilelib.rc +bin/netfileput +bin/netfilestat +bin/netkey +bin/news +bin/p +bin/page +bin/paint +bin/passwd +bin/pbd +bin/pemdecode +bin/pemencode +bin/pic +bin/plot +bin/plumb +bin/plumber +bin/png +bin/ppm +bin/pr +bin/primes +bin/proof +bin/psdownload +bin/ramfs +bin/rc +bin/read +bin/readcons +bin/resample +bin/rio +bin/rm +bin/rsa2csr +bin/rsa2pub +bin/rsa2ssh +bin/rsa2x509 +bin/rsafill +bin/rsagen +bin/sam +bin/samterm +bin/scat +bin/secstore +bin/secstored +bin/secuser +bin/sed +bin/seq +bin/sftpcache +bin/sha1sum +bin/sleep +bin/sort +bin/split +bin/sprog +bin/srv +bin/ssh-agent +bin/stats +bin/statusbar +bin/strings +bin/sum +bin/svgpic +bin/tail +bin/tar +bin/tbl +bin/tcolors +bin/tcs +bin/tee +bin/test +bin/time +bin/togif +bin/toico +bin/topng +bin/toppm +bin/touch +bin/tpic +bin/tr +bin/tr2post +bin/troff +bin/troff2html +bin/tweak +bin/uncompress +bin/unicode +bin/uniq +bin/units +bin/unutf +bin/unvac +bin/unzip +bin/usage +bin/vac +bin/vacfs +bin/vbackup +bin/vcat +bin/venti/buildindex +bin/venti/checkarenas +bin/venti/checkindex +bin/venti/clumpstats +bin/venti/conf +bin/venti/copy +bin/venti/dump +bin/venti/findscore +bin/venti/fixarenas +bin/venti/fmtarenas +bin/venti/fmtbloom +bin/venti/fmtindex +bin/venti/fmtisect +bin/venti/mirrorarenas +bin/venti/printarena +bin/venti/printarenapart +bin/venti/rdarena +bin/venti/read +bin/venti/ro +bin/venti/sync +bin/venti/syncindex +bin/venti/venti +bin/venti/verifyarena +bin/venti/wrarena +bin/venti/write +bin/vmount0 +bin/vnfs +bin/wc +bin/win +bin/winwatch +bin/xd +bin/xshove +bin/yacc +bin/yuv +bin/zcat +bin/zerotrunc +bin/zip config +dict/ install.log install.sum last-change +lib/fortunes.index +log/ +man/man?/*.html +plan9-reverse.log +plan9.log +postscript/font/ +sky/*.scat +sky/here +src/**/o.* +src/cmd/awk/proctab.c src/cmd/awk/y.output +src/cmd/bc.tab.c +src/cmd/bc.tab.h +src/cmd/delatex.c src/cmd/devdraw/latin1.h +src/cmd/eqn/eqn.c +src/cmd/eqn/prevy.tab.h +src/cmd/grap/grap.c +src/cmd/grap/grapl.c +src/cmd/jpg/rgbv.h +src/cmd/jpg/ycbcr.h +src/cmd/pic/picl.c +src/cmd/pic/picy.c +src/cmd/rc/x.tab.h +src/cmd/svgpic/picl.c +src/cmd/svgpic/picy.c +src/cmd/tpic/picy.c +src/cmd/units.tab.c +src/cmd/units.tab.h +state +state.journal +state.old +unix/*.tgz +y.tab.[ch] diff --git a/INSTALL b/INSTALL index 49a4d9a4..92ac1959 100755 --- a/INSTALL +++ b/INSTALL @@ -71,18 +71,15 @@ if [ `uname` = SunOS ]; then echo "* Running on Solaris: checking architecture..." case "$(isainfo -n)" in *amd64*) - echo " x86-64 found." - echo "OBJTYPE=x86_64" >>$PLAN9/config + echo " x86-64 found; using gcc." echo "CC9=gcc" >>$PLAN9/config # defaults to gcc on Solaris/amd64 ;; *i386*) - echo " i386 found." - echo "OBJTYPE=386" >>$PLAN9/config + echo " i386 found; using gcc." echo "CC9=gcc" >>$PLAN9/config # defaults to gcc on Solaris/i386 ;; *sparc*) echo " Sparc found." - echo "OBJTYPE=sparc" >>$PLAN9/config ;; esac fi @@ -90,28 +87,23 @@ fi if [ `uname` = Darwin ]; then export NPROC=$(sysctl hw.ncpu | sed 's/hw.ncpu: //') # On Darwin, uname -m -p cannot be trusted. - echo "* Running on Darwin: checking architecture..." + echo "* Running on Darwin..." rm -f ./a.out - if ! gcc lib/darwin-main.c >/dev/null 2>&1; then - echo "Cannot find gcc. You may need to install the command-line tools using Xcode." >&2 + if ! xcrun --sdk macosx clang lib/darwin-main.c >/dev/null 2>&1; then + echo "Cannot find 'xcrun --sdk macosx clang'." >&2 + echo "You may need to install the command-line tools using Xcode." >&2 echo "See http://swtch.com/go/xcodegcc for details." >&2 exit 1 fi - case "$(file ./a.out 2>/dev/null)" in - *x86_64*) - echo " x86-64 found." - echo "OBJTYPE=x86_64" >>$PLAN9/config - echo "CC9='xcrun --sdk macosx clang'" >>$PLAN9/config - ;; - *i386*) - echo " i386 found." - echo "OBJTYPE=386" >>$PLAN9/config - ;; - *ppc*) - echo " power found." - echo "OBJTYPE=power" >>$PLAN9/config + CC9="xcrun --sdk macosx clang" + case "$(uname -a)" in + *ARM64*) + CC9="$CC9 -arch arm64" + echo ' Forcing arm64 binaries with clang.' ;; esac + + echo "CC9='$CC9'" >>$PLAN9/config rm -f ./a.out fi diff --git a/LICENSE b/LICENSE index 6110e313..52d0f5ff 100644 --- a/LICENSE +++ b/LICENSE @@ -1,257 +1,49 @@ -Copyright © 2000-2009 Lucent Technologies. All Rights Reserved. +Copyright © 2021 Plan 9 Foundation Portions Copyright © 2001-2008 Russ Cox Portions Copyright © 2008-2009 Google Inc. -=================================================================== +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: -The bulk of this software is derived from Plan 9 and is thus distributed -under the Lucent Public License, Version 1.02, reproduced below. +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. -There are a few exceptions: libutf, libfmt, and libregexp are distributed -under simpler BSD-like boilerplates. See the LICENSE files in those -directories. There are other exceptions, also marked with LICENSE files -in their directories or marked at the top of the file. - -The bitmap fonts in the font/luc, font/lucm, font/lucsans, and font/pelm -directory are copyright B&H Inc. and distributed under more restricted -terms under agreement with B&H. See the NOTICE file in those directories. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. =================================================================== -Lucent Public License Version 1.02 +This software is derived from Plan 9, originally copyright Lucent Technologies +and distributed under the Lucent Public License, Version 1.02. +Lucent was bought by Alcatel, which was bought by Nokia. +On March 23, 2021, Nokia announced the transfer of the Plan 9 copyrights to the +Plan 9 Foundation, which in turn relicensed Plan 9 under the the MIT license, +reproduced above. -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS PUBLIC -LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE -PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. +There are a few exceptions, noted with LICENSE files in their own directories: -1. DEFINITIONS +The bzip2 program uses the bzip2 license; see src/cmd/bzip2/LICENSE. -"Contribution" means: +The fonts from Bigelow and Holmes were licensed only for Plan 9 itself, +not for derivatives like Plan 9 from User Space. - a. in the case of Lucent Technologies Inc. ("LUCENT"), the Original - Program, and - b. in the case of each Contributor, - - i. changes to the Program, and - ii. additions to the Program; - - where such changes and/or additions to the Program were added to the - Program by such Contributor itself or anyone acting on such - Contributor's behalf, and the Contributor explicitly consents, in - accordance with Section 3C, to characterization of the changes and/or - additions as Contributions. - -"Contributor" means LUCENT and any other entity that has Contributed a -Contribution to the Program. - -"Distributor" means a Recipient that distributes the Program, -modifications to the Program, or any part thereof. - -"Licensed Patents" mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Original Program" means the original version of the software -accompanying this Agreement as released by LUCENT, including source -code, object code and documentation, if any. - -"Program" means the Original Program and Contributions or any part -thereof - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - - a. Subject to the terms of this Agreement, each Contributor hereby - grants Recipient a non-exclusive, worldwide, royalty-free copyright - license to reproduce, prepare derivative works of, publicly display, - publicly perform, distribute and sublicense the Contribution of such - Contributor, if any, and such derivative works, in source code and - object code form. - - b. Subject to the terms of this Agreement, each Contributor hereby - grants Recipient a non-exclusive, worldwide, royalty-free patent - license under Licensed Patents to make, use, sell, offer to sell, - import and otherwise transfer the Contribution of such Contributor, if - any, in source code and object code form. The patent license granted - by a Contributor shall also apply to the combination of the - Contribution of that Contributor and the Program if, at the time the - Contribution is added by the Contributor, such addition of the - Contribution causes such combination to be covered by the Licensed - Patents. The patent license granted by a Contributor shall not apply - to (i) any other combinations which include the Contribution, nor to - (ii) Contributions of other Contributors. No hardware per se is - licensed hereunder. - - c. Recipient understands that although each Contributor grants the - licenses to its Contributions set forth herein, no assurances are - provided by any Contributor that the Program does not infringe the - patent or other intellectual property rights of any other entity. Each - Contributor disclaims any liability to Recipient for claims brought by - any other entity based on infringement of intellectual property rights - or otherwise. As a condition to exercising the rights and licenses - granted hereunder, each Recipient hereby assumes sole responsibility - to secure any other intellectual property rights needed, if any. For - example, if a third party patent license is required to allow - Recipient to distribute the Program, it is Recipient's responsibility - to acquire that license before distributing the Program. - - d. Each Contributor represents that to its knowledge it has sufficient - copyright rights in its Contribution, if any, to grant the copyright - license set forth in this Agreement. - -3. REQUIREMENTS - -A. Distributor may choose to distribute the Program in any form under -this Agreement or under its own license agreement, provided that: - - a. it complies with the terms and conditions of this Agreement; - - b. if the Program is distributed in source code or other tangible - form, a copy of this Agreement or Distributor's own license agreement - is included with each copy of the Program; and - - c. if distributed under Distributor's own license agreement, such - license agreement: - - i. effectively disclaims on behalf of all Contributors all warranties - and conditions, express and implied, including warranties or - conditions of title and non-infringement, and implied warranties or - conditions of merchantability and fitness for a particular purpose; - ii. effectively excludes on behalf of all Contributors all liability - for damages, including direct, indirect, special, incidental and - consequential damages, such as lost profits; and - iii. states that any provisions which differ from this Agreement are - offered by that Contributor alone and not by any other party. - -B. Each Distributor must include the following in a conspicuous - location in the Program: - - Copyright (C) 2003, Lucent Technologies Inc. and others. All Rights - Reserved. - -C. In addition, each Contributor must identify itself as the -originator of its Contribution in a manner that reasonably allows -subsequent Recipients to identify the originator of the Contribution. -Also, each Contributor must agree that the additions and/or changes -are intended to be a Contribution. Once a Contribution is contributed, -it may not thereafter be revoked. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Distributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for Contributors. Therefore, if a -Distributor includes the Program in a commercial product offering, -such Distributor ("Commercial Distributor") hereby agrees to defend -and indemnify every Contributor ("Indemnified Contributor") against -any losses, damages and costs (collectively"Losses") arising from -claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Distributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Distributor in writing of such claim, and b) -allow the Commercial Distributor to control, and cooperate with the -Commercial Distributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Distributor might include the Program in a commercial -product offering, Product X. That Distributor is then a Commercial -Distributor. If that Commercial Distributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Distributor's responsibility -alone. Under this section, the Commercial Distributor would have to -defend claims against the Contributors related to those performance -claims and warranties, and if a court requires any Contributor to pay -any damages as a result, the Commercial Distributor must pay those -damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement, including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. EXPORT CONTROL - -Recipient agrees that Recipient alone is responsible for compliance -with the United States export administration regulations (and the -export control laws and regulation of any other countries). - -8. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against a Contributor with -respect to a patent applicable to software (including a cross-claim or -counterclaim in a lawsuit), then any patent licenses granted by that -Contributor to such Recipient under this Agreement shall terminate as -of the date such litigation is filed. In addition, if Recipient -institutes patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Program -itself (excluding combinations of the Program with other software or -hardware) infringes such Recipient's patent(s), then such Recipient's -rights granted under Section 2(b) shall terminate as of the date such -litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -LUCENT may publish new versions (including revisions) of this -Agreement from time to time. Each new version of the Agreement will be -given a distinguishing version number. The Program (including -Contributions) may always be distributed subject to the version of the -Agreement under which it was received. In addition, after a new -version of the Agreement is published, Contributor may elect to -distribute the Program (including its Contributions) under the new -version. No one other than LUCENT has the right to modify this -Agreement. Except as expressly stated in Sections 2(a) and 2(b) above, -Recipient receives no rights or licenses to the intellectual property -of any Contributor under this Agreement, whether expressly, by -implication, estoppel or otherwise. All rights in the Program not -expressly granted under this Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. +Plan 9 from User Space arranged a separate agreement with B&H to include +the bitmap fonts in the font/luc, font/lucm, font/lucsans, and font/pelm +directories. Other bitmap fonts have other licenses. See font/LICENSE. +The Lucida Sans Unicode PostScript fonts were licensed from B&H only for Plan 9 +itself, not derivatives like Plan 9 from User Space. In their place, Plan 9 from +User Space provides Luxi Sans, also by B&H but available under a more liberal +license, and Deja Vu, a Unicode extension of the Bitstream Vera family of fonts. +Luxi Sans is similar to Lucida Sans, but it has no Unicode support. +Deja Vu does have good Unicode support. diff --git a/bin/9a b/bin/9a deleted file mode 100755 index 753797c8..00000000 --- a/bin/9a +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -if [ $# != 1 ]; then - echo 'usage: 9a file.s' 1>&2 - exit 1 -fi - -test -f $PLAN9/config && . $PLAN9/config - -aflags="" -case "`uname`-${OBJTYPE:-`uname -m`}" in -Darwin-*386*) - aflags="-arch i386" - ;; -Darwin-*x86_64*) - aflags="-arch x86_64" - ;; -esac - -out=`echo $1 | sed 's/\.s$//;s/$/.o/'` -exec as $aflags -o $out $1 diff --git a/bin/9c b/bin/9c index a22a0a08..de8f81e9 100755 --- a/bin/9c +++ b/bin/9c @@ -26,10 +26,6 @@ usegcc() # that option only works with gcc3+ it seems cflags="$cflags -ggdb" cflags="$cflags $CC9FLAGS" - case "$cflags" in - *sanitize=address*) - cflags="$cflags -DPLAN9PORT_ASAN" - esac } quiet() @@ -83,14 +79,10 @@ useclang() -Wno-unneeded-internal-declaration \ -fsigned-char \ -fno-caret-diagnostics \ + -fcommon \ " cflags="$cflags -g" cflags="$cflags $CC9FLAGS" - - case "$cflags" in - *sanitize=address*) - cflags="$cflags -DPLAN9PORT_ASAN" - esac } usexlc() @@ -98,7 +90,7 @@ usexlc() cc=${CC9:-xlc_r} cflags=" \ -c \ - -O0 \ + -O2 \ -qmaxmem=-1 \ -qsuppress=1506-236 \ -qsuppress=1506-358 \ @@ -107,24 +99,18 @@ usexlc() -qsuppress=1506-1300 \ -qsuppress=1506-342 \ " - cflags="$cflags -g -qfullpath" + cflags="$cflags -g -qdbxextra -qfullpath" cflags="$cflags $CC9FLAGS" } -tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}" +tag="${SYSNAME:-`uname`}-${CC9:-cc}" case "$tag" in *DragonFly*gcc*|*BSD*gcc*) usegcc ;; *DragonFly*clang|*BSD*clang*) useclang ;; -*Darwin-x86_64*) +*Darwin*) useclang cflags="$cflags -g3 -m64" ;; -*Darwin*clang*) - useclang - cflags="$cflags -g3 -m32" - ;; -*Darwin*) usegcc - cflags="$cflags -g3 -no-cpp-precomp -m32" ;; *HP-UX*) cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;; *Linux*) usegcc case "${CC9:-gcc}" in diff --git a/bin/9l b/bin/9l index b4f91584..d7c9e2dd 100755 --- a/bin/9l +++ b/bin/9l @@ -9,7 +9,7 @@ verbose=false nmflags="" extralibs="-lm" -tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}" +tag="${SYSNAME:-`uname`}" case "$tag" in *DragonFly*|*BSD*) ld="${CC9:-gcc} $CC9FLAGS" @@ -27,11 +27,8 @@ case "$tag" in userpath=true extralibs="$extralibs -lutil -lresolv -lpthread" ;; -*Darwin*x86_64*) - ld="${CC9:-gcc} -m64 $CC9FLAGS" - ;; *Darwin*) - ld="${CC9:-gcc} -m32 $CC9FLAGS" + ld="${CC9:-gcc} -m64 $CC9FLAGS" ;; *SunOS*) ld="${CC9:-cc} -g $CC9FLAGS" @@ -61,7 +58,7 @@ case "$tag" in esac ;; *AIX*) - ld="${CC9:-xlc_r} -g -O0 $CC9FLAGS" + ld="${CC9:-xlc_r} $CC9FLAGS" nmflags="-A -B" ;; *) @@ -252,7 +249,7 @@ then fi # Don't say -L with a non-existent directory: Xcode complains. # x86_64 seems to put its 64-bit libraries in lib64. - if [ "${OBJTYPE:-`uname -m`}" = "x86_64" -a -d "$X11/lib64" ] + if [ "`uname -m`" = "x86_64" -a -d "$X11/lib64" ] then libsl="$libsl -L$X11/lib64" fi diff --git a/bin/mount b/bin/mount index 0fbb1bfd..e29cc201 100755 --- a/bin/mount +++ b/bin/mount @@ -20,11 +20,14 @@ case FreeBSD echo 'don''t know how to mount (no fuse)' >[1=2] case Darwin version=`{sw_vers -productVersion|cut -d. -f1,2} + major_version = `{echo $version|cut -d. -f1} if(sysctl fuse.version >[2]/dev/null |9 grep -si 'fuse.version' || sysctl macfuse.version.number >[2]/dev/null |9 grep -si 'fuse.version' || sysctl osxfuse.version.number >[2]/dev/null |9 grep -si 'fuse.version' || test -d /System/Library/Extensions/fusefs.kext || test -d /Library/Filesystems/osxfuse.fs/Contents/Extensions/$version/osxfuse.kext || + test -d /Library/Filesystems/macfuse.fs/Contents/Extensions/$version/macfuse.kext || + test -d /Library/Filesystems/macfuse.fs/Contents/Extensions/$major_version/macfuse.kext || test -d /Library/Filesystems/osxfusefs.fs/Support/osxfusefs.kext || test -d /opt/local/Library/Filesystems/osxfuse.fs || test -d /Library/Filesystems/fusefs.fs/Support/fusefs.kext) diff --git a/bin/wintext b/bin/wintext index 80a89957..1f36a05c 100755 --- a/bin/wintext +++ b/bin/wintext @@ -1,22 +1,17 @@ -#!/bin/bash +#!/usr/local/plan9/bin/rc -case "$winid" in -[0-9]*) +if(~ $winid [0-9]*) { 9p read acme/$winid/body exit 0 -esac - -case "$text9term" in -unix!*) - dial -e $text9term &1 +echo 'no running window found' >[2=1] exit 1 diff --git a/dist/buildmk b/dist/buildmk index cd11417c..ba21ae02 100755 --- a/dist/buildmk +++ b/dist/buildmk @@ -2,5 +2,5 @@ # run this in the src directory . ../src/mkenv -export SYSNAME OBJTYPE INSTALL +export SYSNAME INSTALL sh -x mkmk.sh diff --git a/dist/unix.html b/dist/unix.html index 9948da2f..33f428a6 100644 --- a/dist/unix.html +++ b/dist/unix.html @@ -23,7 +23,7 @@ Edit ./^$/,s/ - +
supported systems @@ -49,7 +49,7 @@ Edit ./^$/,s/
make PREFIX=/usr/elsewhere install.
- + On unsupported systems, you will need to create Make.YourOS-YourArch. See the existing ones for examples. If you write one for a new system, @@ -62,27 +62,25 @@ Edit ./^$/,s/
- + Libutf is a port of Plan 9's support library for UTF-8 and Unicode. - +
- - manual: + + manual: isalpharune(3), rune(3), runestrcat(3), utf(7) - -
- - download: libutf.tgz (checksums) -
- - license: original Bell Labs MIT-like - or Lucent Public License + + download: libutf.tgz + +
+ + license: MIT
@@ -91,7 +89,7 @@ Edit ./^$/,s/
- + Libfmt is a port of Plan 9's formatted print library. As a base it provides all the syntax of ANSI C's printf but adds the ability for client programs to install new print verbs. @@ -99,108 +97,104 @@ Edit ./^$/,s/perror("foo"), you can write fprint(2, "foo: %r\n");. - This is especially nice when you write verbs to format the + This is especially nice when you write verbs to format the data structures used by your particular programs. Needs libutf. - +
- - manual: + + manual: print(3), fmtinstall(3), quote(3), fmtstrtod(3) - +
- - download: libfmt.tgz (checksums) - + + download: libfmt.tgz +
- - License: original Bell Labs MIT-like - or Lucent Public License + + license: MIT
- +
libbio
- + Libbio is a port of Plan 9's buffered I/O library. It provides most of the same functionality as stdio or sfio, but with a simpler interface and smaller footprint. Needs libutf and libfmt. - +
- - manual: + + manual: bio(3) - +
- - download: libbio.tgz (checksums) - + + download: libbio.tgz +
- - License: Vita Nuova MIT-like - or Lucent Public License + + license: MIT
- +
libregexp9
- + Libregexp9 is a port of Plan 9's Unicode-capable regular expression library. It is small and simple and provides the traditional extended regular - expressions (without modern complications like + expressions (without modern complications like {} and various \x character classes). It supports Unicode via wide character or UTF-8 encoding. Needs libutf and libfmt. - +
- - manual: + + manual: regexp9(3), regexp9(7) - +
- - download: libregexp9.tgz (checksums) - + + download: libregexp9.tgz +
- - License: original Bell Labs MIT-like - or Lucent Public License + + license: MIT
- +
mk
- + Mk is a simple replacement for make. Needs libutf, libfmt, libbio, and libregexp9. - +
- - manual: + + manual: mk(1) - +
- - download: mk.tgz (checksums) - + + download: mk.tgz +
- - License: Vita Nuova MIT-like - or Lucent Public License + + license: MIT
@@ -208,12 +202,11 @@ Edit ./^$/,s/
- + Includes mk and all the libraries. - +
- - download: mk-with-libs.tgz (checksums) + download: mk-with-libs.tgz
diff --git a/font/LICENSE b/font/LICENSE index 6ca96ce6..19b048ac 100644 --- a/font/LICENSE +++ b/font/LICENSE @@ -1,5 +1,6 @@ Many of the fonts in this directory come from other sources -and are distributed under licenses other than the Lucent Public License. +and are distributed under licenses other than the MIT-style license +that governs the main distribution. In particular, see: @@ -13,4 +14,4 @@ In particular, see: naga10/README pelm/NOTICE shinonome/README - + diff --git a/include/9p.h b/include/9p.h index 57caac28..586c59cc 100644 --- a/include/9p.h +++ b/include/9p.h @@ -219,7 +219,6 @@ struct Srv { }; void srv(Srv*); -void postmountsrv(Srv*, char*, char*, int); int postfd(char*, int); extern int chatty9p; void respond(Req*, char*); diff --git a/include/draw.h b/include/draw.h index 9a22e6b6..3b55504d 100644 --- a/include/draw.h +++ b/include/draw.h @@ -290,7 +290,7 @@ struct Cachefont struct Cacheinfo { - ushort x; /* left edge of bits */ + int x; /* left edge of bits */ uchar width; /* width of baseline */ schar left; /* offset of baseline */ Rune value; /* value of character at this slot in cache */ diff --git a/include/libc.h b/include/libc.h index 4bb537d6..1e24f0bb 100644 --- a/include/libc.h +++ b/include/libc.h @@ -473,10 +473,8 @@ extern _Thread *(*threadnow)(void); typedef struct Lock Lock; struct Lock { -#ifdef PLAN9PORT_USING_PTHREADS int init; pthread_mutex_t mutex; -#endif int held; }; diff --git a/include/thread.h b/include/thread.h index c01cd516..8c800829 100644 --- a/include/thread.h +++ b/include/thread.h @@ -1,7 +1,7 @@ #ifndef _THREAD_H_ #define _THREAD_H_ 1 #if defined(__cplusplus) -extern "C" { +extern "C" { #endif AUTOLIB(thread) @@ -15,6 +15,7 @@ void threadexits(char *); void threadexitsall(char *); void threadsetname(char*, ...); void threadsetstate(char*, ...); +void threadneedbackground(void); char *threadgetname(void); int threadyield(void); int threadidle(void); @@ -60,6 +61,8 @@ void **threaddata(void); void threadmain(int argc, char *argv[]); extern int mainstacksize; +int threadmaybackground(void); + /* * channel communication */ @@ -180,7 +183,7 @@ int threadspawnl(int[3], char*, ...); Channel* threadwaitchan(void); /* - * alternate interface to threadwaitchan - don't use both! + * alternate interface to threadwaitchan - don't use both! */ Waitmsg* procwait(int pid); diff --git a/include/u.h b/include/u.h index f84e348a..856e10f4 100644 --- a/include/u.h +++ b/include/u.h @@ -67,7 +67,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #if defined(__linux__) # include # include -# define PLAN9PORT_USING_PTHREADS 1 # if defined(__USE_MISC) # undef _NEEDUSHORT # undef _NEEDUINT @@ -76,7 +75,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #elif defined(__sun__) # include # include -# define PLAN9PORT_USING_PTHREADS 1 # undef _NEEDUSHORT # undef _NEEDUINT # undef _NEEDULONG @@ -84,7 +82,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #elif defined(__FreeBSD__) # include # include -# define PLAN9PORT_USING_PTHREADS 1 # include # if !defined(_POSIX_SOURCE) # undef _NEEDUSHORT @@ -93,7 +90,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #elif defined(__APPLE__) # include # include -# define PLAN9PORT_USING_PTHREADS 1 # if __GNUC__ < 4 # undef _NEEDUSHORT # undef _NEEDUINT @@ -108,20 +104,19 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #elif defined(__NetBSD__) # include # include +# include # undef _NEEDUSHORT # undef _NEEDUINT # undef _NEEDULONG #elif defined(__OpenBSD__) # include # include -# define PLAN9PORT_USING_PTHREADS 1 # undef _NEEDUSHORT # undef _NEEDUINT # undef _NEEDULONG #else /* No idea what system this is -- try some defaults */ # include -# define PLAN9PORT_USING_PTHREADS 1 #endif #ifndef O_DIRECT diff --git a/install.txt b/install.txt index 6e0e9d3e..e7dd3c65 100644 --- a/install.txt +++ b/install.txt @@ -1,219 +1,102 @@ - INTRO(1) INTRO(1) + INSTALL(1) INSTALL(1) NAME - intro - introduction to Plan 9 from User Space + install - notes about Plan 9 from User Space installation + + SYNOPSIS + cd /usr/local/plan9; ./INSTALL [ -b | -c ] [ -r path ] DESCRIPTION - Plan 9 is a distributed computing environment built at Bell - Labs starting in the late 1980s. The system can be obtained - from Bell Labs at http://9p.io/plan9 and runs - on PCs and a variety of other platforms. Plan 9 became a - convenient platform for experimenting with new ideas, appli- - cations, and services. + To obtain the Plan 9 tree, use Git (see git(1)) or download + a tar file from https://9fans.github.io/plan9port. - Plan 9 from User Space provides many of the ideas, applica- - tions, and services from Plan 9 on Unix-like systems. It - runs on FreeBSD (x86, x86-64), Linux (x86, x86-64, PowerPC - and ARM), Mac OS X (x86, x86-64, and PowerPC), NetBSD (x86 - and PowerPC), OpenBSD (x86 and PowerPC), Dragonfly BSD - (x86-64), and SunOS (x86-64 and Sparc). + The tree can be unpacked anywhere, but the usual place is + /usr/local/plan9. In the root of the tree, run ./INSTALL. + This script builds the Plan 9 build program mk(1) if neces- + sary, cleans all previously built object files and libraries + out of the tree, rebuilds and installs everything, and then + cleans up. - Commands - Plan 9 from User Space expects its own directory tree, con- - ventionally /usr/local/plan9. When programs need to access - files in the tree, they expect the $PLAN9 environment vari- - able to contain the name of the root of the tree. See - install(1) for details about installation. + There are a few files in tree which have the root hard-coded + in them. After the build, INSTALL edits these files to + replace the string /usr/local/plan9 with the name of the + root of the current tree. - Many of the familiar Unix commands, for example cat(1), - ls(1), and wc(1), are present, but in their Plan 9 forms: - cat takes no options, ls does not columnate its output when - printing to a terminal, and wc counts UTF characters. In - some cases, the differences are quite noticeable: grep(1) - and sed(1) expect Plan 9 regular expressions (see - regexp(7)), which are closest to what Unix calls extended - regular expressions. Because of these differences, it is - not recommended to put $PLAN9/bin before the usual system - bin directories in your search path. Instead, put it at the - end of your path and use the 9(1) script when you want to - invoke the Plan 9 version of a traditional Unix command. + Finally, INSTALL builds an HTML version of the manual and + installs it in /usr/local/plan9/man. - Occasionally the Plan 9 programs have been changed to adapt - to Unix. Mk(1) now allows mkfiles to choose their own - shell, and rc(1) has a ulimit builtin and manages $PATH. + The installation can be thought of as two steps: build all + the binaries, and then edit files as necessary to fix the + references to the installation root. If necessary, these + can be run separately. Given the -b flag, INSTALL performs + only the first step. Given the -c flag, INSTALL performs + only the second step. The first step can be done with the + tree in a temporary work directory, but the second step must + be done once the tree is in its final location. If you want + to build the project in one location and then install into + another location, use -r path to specify the final location + of Plan9 tree. These flags are only necessary when trying + to conform to the expectations of certain package management + systems. - Many of the graphical programs from Plan 9 are present, - including sam(1) and acme(1). An X11 window manager rio(1) - mimics Plan 9's window system, with command windows imple- - mented by the external program 9term(1). Following the style - of X Windows, these programs run in new windows rather than - the one in which they are invoked. They all take a -W - option to specify the size and placement of the new window. - The argument is one of widthxheight, widthxheight@xmin,xmax, + At the end of the installation, INSTALL prints suggested + settings for the environment variables $PLAN9 and $PATH. - Page 1 Plan 9 (printed 12/1/14) + INSTALL writes various autodetected settings to + /usr/local/plan9/config. The file + /usr/local/plan9/LOCAL.config is appended to config after + this auto-detection and can be used to override the choices. + If LOCAL.config contains a line WSYSTYPE=nowsys then the + system is built without using X11. LOCAL.config may also + list settings for CC9 (the host C compiler) and CC9FLAGS + (any additional flags to pass to the compiler). Values more - INTRO(1) INTRO(1) + Page 1 Plan 9 (printed 4/9/21) - or xmin,ymin,xmax,ymax. + INSTALL(1) INSTALL(1) - The plumber(4) helps to connect the various Plan 9 programs - together, and fittings like web(1) connect it to external - programs such as web browsers; one can click on a URL in - acme and see the page load in Firefox. + complex than single words should be quoted with single + quotes. - User-level file servers - In Plan 9, user-level file servers present file trees via - the Plan 9 file protocol, 9P. Processes can mount arbitrary - file servers and customize their own name spaces. These - facilities are used to connect programs. Clients interact - with file servers by reading and writing files. + On most Linux systems, the X11 header packages need to be + installed to build using X11. On Debian. the required pack- + ages are libfontconfig1-dev, libx11-dev, libxext-dev, and + libxt-dev. On Ubuntu, it suffices to install xorg-dev. - This cannot be done directly on Unix. Instead the servers - listen for 9P connections on Unix domain sockets; clients - connect to these sockets and speak 9P directly using the - 9pclient(3) library. Intro(4) tells more of the story. The - effect is not as clean as on Plan 9, but it gets the job - done and still provides a uniform and easy-to-understand - mechanism. The 9p(1) client can be used in shell scripts or - by hand to carry out simple interactions with servers. - Netfiles(1) is an experimental client for acme. - - External databases - Some programs rely on large databases that would be cumber- - some to include in every release. Scripts are provided that - download these databases separately. These databases can be - downloaded separately. See $PLAN9/dict/README and - $PLAN9/sky/README. - - Programming - The shell scripts 9c and 9l (see 9c(1)) provide a simple - interface to the underlying system compiler and linker, sim- - ilar to the 2c and 2l families on Plan 9. 9c compiles - source files, and 9l links object files into executables. - When using Plan 9 libraries, 9l infers the correct set of - libraries from the object files, so that no -l options are - needed. - - The only way to write multithreaded programs is to use the - thread(3) library. Rfork(3) exists but is not as capable as - on Plan 9. There are many unfortunate by necessary prepro- - cessor diversions to make Plan 9 and Unix libraries coexist. - See intro(3) for details. - - The debuggers acid(1) and db(1) and the debugging library - mach(3) are works in progress. They are platform- - independent, so that x86 Linux core dumps can be inspected - on PowerPC Mac OS X machines, but they are also fairly - incomplete. The x86 target is the most mature; initial Pow- - erPC support exists; and other targets are unimplemented. - - Page 2 Plan 9 (printed 12/1/14) - - INTRO(1) INTRO(1) - - The debuggers can only inspect, not manipulate, target pro- - cesses. Support for operating system threads and for 64-bit - architectures needs to be rethought. On x86 Linux systems, - acid and db can be relied upon to produce reasonable stack - traces (often in cases when GNU gdb cannot) and dump data - structures, but that it is the extent to which they have - been developed and exercised. - - Porting programs - The vast majority of the familiar Plan 9 programs have been - ported, including the Unicode-aware troff(1). - - Of the more recent additions to Plan 9, factotum(4), - secstore(1), and secstored(1), vac(1), vacfs(4), and - venti(8) are all ported. - - A backup system providing a dump file system built atop - Venti is in progress; see vbackup(8). - - Porting to new systems - Porting the tree to new operating systems or architectures - should be straightforward, as system-specific code has been - kept to a minimum. The largest pieces of system-specific - code are , which must include the right system files - and set up the right integer type definitions, and - libthread, which must implement spin locks, operating system - thread creation, and context switching routines. Portable - implementations of these using and - already exist. If your system supports them, you may not - need to write any system specific code at all. - - There are other smaller system dependencies, such as the - terminal handling code in 9term(1) and the implementation of - getcallerpc(3), but these are usually simple and are not on - the critical path for getting the system up and running. - - SEE ALSO - The rest of this manual describes Plan 9 from User Space. - Many of the man pages have been brought from Plan 9, but - they have been updated, and others have been written from + INSTALL can safely be repeated to rebuild the system from scratch. - The manual pages are in a Unix style tree, with names like - $PLAN9/man/man1/cat.1 instead of Plan 9's simpler - $PLAN9/man/1/cat, so that the Unix man(1) utility can handle - it. Some systems, for example Debian Linux, deduce the man - page locations from the search path, so that adding - $PLAN9/bin to your path is sufficient to cause $PLAN9/man to - be consulted for manual pages using the system man. On other - systems, or to look at manual pages with the same name as a - system page, invoke the Plan 9 man directly, as in 9 man - cat. + Once the system is built for the first time, it can be main- + tained and rebuilt using mk(1). To rebuild individual com- + mands or libraries, run mk install and mk clean in the + appropriate source directory (see src(1)). - Page 3 Plan 9 (printed 12/1/14) + FILES + /usr/local/plan9/lib/moveplan9.files + the list of files that need to have /usr/local/plan9 + edited out of them - INTRO(1) INTRO(1) + /usr/local/plan9/lib/moveplan9.sh + the script that edits the files - The manual sections follow the Unix numbering conventions, - not the Plan 9 ones. + /usr/local/plan9/src/mkmk.sh + the shell script used to build mk(1) - Section (1) describes general publicly accessible commands. + /usr/local/plan9/dist/manweb + the shell script that builds the HTML manual - Section (3) describes C library functions. + /usr/local/plan9/man/index.html + the top-level page in the HTML version of the manual - Section (4) describes user-level file servers. + /usr/local/plan9/install.log + logged output from the last run of INSTALL - Section (7) describes file formats and protocols. (On Unix, - section (5) is technically for file formats but seems now to - be used for describing specific files.) + /usr/local/plan9/install.sum + a summary of install.log - Section (8) describes commands used for system administra- - tion. + SEE ALSO + intro(1), git(1) - Section (9p) describes the Plan 9 file protocol 9P. - - These pages describe parts of the system that are new or - different from Plan 9 from Bell Labs: - - 9(1), 9c(1), 9p(1), 9term(1), acidtypes in acid(1), - dial(1), git(1), label(1), the MKSHELL variable in - mk(1), namespace(1), netfiles(1), page(1), psfonts(1), - rio(1), web(1), wintext(1) - - intro(3), 9pclient(3), the unix network in dial(3), - exits(3), get9root(3), getns(3), notify(3), - post9pservice(3), rfork(3), searchpath(3), sendfd(3), - udpread(3), venti(3), wait(3), wctl(3) - - intro(4), 9pserve(4), import(4), - - vbackup(8) - - openfd(9p) - - DIAGNOSTICS - In Plan 9, a program's exit status is an arbitrary text - string, while on Unix it is an integer. Section (1) of this - manual describes commands as though they exit with string - statuses. In fact, exiting with an empty status corresponds - to exiting with status 0, and exiting with any non-empty - string corresponds to exiting with status 1. See exits(3). - - Page 4 Plan 9 (printed 12/1/14) + Page 2 Plan 9 (printed 4/9/21) diff --git a/lib/moveplan9.files b/lib/moveplan9.files index 16535103..fe47d4ab 100644 --- a/lib/moveplan9.files +++ b/lib/moveplan9.files @@ -34,6 +34,7 @@ bin/upas/unspambox bin/venti/conf bin/vmount bin/vwhois +bin/wintext bin/yesterday dist/debian/mkpkg dist/debian/mkrep diff --git a/man/lookman.index b/man/lookman.index index 56aabc53..56f12227 100644 --- a/man/lookman.index +++ b/man/lookman.index @@ -19153,7 +19153,6 @@ posted /usr/local/plan9/man/man4/plumber.4 posted /usr/local/plan9/man/man9/0intro.9p postfd /usr/local/plan9/man/man3/9p.3 postmark /usr/local/plan9/man/man1/bundle.1 -postmountsrv /usr/local/plan9/man/man3/9p.3 postnote /usr/local/plan9/man/man3/notify.3 postnote /usr/local/plan9/man/man3/postnote.3 postnote /usr/local/plan9/man/man3/rfork.3 diff --git a/man/man1/0intro.1 b/man/man1/0intro.1 index 16134933..780be91d 100644 --- a/man/man1/0intro.1 +++ b/man/man1/0intro.1 @@ -32,15 +32,15 @@ they expect the environment variable to contain the name of the root of the tree. See -.IR install (1) +.MR install (1) for details about installation. .PP Many of the familiar Unix commands, for example -.IR cat (1), -.IR ls (1), +.MR cat (1) , +.MR ls (1) , and -.IR wc (1), +.MR wc (1) , are present, but in their Plan 9 forms: .I cat takes no options, @@ -50,12 +50,12 @@ and .I wc counts UTF characters. In some cases, the differences are quite noticeable: -.IR grep (1) +.MR grep (1) and -.IR sed (1) +.MR sed (1) expect Plan 9 regular expressions (see -.IR regexp (7)), +.MR regexp (7) ), which are closest to what Unix calls extended regular expressions. Because of these differences, it is not recommended to put .B $PLAN9/bin @@ -63,16 +63,16 @@ before the usual system .B bin directories in your search path. Instead, put it at the end of your path and use the -.IR 9 (1) +.MR 9 (1) script when you want to invoke the Plan 9 version of a traditional Unix command. .PP Occasionally the Plan 9 programs have been changed to adapt to Unix. -.IR Mk (1) +.MR Mk (1) now allows mkfiles to choose their own shell, and -.IR rc (1) +.MR rc (1) has a .I ulimit builtin and manages @@ -80,14 +80,14 @@ builtin and manages .PP Many of the graphical programs from Plan 9 are present, including -.IR sam (1) +.MR sam (1) and -.IR acme (1). +.MR acme (1) . An X11 window manager -.IR rio (1) +.MR rio (1) mimics Plan 9's window system, with command windows implemented by the external program -.IR 9term (1). +.MR 9term (1) . Following the style of X Windows, these programs run in new windows rather than the one in which they are invoked. They all take a @@ -101,10 +101,10 @@ The argument is one of \fIxmin\fL,\fIymin\fL,\fIxmax\fL,\fIymax\fR. .PP The -.IR plumber (4) +.MR plumber (4) helps to connect the various Plan 9 programs together, and fittings like -.IR web (1) +.MR web (1) connect it to external programs such as web browsers; one can click on a URL in .I acme @@ -119,17 +119,17 @@ with file servers by reading and writing files. This cannot be done directly on Unix. Instead the servers listen for 9P connections on Unix domain sockets; clients connect to these sockets and speak 9P directly using the -.IR 9pclient (3) +.MR 9pclient (3) library. -.IR Intro (4) +.MR Intro (4) tells more of the story. The effect is not as clean as on Plan 9, but it gets the job done and still provides a uniform and easy-to-understand mechanism. The -.IR 9p (1) +.MR 9p (1) client can be used in shell scripts or by hand to carry out simple interactions with servers. -.IR Netfiles (1) +.MR Netfiles (1) is an experimental client for acme. .SS External databases Some programs rely on large databases that would be @@ -146,7 +146,7 @@ The shell scripts and .I 9l (see -.IR 9c (1)) +.MR 9c (1) ) provide a simple interface to the underlying system compiler and linker, similar to the .I 2c @@ -165,22 +165,22 @@ so that no options are needed. .PP The only way to write multithreaded programs is to use the -.IR thread (3) +.MR thread (3) library. -.IR Rfork (3) +.MR Rfork (3) exists but is not as capable as on Plan 9. There are many unfortunate by necessary preprocessor diversions to make Plan 9 and Unix libraries coexist. See -.IR intro (3) +.MR intro (3) for details. .PP The debuggers -.IR acid (1) +.MR acid (1) and -.IR db (1) +.MR db (1) and the debugging library -.IR mach (3) +.MR mach (3) are works in progress. They are platform-independent, so that x86 Linux core dumps can be inspected on PowerPC Mac OS X machines, @@ -203,22 +203,22 @@ but that it is the extent to which they have been developed and exercised. .SS Porting programs The vast majority of the familiar Plan 9 programs have been ported, including the Unicode-aware -.IR troff (1). +.MR troff (1) . .PP Of the more recent additions to Plan 9, -.IR factotum (4), -.IR secstore (1), +.MR factotum (4) , +.MR secstore (1) , and -.IR secstored (1), -.IR vac (1), -.IR vacfs (4), +.MR secstored (1) , +.MR vac (1) , +.MR vacfs (4) , and -.IR venti (8) +.MR venti (8) are all ported. .PP A backup system providing a dump file system built atop Venti is in progress; see -.IR vbackup (8). +.MR vbackup (8) . .SS Porting to new systems Porting the tree to new operating systems or architectures should be straightforward, as system-specific code has been @@ -240,9 +240,9 @@ need to write any system specific code at all. .PP There are other smaller system dependencies, such as the terminal handling code in -.IR 9term (1) +.MR 9term (1) and the implementation of -.IR getcallerpc (3), +.MR getcallerpc (3) , but these are usually simple and are not on the critical path for getting the system up and running. .SH SEE ALSO @@ -255,7 +255,7 @@ The manual pages are in a Unix style tree, with names like instead of Plan 9's simpler .BR $PLAN9/man/1/cat , so that the Unix -.IR man (1) +.MR man (1) utility can handle it. Some systems, for example Debian Linux, deduce the man page locations from the search path, so that @@ -300,52 +300,52 @@ describes the Plan 9 file protocol 9P. These pages describe parts of the system that are new or different from Plan 9 from Bell Labs: .IP -.IR 9 (1), -.IR 9c (1), -.IR 9p (1), -.IR 9term (1), +.MR 9 (1) , +.MR 9c (1) , +.MR 9p (1) , +.MR 9term (1) , .I acidtypes in -.IR acid (1), -.IR dial (1), -.IR git (1), -.IR label (1), +.MR acid (1) , +.MR dial (1) , +.MR git (1) , +.MR label (1) , the .B MKSHELL variable in -.IR mk (1), -.IR namespace (1), -.IR netfiles (1), -.IR page (1), -.IR psfonts (1), -.IR rio (1), -.IR web (1), -.IR wintext (1) +.MR mk (1) , +.MR namespace (1) , +.MR netfiles (1) , +.MR page (1) , +.MR psfonts (1) , +.MR rio (1) , +.MR web (1) , +.MR wintext (1) .IP -.IR intro (3), -.IR 9pclient (3), +.MR intro (3) , +.MR 9pclient (3) , the .B unix network in -.IR dial (3), -.IR exits (3), -.IR get9root (3), -.IR getns (3), -.IR notify (3), -.IR post9pservice (3), -.IR rfork (3), -.IR searchpath (3), -.IR sendfd (3), -.IR udpread (3), -.IR venti (3), -.IR wait (3), -.IR wctl (3) +.MR dial (3) , +.MR exits (3) , +.MR get9root (3) , +.MR getns (3) , +.MR notify (3) , +.MR post9pservice (3) , +.MR rfork (3) , +.MR searchpath (3) , +.MR sendfd (3) , +.MR udpread (3) , +.MR venti (3) , +.MR wait (3) , +.MR wctl (3) .IP -.IR intro (4), -.IR 9pserve (4), -.IR import (4), +.MR intro (4) , +.MR 9pserve (4) , +.MR import (4) , .IP -.IR vbackup (8) +.MR vbackup (8) .IP .IR openfd (9p) .SH DIAGNOSTICS @@ -356,4 +356,4 @@ exit with string statuses. In fact, exiting with an empty status corresponds to exiting with status 0, and exiting with any non-empty string corresponds to exiting with status 1. See -.IR exits (3). +.MR exits (3) . diff --git a/man/man1/9.1 b/man/man1/9.1 index a115260d..34c150d2 100644 --- a/man/man1/9.1 +++ b/man/man1/9.1 @@ -12,7 +12,7 @@ .B . .B 9 (from -.IR sh (1)) +.MR sh (1) ) .PP .B 9.rc .I cmd @@ -24,7 +24,7 @@ .B . .B 9.rc (from -.IR rc (1)) +.MR rc (1) ) .PP .B u .I cmd @@ -36,7 +36,7 @@ .B . .B u (from -.IR sh (1)) +.MR sh (1) ) .PP .B u.rc .I cmd @@ -48,7 +48,7 @@ .B . .B u.rc (from -.IR rc (1)) +.MR rc (1) ) .SH DESCRIPTION Because Plan 9 supplies commands with the same name as but different behavior than many basic Unix system commands @@ -86,7 +86,7 @@ in order to make the current shell start running in the Plan 9 environment. is the same as .I 9 but written for use by the shell -.IR rc (1). +.MR rc (1) . .PP .I U and @@ -106,7 +106,7 @@ $ 9 grep '[α-ζ]' /etc/passwd .EE .PP Start an -.IR rc (1) +.MR rc (1) with the Plan 9 commands in the path before the system commands, and then run the Unix .IR ls : @@ -124,7 +124,7 @@ $ 9 rc .br .B \*9/bin/u.rc .SH SEE ALSO -.IR intro (1) +.MR intro (1) .SH BUGS Some shell configurations (notably, oh-my-zsh) diff --git a/man/man1/9c.1 b/man/man1/9c.1 index 8d24d67d..943df6fb 100644 --- a/man/man1/9c.1 +++ b/man/man1/9c.1 @@ -1,6 +1,6 @@ .TH 9C 1 .SH NAME -9c, 9a, 9l, 9ar \- C compiler, assembler, linker, archiver +9c, 9l, 9ar \- C compiler, assembler, linker, archiver .SH SYNOPSIS .B 9c [ @@ -14,10 +14,6 @@ .I file \&... .PP -.B 9a -.I file -\&... -.PP .B 9l [ .I -o @@ -81,12 +77,6 @@ also defines .B __sun__ on SunOS systems. .PP -.I 9a -assembles the named files into object files for the current system. -Unlike some system assemblers, it does -.I not -promise to run the C preprocessor on the source files. -.PP .I 9l links the named object files and libraries to create the target executable. Each @@ -164,7 +154,7 @@ With .BR t , give a long listing of all information about the files, somewhat like a listing by -.IR ls (1), +.MR ls (1) , showing .br .ns @@ -203,10 +193,6 @@ rebuilt whenever the archive is modified. Compile three C source files. .TP .L -9a file4.s -Assemble one assembler source file. -.TP -.L 9ar rvc lib.a file[12].o Archive the first two object files into a library. .TP diff --git a/man/man1/9p.1 b/man/man1/9p.1 index 762e7220..4580587d 100644 --- a/man/man1/9p.1 +++ b/man/man1/9p.1 @@ -121,11 +121,11 @@ copy a line from standard input to the file. Print errors, but don't give up. .B Rdwr is useful for interacting with servers like -.IR factotum (4). +.MR factotum (4) . .TP .B ls Print a directory listing in the format of -.IR ls (1). +.MR ls (1) . The .B -d and @@ -150,12 +150,12 @@ it connects to the Unix domain socket .I service in the name space directory (see -.IR intro (4)) +.MR intro (4) ) and then accesses .IR subpath . .SH EXAMPLE To update -.IR plumber (4)'s +.MR plumber (4) 's copy of your plumbing rules after editing .BR $HOME/lib/plumbing : .IP @@ -164,7 +164,7 @@ cat $HOME/lib/plumbing | 9p write plumb/rules .EE .PP To display the contents of the current -.IR acme (4) +.MR acme (4) window: .IP .EX @@ -173,6 +173,6 @@ window: .SH SOURCE .B \*9/src/cmd/9p.c .SH SEE ALSO -.IR intro (4), +.MR intro (4) , .IR intro (9p), -.IR 9pclient (3) +.MR 9pclient (3) diff --git a/man/man1/9term.1 b/man/man1/9term.1 index b0706139..2e042634 100644 --- a/man/man1/9term.1 +++ b/man/man1/9term.1 @@ -58,7 +58,7 @@ uses the imported value of .B $font if set; otherwise it uses the graphics system default. (See -.IR font (7) +.MR font (7) for a full discussion of font syntaxes.) .PP .I 9term @@ -96,7 +96,7 @@ Characters typed on the keyboard replace the selected text; if this text is not empty, it is placed in a .I snarf buffer common to all windows but distinct from that of -.IR sam (1). +.MR sam (1) . .PP Programs access the text in the window at a single point maintained automatically by @@ -163,7 +163,7 @@ and erases the character before the word. .PP An ACK character (control-F) or Insert character triggers file name completion for the preceding string (see -.IR complete (3)). +.MR complete (3) ). .PP Text may be moved vertically within the window. A scroll bar on the left of the window shows in its clear portion what fragment of the @@ -201,7 +201,7 @@ EOT, so the terminal must be set up with EOT as the ``eof'' character. .I 9term runs -.IR stty (1) +.MR stty (1) to establish this when the terminal is created. .PP .I 9term @@ -231,13 +231,13 @@ are a few common ones where they fall short. First, programs using the GNU readline library typically disable terminal echo and perform echoing themselves. The most common example is the shell -.IR bash (1). +.MR bash (1) . Disabling the use of readline with .RB `` "set +o emacs" '' .RI [ sic ] usually restores the desired behavior. Second, remote terminal programs such as -.IR ssh (1) +.MR ssh (1) typically run with echo disabled, relying on the remote system to echo characters as desired. Plan 9's @@ -279,7 +279,7 @@ The menu item sends the contents of the selection (not the snarf buffer) to the .I plumber (see -.IR plumb (1)). +.MR plumb (1) ). If the selection is empty, it sends the white-space-delimited text containing the selection (typing cursor). A typical use of this feature is to tell the editor to find the source of an error @@ -323,7 +323,7 @@ Not a .IR 9term bug: when running -.IR bash (1) +.MR bash (1) in .RB `` "set +o emacs" '' mode, its handling of interrupts is broken. @@ -334,4 +334,4 @@ character typed. .PP Unix makes everything harder. .SH SEE ALSO -.IR wintext (1) +.MR wintext (1) diff --git a/man/man1/acid.1 b/man/man1/acid.1 index ed0b24db..ec17c00f 100644 --- a/man/man1/acid.1 +++ b/man/man1/acid.1 @@ -70,7 +70,7 @@ at startup; see below. .BI -m " machine Assume instructions are for the given CPU type (see -.IR mach (3)) +.MR mach (3) ) instead of using the executable header to select the CPU type. .TP @@ -145,7 +145,7 @@ subscripts counted from 0. .BI delete " list", " subscript .PP Format codes are the same as in -.IR db (1). +.MR db (1) . Formats may be attached to (unary) expressions with .BR \e , e.g. @@ -230,7 +230,7 @@ Print 10 lines of source around the program address. .BI Bsrc( address ) Get the source line for the program address into a window of a running -.IR sam (1) +.MR sam (1) and select it. .TP .BI line( address ) @@ -323,7 +323,7 @@ Make the given process current. .TP .BI rc( string ) Escape to the shell, -.IR rc (1), +.MR rc (1) , to execute the command string. .TP .BI include( string ) @@ -449,7 +449,7 @@ notation) .BR *array . .PP Trace the system calls executed by -.IR ls (1) +.MR ls (1) (neither does this one): .IP .EX @@ -503,8 +503,8 @@ acid: cont() .SH SOURCE .B \*9/src/cmd/acid .SH "SEE ALSO" -.IR mk (1), -.IR db (1) +.MR mk (1) , +.MR db (1) .br Phil Winterbottom, ``Acid Manual''. diff --git a/man/man1/acme.1 b/man/man1/acme.1 index f21566f9..852a8f7f 100644 --- a/man/man1/acme.1 +++ b/man/man1/acme.1 @@ -45,7 +45,7 @@ The interactive interface uses the keyboard and mouse; external programs use a set of files served by .IR acme ; these are discussed in -.IR acme (4). +.MR acme (4) . .PP Any named .I files @@ -86,7 +86,7 @@ The option instructs .I acme to use FUSE (see -.IR 9pfuse (4)) +.MR 9pfuse (4) ) to mount itself at .IR mtpt . (Experimental.) @@ -98,10 +98,10 @@ windows are in two parts: a one-line above a multi-line .IR body . The body typically contains an image of a file, as in -.IR sam (1), +.MR sam (1) , or the output of a program, as in an -.IR rio (1) +.MR rio (1) window. The tag contains a number of blank-separated words, followed by a vertical bar character, followed by anything. @@ -118,9 +118,9 @@ a slash. .SS Scrolling Each window has a scroll bar to the left of the body. The scroll bar behaves much as in -.IR sam (1) +.MR sam (1) or -.IR rio (1) +.MR rio (1) except that scrolling occurs when the button is pressed, rather than released, and continues as long as the mouse button is held down in the scroll bar. @@ -131,7 +131,7 @@ down the scroll bar speeds up the rate of scrolling. .B -r reverses the scrolling behavior of buttons 1 and 3, to behave more like -.IR xterm (1).) +.MR xterm (1) .) .SS Layout .I Acme windows are arranged in columns. By default, it creates two columns when starting; @@ -164,7 +164,7 @@ pre-loads them with useful commands. Also, the tag across the top maintains a list of executing long-running commands. .SS Typing The behavior of typed text is similar to that in -.IR rio (1) +.MR rio (1) except that the characters are delivered to the tag or body under the mouse; there is no `click to type'. (The experimental option @@ -172,7 +172,7 @@ except that the characters are delivered to the tag or body under the mouse; the causes typing to go to the most recently clicked-at or made window.) The usual backspacing conventions apply. As in -.IR sam (1) +.MR sam (1) but not .IR rio , the ESC key selects the text typed since the last mouse action, @@ -249,7 +249,7 @@ is identified by the context of the command. These error windows are created when needed. .SS "Mouse button 1 Mouse button 1 selects text just as in -.IR sam (1) +.MR sam (1) or .IR rio (1) , including the usual double-clicking conventions. @@ -305,7 +305,7 @@ by default. .TP .B Edit Treat the argument as a text editing command in the style of -.IR sam (1). +.MR sam (1) . The full .B Sam language is implemented except for the commands @@ -379,7 +379,7 @@ With no arguments, prints the supplementary list. This command is largely superseded by plumbing (see -.IR plumb (7)). +.MR plumb (7) ). .TP .B Indent Set the autoindent mode according to the argument: @@ -507,7 +507,7 @@ If the text indicated with button 2 is not a recognized built-in, it is executed a shell command. For example, indicating .B date with button 2 runs -.IR date (1). +.MR date (1) . The standard and error outputs of commands are sent to the error window associated with the directory from which the command was run, which will be created if @@ -525,7 +525,7 @@ in a window containing executing .B mk will run -.IR mk (1) +.MR mk (1) in .BR /home/rob/sam , producing output in a window labeled @@ -539,12 +539,12 @@ and .B $winid set to the window's id number (see -.IR acme (4)). +.MR acme (4) ). .PP The environment variable .B $acmeshell determines which shell is used to execute such commands; the -.IR rc (1) +.MR rc (1) shell is used by default. .SS "Mouse button 3 Pointing at text with button 3 instructs @@ -574,7 +574,7 @@ command adds directories to the standard list.) .PP If the text begins with a colon, it is taken to be an address, in the style of -.IR sam (1), +.MR sam (1) , within the body of the window containing the text. The address is evaluated, the resulting text highlighted, and the mouse moved to it. Thus, in @@ -644,7 +644,7 @@ then execute clicking button 1 while 2 is held down. .PP When an external command (e.g. -.IR echo (1)) +.MR echo (1) ) is executed this way, the extra argument is passed as expected and an environment variable .B $acmeaddr @@ -677,7 +677,7 @@ window and runs a (default .BR $SHELL ) in it, turning the window into something analogous to an -.IR 9term (1) +.MR 9term (1) window. Executing text in a .I win @@ -686,7 +686,7 @@ window with button .BR Send . .I Win windows follow the same scrolling heuristic as in -.IR 9term (1): +.MR 9term (1) : the window scrolls on output only if the window is displaying the end of the buffer. .PP .I Awd @@ -774,7 +774,7 @@ MIPS-specific binaries for applications .br .B \*9/bin/awd .SH SEE ALSO -.IR acme (4) +.MR acme (4) .br Rob Pike, .I diff --git a/man/man1/acmeevent.1 b/man/man1/acmeevent.1 index d5ff0830..24fde4f5 100644 --- a/man/man1/acmeevent.1 +++ b/man/man1/acmeevent.1 @@ -61,7 +61,7 @@ acmeevent, acme.rc \- shell script support for acme clients and .I acme.rc make it easy to write simple -.IR acme (1) +.MR acme (1) client programs as shell scripts. .PP .I Acme @@ -69,14 +69,14 @@ clients read the .B event files (see -.IR acme (4)) +.MR acme (4) ) for the windows they control, reacting to the events. The events are presented in a format that is easy to read with C programs but hard to read with shell scripts. .PP .I Acmeevent reads an -.IR acme (4) +.MR acme (4) event stream from standard input, printing a shell-friendly version of the events, one per line, on standard output. Each output line from @@ -165,7 +165,7 @@ above); below). .I Flag remains from the -.IR acme (4) +.MR acme (4) event format. Because .IR eq0 , @@ -174,7 +174,7 @@ and .I chordarg are explicit in each event (unlike in -.IR acme (4) +.MR acme (4) events), .I flag can usually be ignored. @@ -221,7 +221,7 @@ window. .PP .I Acme.rc is a library of -.IR rc (1) +.MR rc (1) shell functions useful for writing acme clients. .PP .I Newwindow @@ -259,14 +259,14 @@ The most commonly-used command is .BR clean , which marks the window as clean. See -.IR acme (4) +.MR acme (4) for a full list of commands. .PP .I Windump sets the window's dump directory and dump command (see -.IR acme (4)). +.MR acme (4) ). If either argument is omitted or is .BR - , that argument is not set. @@ -381,9 +381,9 @@ for the full implementation. .br .B \*9/lib/acme.rc .SH SEE ALSO -.IR acme (1), -.IR acme (4), -.IR rc (1) +.MR acme (1) , +.MR acme (4) , +.MR rc (1) .SH BUGS There is more that could be done to ease the writing of complicated clients. diff --git a/man/man1/ascii.1 b/man/man1/ascii.1 index 0857805e..99265f46 100644 --- a/man/man1/ascii.1 +++ b/man/man1/ascii.1 @@ -91,7 +91,7 @@ control characters or insert newlines. is similar; it converts between .SM UTF and character values from the Unicode Standard (see -.IR utf (7)). +.MR utf (7) ). If given a range of hexadecimal numbers, .I unicode prints a table of the specified Unicode characters \(em their values and @@ -126,7 +126,7 @@ The file contains a table of characters and descriptions, sorted in hexadecimal order, suitable for -.IR look (1) +.MR look (1) on the lower case .I hex values of characters. @@ -154,7 +154,7 @@ table of characters and descriptions. .br .B \*9/src/cmd/unicode.c .SH "SEE ALSO" -.IR look (1), -.IR tcs (1), -.IR utf (7), -.IR font (7) +.MR look (1) , +.MR tcs (1) , +.MR utf (7) , +.MR font (7) diff --git a/man/man1/astro.1 b/man/man1/astro.1 index af5e7afa..b24cfa3f 100644 --- a/man/man1/astro.1 +++ b/man/man1/astro.1 @@ -114,7 +114,7 @@ default latitude (N), longitude (W), and elevation (meters) .SH SOURCE .B \*9/src/cmd/astro .SH SEE ALSO -.IR scat (1) +.MR scat (1) .SH BUGS The .B k diff --git a/man/man1/awk.1 b/man/man1/awk.1 index 9a933b70..395dfa96 100644 --- a/man/man1/awk.1 +++ b/man/man1/awk.1 @@ -377,7 +377,7 @@ Patterns are arbitrary Boolean combinations of regular expressions and relational expressions. Regular expressions are as in -.IR regexp (7). +.MR regexp (7) . Isolated regular expressions in a pattern apply to the entire line. Regular expressions may also occur in @@ -534,8 +534,8 @@ BEGIN { # Simulate echo(1) .SH SOURCE .B \*9/src/cmd/awk .SH SEE ALSO -.IR sed (1), -.IR regexp (7), +.MR sed (1) , +.MR regexp (7) , .br A. V. Aho, B. W. Kernighan, P. J. Weinberger, .I diff --git a/man/man1/bc.1 b/man/man1/bc.1 index 57194340..49748130 100644 --- a/man/man1/bc.1 +++ b/man/man1/bc.1 @@ -218,7 +218,7 @@ Assignment to .B scale influences the number of digits to be retained on arithmetic operations in the manner of -.IR dc (1). +.MR dc (1) . Assignments to .B ibase or @@ -235,7 +235,7 @@ empty square brackets must follow the array name. .PP .I Bc is actually a preprocessor for -.IR dc (1), +.MR dc (1) , which it invokes automatically, unless the .B -c (compile only) @@ -273,7 +273,7 @@ mathematical library .B \*9/src/cmd/bc.y .SH "SEE ALSO" .IR dc (1), -.IR hoc (1) +.MR hoc (1) .SH BUGS No .LR && , diff --git a/man/man1/bundle.1 b/man/man1/bundle.1 index 36bcd8d0..b4880343 100644 --- a/man/man1/bundle.1 +++ b/man/man1/bundle.1 @@ -7,20 +7,20 @@ bundle \- collect files for distribution .SH DESCRIPTION .I Bundle writes on its standard output a shell script for -.IR rc (1) +.MR rc (1) or a Bourne shell which, when executed, will recreate the original .IR files . Its main use is for distributing small numbers of text files by -.IR mail (1). +.MR mail (1) . .PP Although less refined than standard archives from .I 9ar (see -.IR 9c (1)) +.MR 9c (1) ) or -.IR tar (1), +.MR tar (1) , a .IR bundle file @@ -49,7 +49,7 @@ cd gift; sh horse; mk (in .IR 9c (1)), .IR tar (1), -.IR mail (1) +.MR mail (1) .SH BUGS .I Bundle will not create directories and is unsatisfactory for non-text files. diff --git a/man/man1/calendar.1 b/man/man1/calendar.1 index 14c6f911..5a305699 100644 --- a/man/man1/calendar.1 +++ b/man/man1/calendar.1 @@ -43,7 +43,7 @@ processing at the end of the week. On Friday and Saturday, events through Monday are printed. .PP To have your calendar mailed to you every day, use -.IR cron (8). +.MR cron (8) . .SH FILES .TF $HOME/lib/calendar .TP diff --git a/man/man1/cat.1 b/man/man1/cat.1 index 0738206a..7ff12e69 100644 --- a/man/man1/cat.1 +++ b/man/man1/cat.1 @@ -51,7 +51,7 @@ copies to standard output exactly one line from the named .IR file , default standard input. It is useful in interactive -.IR rc (1) +.MR rc (1) scripts. .PP The @@ -76,11 +76,11 @@ characters and the characters that precede them. It is useful to use as .B $PAGER with the Unix version of -.IR man (1) +.MR man (1) when run inside a .I win (see -.IR acme (1)) +.MR acme (1) ) window. .SH SOURCE .B \*9/src/cmd/cat.c @@ -89,7 +89,7 @@ window. .br .B \*9/bin/nobs .SH SEE ALSO -.IR cp (1) +.MR cp (1) .SH DIAGNOSTICS .I Read exits with status diff --git a/man/man1/cleanname.1 b/man/man1/cleanname.1 index 02ad0baa..1f59e677 100644 --- a/man/man1/cleanname.1 +++ b/man/man1/cleanname.1 @@ -29,4 +29,4 @@ before processing. .SH SOURCE .B \*9/src/cmd/cleanname.c .SH SEE ALSO -.IR cleanname (3). +.MR cleanname (3) . diff --git a/man/man1/col.1 b/man/man1/col.1 index 1cdcbcba..77d4d46b 100644 --- a/man/man1/col.1 +++ b/man/man1/col.1 @@ -14,11 +14,11 @@ and half line feeds (ESC-9 and ESC-8) as produced by .I nroff for .2C in -.IR ms (7) +.MR ms (7) or -.IR man (7) +.MR man (7) and for -.IR tbl (1). +.MR tbl (1) . .I Col is a pure filter. It normally emits only full line feeds; @@ -47,7 +47,7 @@ paginate the output. .SH SOURCE .B \*9/src/cmd/col.c .SH SEE ALSO -.IR pr (1) +.MR pr (1) .SH BUGS .I Col can't back up more than 128 lines or diff --git a/man/man1/colors.1 b/man/man1/colors.1 index 9e850621..b85f3d8b 100644 --- a/man/man1/colors.1 +++ b/man/man1/colors.1 @@ -17,13 +17,13 @@ colors, cmapcube \- display color map .I Colors presents a grid showing the colors in the RGBV color map (see -.IR color (7)). +.MR color (7) ). .PP Clicking mouse button 1 over a color in the grid will display the map index for that color, its red, green, and blue components, and the 32-bit hexadecimal color value as defined in -.IR allocimage (3). +.MR allocimage (3) . If the .B -x option is specified, the components will also be listed in hexadecimal. @@ -53,4 +53,4 @@ to black or white. .SH SOURCE .B \*9/src/cmd/draw/colors.c .SH SEE ALSO -.IR color (7) +.MR color (7) diff --git a/man/man1/comm.1 b/man/man1/comm.1 index 1e5d24dc..86d4c34a 100644 --- a/man/man1/comm.1 +++ b/man/man1/comm.1 @@ -41,7 +41,7 @@ Print lines common to two sorted files. .SH SOURCE .B \*9/src/cmd/comm.c .SH "SEE ALSO" -.IR sort (1), +.MR sort (1) , .IR cmp (1), .IR diff (1), -.IR uniq (1) +.MR uniq (1) diff --git a/man/man1/core.1 b/man/man1/core.1 index 51d235fb..caf6351b 100644 --- a/man/man1/core.1 +++ b/man/man1/core.1 @@ -35,7 +35,7 @@ The command, if run, prints a stack trace of the executing thread at the time of the core dump; see -.IR db (1). +.MR db (1) . .PP If no arguments are given, .I core @@ -50,6 +50,6 @@ searches the current directory. .SH SOURCE .B \*9/src/cmd/core.c .SH "SEE ALSO -.IR acid (1), -.IR db (1), -.IR core (5) +.MR acid (1) , +.MR db (1) , +.MR core (5) diff --git a/man/man1/crop.1 b/man/man1/crop.1 index 1df8bf91..c47afac6 100644 --- a/man/man1/crop.1 +++ b/man/man1/crop.1 @@ -53,9 +53,9 @@ crop, iconv \- frame, crop, and convert image .SH DESCRIPTION .I Crop reads an -.IR image (7) +.MR image (7) file (default standard input), crops it, and writes it as a compressed -.IR image (7) +.MR image (7) file to standard output. There are two ways to specify a crop, by color value or by geometry. They may be combined in a single run of @@ -65,7 +65,7 @@ in which case the color value crop will be done first. The .B -c option takes a red-green-blue triplet as described in -.IR color (3). +.MR color (3) . (For example, white is .B 255 @@ -118,7 +118,7 @@ changes the format of pixels in the image Pixels in the image are converted according to the channel descriptor .IR chandesc , (see -.IR image (7)). +.MR image (7) ). For example, to convert a 4-bit-per-pixel grey-scale image to an 8-bit-per-pixel color-mapped image, .I chandesc @@ -139,8 +139,8 @@ crop -c 255 255 255 -i -10 -b 255 150 150 imagefile > cropped .SH SOURCE .B \*9/src/cmd/draw/crop.c .SH SEE ALSO -.IR image (7), -.IR color (3) +.MR image (7) , +.MR color (3) .SH BUGS .I Iconv should be able to do Floyd-Steinberg error diffusion or dithering diff --git a/man/man1/date.1 b/man/man1/date.1 index 10db8dfe..7d68b94f 100644 --- a/man/man1/date.1 +++ b/man/man1/date.1 @@ -28,7 +28,7 @@ epoch, 00:00:00 GMT, January 1, 1970. The conversion from Greenwich Mean Time to local time depends on the .B $timezone environment variable; see -.IR ctime (3). +.MR ctime (3) . .PP If the optional argument .I seconds diff --git a/man/man1/db.1 b/man/man1/db.1 index 03355508..5c2cc9db 100644 --- a/man/man1/db.1 +++ b/man/man1/db.1 @@ -45,11 +45,11 @@ specifies the memory image of a process. A .I pid gives the id of an executing process to be accessed via -.IR ptrace (2). +.MR ptrace (2) . A .I corefile specifies the name of a core dump (see -.IR core (5) +.MR core (5) on your system of choice) containing the memory image of a terminated process. This manual refers to the memory image specified by @@ -628,7 +628,7 @@ Dot is assigned to the variable or register named. .TP .B ! The rest of the line is passed to -.IR rc (1) +.MR rc (1) for execution. .TP .BI $ modifier @@ -969,8 +969,8 @@ is one the breakpoint will fire. Beware that local variables may be stored in registers; see the BUGS section. .SH "SEE ALSO" -.IR acid (1), -.IR core (1) +.MR acid (1) , +.MR core (1) .SH SOURCE .B \*9/src/cmd/db .SH DIAGNOSTICS diff --git a/man/man1/dc.1 b/man/man1/dc.1 index 5394580a..70597dcc 100644 --- a/man/man1/dc.1 +++ b/man/man1/dc.1 @@ -235,8 +235,8 @@ lyx .SH SOURCE .B \*9/src/cmd/dc.c .SH "SEE ALSO" -.IR bc (1), -.IR hoc (1) +.MR bc (1) , +.MR hoc (1) .SH DIAGNOSTICS .I x .LR "is unimplemented" , diff --git a/man/man1/dd.1 b/man/man1/dd.1 index 63b35e14..6e942fd8 100644 --- a/man/man1/dd.1 +++ b/man/man1/dd.1 @@ -191,7 +191,7 @@ options become a simple file copy. .SH SOURCE .B \*9/src/cmd/dd.c .SH "SEE ALSO" -.IR cp (1) +.MR cp (1) .SH DIAGNOSTICS .I Dd reports the number of full + partial input and output diff --git a/man/man1/deroff.1 b/man/man1/deroff.1 index 9d159f9e..1489aadd 100644 --- a/man/man1/deroff.1 +++ b/man/man1/deroff.1 @@ -16,13 +16,13 @@ reads each file in sequence and removes all .I nroff and -.IR troff (1) +.MR troff (1) requests and non-text arguments, backslash constructions, and constructs of preprocessors such as -.IR eqn (1), -.IR pic (1), +.MR eqn (1) , +.MR pic (1) , and -.IR tbl (1). +.MR tbl (1) . Remaining text is written on the standard output. .I Deroff follows files included by @@ -67,7 +67,7 @@ requests. Remove titles, attachments, etc., as well as ordinary .IR troff constructs, from -.IR ms (7) +.MR ms (7) or .I mm documents. @@ -84,7 +84,7 @@ does for and .I latex (see -.IR tex (1)) +.MR tex (1) ) files what .B deroff -wi does for @@ -96,8 +96,8 @@ files. .B \*9/src/cmd/delatex.lx .SH "SEE ALSO" .IR troff (1), -.IR tex (1), -.IR spell (1) +.MR tex (1) , +.MR spell (1) .SH BUGS These filters are not complete interpreters of .I troff diff --git a/man/man1/devdraw.1 b/man/man1/devdraw.1 index 009f5a94..da36b8e2 100644 --- a/man/man1/devdraw.1 +++ b/man/man1/devdraw.1 @@ -5,7 +5,7 @@ devdraw \- draw device simulator invoked via .I initdraw (see -.IR graphics (3)) +.MR graphics (3) ) .SH DESCRIPTION .I Devdraw serves a custom graphics protocol and is the only program @@ -20,9 +20,9 @@ to use all available physical pixels on a retina display. .SH SOURCE .B \*9/src/cmd/devdraw .SH "SEE ALSO -.IR draw (3), -.IR drawfcall (3), -.IR graphics (3) +.MR draw (3) , +.MR drawfcall (3) , +.MR graphics (3) .SH BUGS .I Devdraw should probably present a standard 9P server diff --git a/man/man1/dial.1 b/man/man1/dial.1 index 7fc50bcd..0245ba16 100644 --- a/man/man1/dial.1 +++ b/man/man1/dial.1 @@ -12,7 +12,7 @@ dial \- connect to a remote service connects to the network address .I addr (see -.IR dial (3)) +.MR dial (3) ) and then copies data from the connection to standard output, and from standard input to the connection. .PP @@ -27,4 +27,4 @@ to exit only in response to end of file on the network connection. .SH SOURCE .B \*9/src/cmd/dial.c .SH SEE ALSO -.IR dial (3) +.MR dial (3) diff --git a/man/man1/dict.1 b/man/man1/dict.1 index d382acc4..f4654ea3 100644 --- a/man/man1/dict.1 +++ b/man/man1/dict.1 @@ -53,7 +53,7 @@ Print a pronunciation key. .PD .PP Patterns are regular expressions (see -.IR regexp (7)), +.MR regexp (7) ), with an implicit leading .L ^ and trailing @@ -154,7 +154,7 @@ searches for dictionaries in the directory named by .PP .I Adict is a dictionary browser for -.IR acme (1). +.MR acme (1) . When run with no arguments, it creates a new .I acme window named @@ -193,7 +193,7 @@ window. dictionaries .PD .SH "SEE ALSO" -.IR regexp (7) +.MR regexp (7) .SH SOURCE .B \*9/src/cmd/dict .br diff --git a/man/man1/diff.1 b/man/man1/diff.1 index fd42643d..c92f45ef 100644 --- a/man/man1/diff.1 +++ b/man/man1/diff.1 @@ -19,7 +19,7 @@ two directories are compared by the method of .I diff for text files and -.IR cmp (1) +.MR cmp (1) otherwise. If more than two file names are given, then each argument is compared to the last argument as above. @@ -140,9 +140,9 @@ differences. .SH SOURCE .B \*9/src/cmd/diff .SH "SEE ALSO" -.IR cmp (1), -.IR comm (1), -.IR ed (1) +.MR cmp (1) , +.MR comm (1) , +.MR ed (1) .SH DIAGNOSTICS Exit status is the empty string for no differences, diff --git a/man/man1/doctype.1 b/man/man1/doctype.1 index da33653a..199323f0 100644 --- a/man/man1/doctype.1 +++ b/man/man1/doctype.1 @@ -17,16 +17,16 @@ doctype \- intuit command line for formatting a document .SH DESCRIPTION .I Doctype examines a -.IR troff (1) +.MR troff (1) input file to deduce the appropriate text formatting command and prints it on standard output. .I Doctype recognizes input for -.IR troff (1), +.MR troff (1) , related preprocessors like -.IR eqn (1), +.MR eqn (1) , and the -.IR ms (7) +.MR ms (7) and .I mm macro packages. @@ -56,8 +56,8 @@ Typeset files named .IR eqn (1), .IR tbl (1), .IR pic (1), -.IR grap (1), -.IR ms (7), -.IR man (7) +.MR grap (1) , +.MR ms (7) , +.MR man (7) .SH BUGS In true A.I. style, its best guesses are inspired rather than accurate. diff --git a/man/man1/ed.1 b/man/man1/ed.1 index 41071c7e..8dd6f535 100644 --- a/man/man1/ed.1 +++ b/man/man1/ed.1 @@ -96,7 +96,7 @@ beginning of a line. supports the .I "regular expression" notation described in -.IR regexp (7). +.MR regexp (7) . Regular expressions are used in addresses to specify lines and in one command (see @@ -641,7 +641,7 @@ Dot is unchanged. Send the remainder of the line after the .L ! to -.IR rc (1) +.MR rc (1) to be interpreted as a command. Dot is unchanged. .TP @@ -679,9 +679,9 @@ and all characters after the last newline. .SH SOURCE .B \*9/src/cmd/ed.c .SH "SEE ALSO" -.IR sam (1), -.IR sed (1), -.IR regexp (7) +.MR sam (1) , +.MR sed (1) , +.MR regexp (7) .SH DIAGNOSTICS .BI ? name for inaccessible file; diff --git a/man/man1/eqn.1 b/man/man1/eqn.1 index bf4bac68..e50a500d 100644 --- a/man/man1/eqn.1 +++ b/man/man1/eqn.1 @@ -15,7 +15,7 @@ eqn \- typeset mathematics .SH DESCRIPTION .I Eqn is a -.IR troff (1) +.MR troff (1) preprocessor for typesetting mathematics on a typesetter. @@ -34,7 +34,7 @@ named in the option (default .BR -Tutf ; see -.IR troff (1)). +.MR troff (1) ). When run with other preprocessor filters, .I eqn usually comes last. @@ -299,7 +299,7 @@ Mathematical words like .LR cos , .L log are made Roman automatically. -.IR Troff (1) +.MR Troff (1) four-character escapes like .L \e(lh (\(lh) can be used anywhere. @@ -319,7 +319,7 @@ font descriptions for PostScript .B \*9/src/cmd/eqn .SH "SEE ALSO" .IR troff (1), -.IR tbl (1) +.MR tbl (1) .br J. F. Ossanna and B. W. Kernighan, ``Troff User's Manual''. diff --git a/man/man1/freq.1 b/man/man1/freq.1 index cbbd4152..4a55130a 100644 --- a/man/man1/freq.1 +++ b/man/man1/freq.1 @@ -36,5 +36,5 @@ character, respectively. .SH SOURCE .B \*9/src/cmd/freq.c .SH SEE ALSO -.IR utf (7), -.IR wc (1) +.MR utf (7) , +.MR wc (1) diff --git a/man/man1/git.1 b/man/man1/git.1 index 9b29b512..8387407a 100644 --- a/man/man1/git.1 +++ b/man/man1/git.1 @@ -1,5 +1,5 @@ .TH GIT 1 -.SH NAME +.SH NAME git, hg, cvs, codereview \- introduction to using plan9port Git repository .SH SYNOPSIS .B git @@ -17,7 +17,7 @@ git, hg, cvs, codereview \- introduction to using plan9port Git repository .I path ... ] .PP -.B gitk +.B gitk .PP .B web .B https://9fans.github.io/plan9port @@ -37,13 +37,13 @@ which it will create. After .B git .BR clone , -the other commands listed +the other commands listed should be run within the .B plan9 directory tree. .PP Git downloads the entire revision history -of Plan 9 from User Space +of Plan 9 from User Space in addition to the current tree. .PP .I Git @@ -55,7 +55,7 @@ current file tree. .I Git .I diff runs Unix's -.IR diff (1) +.MR diff (1) to compare the files in the local tree with the corresponding files in the revision history. The special revision @@ -76,7 +76,7 @@ directory containing Git local repository list of files and wildcards to exclude from Git operations .SH SEE ALSO Unix's -\fIgit\fR(1), +.IR git (1), .HR http://git-scm.com/doc .PP .HR https://9fans.github.io/plan9port/ diff --git a/man/man1/grap.1 b/man/man1/grap.1 index beda727d..d36916dc 100644 --- a/man/man1/grap.1 +++ b/man/man1/grap.1 @@ -9,7 +9,7 @@ grap \- pic preprocessor for drawing graphs .SH DESCRIPTION .I Grap is a -.IR pic (1) +.MR pic (1) preprocessor for drawing graphs on a typesetter. Graphs are surrounded by the .I troff @@ -407,7 +407,7 @@ definitions of standard plotting characters, e.g., bullet .B \*9/src/cmd/grap .SH "SEE ALSO" .IR pic (1), -.IR troff (1) +.MR troff (1) .br J. L. Bentley and B. W. Kernighan, ``GRAP\(emA Language for Typesetting Graphs'', diff --git a/man/man1/graph.1 b/man/man1/graph.1 index bb6d25da..f8a1e088 100644 --- a/man/man1/graph.1 +++ b/man/man1/graph.1 @@ -89,7 +89,7 @@ The next argument is Next argument is one or more of the characters .B bcgkmrwy, choosing pen colors by their initial letter, as in -.IR plot (7). +.MR plot (7) . Successive curves will cycle through the colors in the given order. .TP .B -s @@ -145,7 +145,7 @@ is reversed. .B \*9/src/cmd/graph .SH "SEE ALSO" .IR plot (1), -.IR grap (1) +.MR grap (1) .SH BUGS Segments that run out of bounds are dropped, not windowed. Logarithmic axes may not be reversed. diff --git a/man/man1/grep.1 b/man/man1/grep.1 index 23890621..5fe3a9f7 100644 --- a/man/man1/grep.1 +++ b/man/man1/grep.1 @@ -27,7 +27,7 @@ searches the input for lines that match the .IR pattern , a regular expression as defined in -.IR regexp (7) +.MR regexp (7) with the addition of a newline character as an alternative (substitute for .BR | ) @@ -114,11 +114,11 @@ If no files are listed, it searches all files matching .br .B \*9/bin/g .SH SEE ALSO -.IR ed (1), -.IR awk (1), -.IR sed (1), -.IR sam (1), -.IR regexp (7) +.MR ed (1) , +.MR awk (1) , +.MR sed (1) , +.MR sam (1) , +.MR regexp (7) .SH DIAGNOSTICS Exit status is null if any lines are selected, or non-null when no lines are selected or an error occurs. diff --git a/man/man1/gview.1 b/man/man1/gview.1 index 6b0be4c7..8961b625 100644 --- a/man/man1/gview.1 +++ b/man/man1/gview.1 @@ -144,7 +144,7 @@ awk 'BEGIN{for(x=.1;x<500;x+=.1)print x,sin(x)/x}' | gview .SH SOURCE .B \*9/src/cmd/draw/gview.c .SH SEE ALSO -.IR awk (1) +.MR awk (1) .SH BUGS The user interface for the .I slant diff --git a/man/man1/gzip.1 b/man/man1/gzip.1 index 683ba3a5..2f78c89f 100644 --- a/man/man1/gzip.1 +++ b/man/man1/gzip.1 @@ -150,8 +150,8 @@ Produce debugging output. .br .B \*9/src/cmd/bzip2 .SH SEE ALSO -.IR tar (1), -.IR compress (1) +.MR tar (1) , +.MR compress (1) .SH BUGS .I Unzip can only extract files which are uncompressed or compressed diff --git a/man/man1/hist.1 b/man/man1/hist.1 index 82175e7e..bec129a8 100644 --- a/man/man1/hist.1 +++ b/man/man1/hist.1 @@ -41,7 +41,7 @@ option enables verbose debugging printout. The .B -d option causes -.IR diff (1) +.MR diff (1) .B -c to be run for each adjacent pair of dump files, while .B -b @@ -73,11 +73,11 @@ by convention, root of dump file system .SH SOURCE .B \*9/src/cmd/hist.c .SH SEE ALSO -.IR yesterday (1), -.IR vbackup (8) +.MR yesterday (1) , +.MR vbackup (8) .SH BUGS Should be called .IR history , but that name is taken by -.IR sh (1). +.MR sh (1) . diff --git a/man/man1/hoc.1 b/man/man1/hoc.1 index f73ec8a8..24075b0b 100644 --- a/man/man1/hoc.1 +++ b/man/man1/hoc.1 @@ -133,8 +133,8 @@ for(i=1; i<12; i++) print gcd(i,12) .SH SOURCE .B \*9/src/cmd/hoc .SH "SEE ALSO" -.IR bc (1), -.IR dc (1) +.MR bc (1) , +.MR dc (1) .br B. W. Kernighan and R. Pike, .I diff --git a/man/man1/htmlroff.1 b/man/man1/htmlroff.1 index 4dff65c8..197c2f04 100644 --- a/man/man1/htmlroff.1 +++ b/man/man1/htmlroff.1 @@ -21,7 +21,7 @@ htmlroff \- HTML formatting and typesetting .SH DESCRIPTION .I Htmlroff accepts -.IR troff (1) +.MR troff (1) input in the named .I files and formats it as HTML for viewing in a web browser. @@ -63,7 +63,7 @@ HTML entity sequences and so on). .I Htmlroff invokes -.IR tcs (1) +.MR tcs (1) for the conversion. .TP .B -v @@ -73,7 +73,7 @@ Generate debugging output and warnings about suspicious input. Most .I troff input files, especially those using the -.IR ms (7) +.MR ms (7) macros, can be used unaltered. In general, the macro file .B tmac.html @@ -83,10 +83,10 @@ as in .B -ms .BR -mhtml . .PP -.IR Htmlroff (7) +.MR Htmlroff (7) describes the changes to the input language. .PP -.IR Mhtml (7) +.MR Mhtml (7) describes the new macros. .SH EXAMPLES Format the Plan 9 web page: @@ -113,7 +113,7 @@ to Unicode characters like α. .SH SOURCE .B \*9/src/cmd/htmlroff .SH "SEE ALSO -.IR tcs (1), -.IR troff (1), -.IR htmlroff (7), -.IR mhtml (7) +.MR tcs (1) , +.MR troff (1) , +.MR htmlroff (7) , +.MR mhtml (7) diff --git a/man/man1/idiff.1 b/man/man1/idiff.1 index e8d37615..49a2df6b 100644 --- a/man/man1/idiff.1 +++ b/man/man1/idiff.1 @@ -50,7 +50,7 @@ and prompt again. .PP .I Idiff invokes -.IR diff (1) +.MR diff (1) to compare the files. The .B -b @@ -66,7 +66,7 @@ passed to .SH SOURCE .B \*9/src/cmd/idiff.c .SH "SEE ALSO -.IR diff (1) +.MR diff (1) .br Kernighan and Pike, .IR "The Unix Programming Environment" , diff --git a/man/man1/install.1 b/man/man1/install.1 index 17411af2..66f780c7 100644 --- a/man/man1/install.1 +++ b/man/man1/install.1 @@ -15,7 +15,7 @@ cd \*9; ./INSTALL .SH DESCRIPTION To obtain the Plan 9 tree, use Git (see -.IR git (1)) +.MR git (1) ) or download a tar file from .HR https://9fans.github.io/plan9port "" . .PP @@ -25,7 +25,7 @@ usual place is In the root of the tree, run .BR ./INSTALL . This script builds the Plan 9 build program -.IR mk (1) +.MR mk (1) if necessary, cleans all previously built object files and libraries out of the tree, rebuilds and installs everything, and then cleans up. @@ -101,7 +101,7 @@ with single quotes. .PP On most Linux systems, the X11 header packages need to be installed to build using X11. On Debian. the required packages are -libx11-dev, libxext-dev, and libxt-dev. +libfontconfig1-dev, libx11-dev, libxext-dev, and libxt-dev. On Ubuntu, it suffices to install xorg-dev. .PP .I INSTALL @@ -109,7 +109,7 @@ can safely be repeated to rebuild the system from scratch. .PP Once the system is built for the first time, it can be maintained and rebuilt using -.IR mk (1). +.MR mk (1) . To rebuild individual commands or libraries, run .B mk @@ -119,7 +119,7 @@ and .B clean in the appropriate source directory (see -.IR src (1)). +.MR src (1) ). .SH FILES .TP .B \*9/lib/moveplan9.files @@ -132,7 +132,7 @@ the script that edits the files .TP .B \*9/src/mkmk.sh the shell script used to build -.IR mk (1) +.MR mk (1) .TP .B \*9/dist/manweb the shell script that builds the HTML manual @@ -148,5 +148,5 @@ logged output from the last run of a summary of .B install.log .SH SEE ALSO -.IR intro (1), -.IR git (1) +.MR intro (1) , +.MR git (1) diff --git a/man/man1/join.1 b/man/man1/join.1 index 1c0ec9f9..f9c9d543 100644 --- a/man/man1/join.1 +++ b/man/man1/join.1 @@ -114,7 +114,7 @@ birthdays empty. The layout of .B /adm/users is given in -.IR passwd (5); +.MR passwd (5) ; .B bdays contains sorted lines like .LR "ken:Feb\ 4,\ 1953" . @@ -132,7 +132,7 @@ Print all pairs of users with identical userids. .SH "SEE ALSO" .IR sort (1), .IR comm (1), -.IR awk (1) +.MR awk (1) .SH BUGS With default field separation, the collating sequence is that of diff --git a/man/man1/jpg.1 b/man/man1/jpg.1 index a59033b6..03767221 100644 --- a/man/man1/jpg.1 +++ b/man/man1/jpg.1 @@ -122,7 +122,7 @@ Typing a .BR q , DEL, or control-D exits the program. For a more user-friendly interface, use -.IR page (1), +.MR page (1) , which invokes these programs to convert the images to standard format, displays them, and offers scrolling, panning, and menu-driven navigation among the files. .PP @@ -147,7 +147,7 @@ any of the following options: .TP .B -c Convert the image to a Plan 9 representation, as defined by -.IR image (7), +.MR image (7) , and write it to standard output. .TP .B -9 @@ -156,7 +156,7 @@ Like but produce an uncompressed image. This saves processing time, particularly when the output is being piped to another program such as -.IR page (1), +.MR page (1) , since it avoids compression and decompression. .TP .B -t @@ -235,8 +235,8 @@ space in the image. The icon file is written to standard output. .SH SOURCE .B \*9/src/cmd/jpg .SH "SEE ALSO" -.IR page (1), -.IR image (7). +.MR page (1) , +.MR image (7) . .SH BUGS Writing an animated GIF using .I togif diff --git a/man/man1/kill.1 b/man/man1/kill.1 index 5b61d8a1..f82b4877 100644 --- a/man/man1/kill.1 +++ b/man/man1/kill.1 @@ -19,18 +19,18 @@ prints commands that will cause all processes with .I name and owned by the current user to be terminated. Each command is commented with an output line from -.IR ps (1) +.MR ps (1) describing the process that would be killed. Use the .B send command of -.IR 9term (1), +.MR 9term (1) , or pipe the output of .I kill into -.IR rc (1) +.MR rc (1) or -.IR sh (1) +.MR sh (1) to execute the commands. .PP .I Kill @@ -60,8 +60,8 @@ signal. .SH SOURCE .B \*9/bin .SH "SEE ALSO" -.IR ps (1), -.IR notify (3) +.MR ps (1) , +.MR notify (3) .SH BUGS .I Stop and diff --git a/man/man1/label.1 b/man/man1/label.1 index 1748b0be..6688972d 100644 --- a/man/man1/label.1 +++ b/man/man1/label.1 @@ -14,12 +14,12 @@ label, awd \- set window label sets the label of the current .I win (see -.IR acme (1)) +.MR acme (1) ) or X terminal window .RI ( e.g., -.IR 9term (1) +.MR 9term (1) or -.IR xterm (1)) +.MR xterm (1) ) by echoing a special control sequence to standard output. .PP .I Acme @@ -38,7 +38,7 @@ sets the window name to the current directory with a suffix, using the name of the current system by default. .SH EXAMPLE One can use the following -.IR sh (1) +.MR sh (1) function to keep the label up-to-date in response to .I cd commands: @@ -55,7 +55,7 @@ alias cd=_cd cd . .EE .PP -.IR Rc (1) +.MR Rc (1) installs a similar .B fn .B cd @@ -77,4 +77,4 @@ fn cd { .SH BUGS .I Awd is also documented in -.IR acme (1). +.MR acme (1) . diff --git a/man/man1/lex.1 b/man/man1/lex.1 index 6955e791..a740c2e8 100644 --- a/man/man1/lex.1 +++ b/man/man1/lex.1 @@ -65,7 +65,7 @@ output template .SH "SEE ALSO" .IR yacc (1), -.IR sed (1) +.MR sed (1) .br M. E. Lesk and E. Schmidt, `LEX\(emLexical Analyzer Generator', diff --git a/man/man1/look.1 b/man/man1/look.1 index 02d2cb4b..731d616e 100644 --- a/man/man1/look.1 +++ b/man/man1/look.1 @@ -74,7 +74,7 @@ is assumed, with collating sequence .B \*9/src/cmd/look.c .SH "SEE ALSO" .IR sort (1), -.IR grep (1) +.MR grep (1) .SH DIAGNOSTICS The exit status is .RB `` "not found" '' diff --git a/man/man1/ls.1 b/man/man1/ls.1 index edaf11cf..863f8e22 100644 --- a/man/man1/ls.1 +++ b/man/man1/ls.1 @@ -29,7 +29,7 @@ is the same as but sets the .B -p option and pipes the output through -.IR mc (1). +.MR mc (1) . .PP There are a number of options: .TP @@ -42,7 +42,7 @@ List in long format, giving mode (see below), file system type (e.g., for devices, the .B # code letter that names it; see -.IR intro (3)), +.MR intro (3) ), the instance or subdevice number, owner, group, size in bytes, and time of last modification for each file. @@ -60,7 +60,7 @@ Print only the final path element of each file name. List the .I qid (see -.IR stat (3)) +.MR stat (3) ) of each file; the printed fields are in the order path, version, and type. .TP @@ -99,7 +99,7 @@ otherwise. .TP .B -Q By default, printed file names are quoted if they contain characters special to -.IR rc (1). +.MR rc (1) . The .B -Q flag disables this behavior. @@ -168,5 +168,5 @@ if none of the above permissions is granted. .br .B \*9/bin/lc .SH SEE ALSO -.IR stat (3), -.IR mc (1) +.MR stat (3) , +.MR mc (1) diff --git a/man/man1/man.1 b/man/man1/man.1 index ec35b7ad..2fc8c1f5 100644 --- a/man/man1/man.1 +++ b/man/man1/man.1 @@ -45,7 +45,7 @@ The options are: .TP .B -h Print the pages to HTML and send to a web browser with -.IR web (1). +.MR web (1) . .TP .B -n (Default) @@ -54,17 +54,17 @@ Print the pages on the standard output using .TP .B -p Run -.IR proof (1) +.MR proof (1) on the specified man pages. .TP .B -P Run -.IR page (1) +.MR page (1) on the specified man pages. .TP .B -t Run -.IR troff (1) +.MR troff (1) and send its output to standard output. .TP @@ -106,8 +106,8 @@ index for .br .B \*9/bin/lookman .SH "SEE ALSO" -.IR page (1), -.IR proof (1) +.MR page (1) , +.MR proof (1) .SH BUGS The manual was intended to be typeset; some detail is sacrificed on text terminals. .PP diff --git a/man/man1/map.1 b/man/man1/map.1 index c0320021..d526aa48 100644 --- a/man/man1/map.1 +++ b/man/man1/map.1 @@ -305,7 +305,7 @@ tracks appear as dot-dashed lines if the plotting filter supports them.) The .I file contains -.IR plot (7)-style +.MR plot (7) -style data for .L : or @@ -640,7 +640,7 @@ Map driver program .B \*9/src/cmd/map .SH "SEE ALSO" .IR map (7), -.IR plot (1) +.MR plot (1) .SH DIAGNOSTICS `Map seems to be empty'\(ema coarse survey found zero extent within the diff --git a/man/man1/mc.1 b/man/man1/mc.1 index e914cbab..627202be 100644 --- a/man/man1/mc.1 +++ b/man/man1/mc.1 @@ -18,10 +18,10 @@ splits the input into as many columns as will fit in .I N print positions. If run in a -.IR 9term (1), -.IR xterm (1), +.MR 9term (1) , +.MR xterm (1) , or -.IR acme (1) +.MR acme (1) window, the default .I N is the number of blanks that will fit across the window; @@ -36,14 +36,14 @@ is printed separately. .SH SOURCE .B \*9/src/cmd/draw/mc.c .SH "SEE ALSO" -.IR 9term (1), -.IR acme (1), -.IR acme (4), -.IR xterm (1), -.IR pr (1), +.MR 9term (1) , +.MR acme (1) , +.MR acme (4) , +.MR xterm (1) , +.MR pr (1) , .I lc in -.IR ls (1) +.MR ls (1) .SH BUGS On systems with high-DPI screens, .I 9term diff --git a/man/man1/mk.1 b/man/man1/mk.1 index 0698ef5b..4c3d2b70 100644 --- a/man/man1/mk.1 +++ b/man/man1/mk.1 @@ -29,7 +29,7 @@ contains a .I rule for each target that identifies the files and other targets upon which it depends and an -.IR sh (1) +.MR sh (1) script, a .IR recipe , to update the target. @@ -157,7 +157,7 @@ In the recipe of a meta-rule, the environment variable contains the string matched by the .BR % . For example, a meta-rule to compile a C program using -.IR 9c (1) +.MR 9c (1) might be: .IP .EX @@ -207,7 +207,7 @@ References to variables are replaced by the variables' values. Special characters may be quoted using single quotes .BR \&'' as in -.IR sh (1). +.MR sh (1) . .PP Assignments and rules are distinguished by the first unquoted occurrence of @@ -246,7 +246,7 @@ A legal reference of the form or .B ${name} is expanded as in -.IR sh (1). +.MR sh (1) . A reference of the form .BI ${name: A % B = C\fL%\fID\fL}\fR, where @@ -315,9 +315,9 @@ or .BR rcsh , .I mk uses -.IR rc (1)'s +.MR rc (1) 's quoting rules; otherwise it uses -.IR sh (1)'s. +.MR sh (1) 's. The .B MKSHELL variable is consulted when the mkfile is read, not when it is executed, @@ -523,7 +523,7 @@ of the aggregate Currently, the only aggregates supported are .I 9ar (see -.IR 9c (1)) +.MR 9c (1) ) archives. .SS Attributes The colon separating the target from the prerequisites @@ -567,12 +567,12 @@ In the rule, .B % has no special meaning. The target is interpreted as a regular expression as defined in -.IR regexp (7). +.MR regexp (7) . The prerequisites may contain references to subexpressions in form .BI \e n\f1, as in the substitute command of -.IR sed (1). +.MR sed (1) . .TP .B U The targets are considered to have been updated @@ -625,7 +625,7 @@ Regular expression meta-rules: .EE .PP A correct way to deal with -.IR yacc (1) +.MR yacc (1) grammars. The file .B lex.c @@ -656,8 +656,8 @@ x.tab.h:Pcmp -s: y.tab.h .SH SOURCE .B \*9/src/cmd/mk .SH SEE ALSO -.IR sh (1), -.IR regexp (7) +.MR sh (1) , +.MR regexp (7) .PP A. Hume, ``Mk: a Successor to Make'' diff --git a/man/man1/mk9660.1 b/man/man1/mk9660.1 index 0d655cf0..4f78bd27 100644 --- a/man/man1/mk9660.1 +++ b/man/man1/mk9660.1 @@ -71,11 +71,11 @@ the current directory). The .I proto file is formatted as described in -.IR proto (3). +.MR proto (3) . .PP The created CD image will be in ISO-9660 format, but by default the file names will -be stored in UTF-8 with no imposed length +be stored in UTF-8 with no imposed length or character restrictions. The .B -c @@ -84,7 +84,7 @@ flag causes to use only file names in ``8.3'' form that use digits, letters, and underscore. File names that do not conform are changed -to +to .BI D nnnnnn (for directories) or @@ -122,7 +122,7 @@ and .B \e are allowed in Plan 9 file names but not in Joliet file names; non-conforming file names are translated -and a +and a .B _CONFORM.MAP file written as in the case of the @@ -133,7 +133,7 @@ If the .B -r flag is given, Rock Ridge extensions are written in the format of the system use sharing protocol; -this format provides Posix-style file metadata and is +this format provides Posix-style file metadata and is common on Unix platforms. .PP The options @@ -155,13 +155,13 @@ if unspecified, the base name of .I proto is used. .PP -The +The .B -: -flag causes +flag causes .B mk9660 to replace colons in scanned file names with spaces; this is the inverse of the map applied by Plan 9's -\fIdossrv\fR(4) +.IR dossrv (4) and is useful for writing Joliet CDs containing data from FAT file systems. .PP @@ -189,10 +189,11 @@ on standard error. is similar in specification to .I mk9660 but creates and updates backup CD images in the style of -the +the .I dump file system -(see Plan 9's \fIfs\fR(4)). +(see Plan 9's +.IR fs (4)). The dump is file-based rather than block-based: if a file's contents have not changed since the last backup, only its directory entry will be rewritten. @@ -202,7 +203,7 @@ The option specifies a time (in seconds since January 1, 1970) to be used for naming the dump directory. .PP -The +The .B -m option specifies a maximum size for the image; if a backup would cause the image to grow larger than @@ -212,7 +213,7 @@ it will not be written, and will exit with a non-empty status. .SH EXAMPLE .PP -Create an image of the Plan 9 source tree, +Create an image of the Plan 9 source tree, including a conformant ISO-9660 directory tree, Plan 9 extensions in the system use fields, and a Joliet directory tree. @@ -223,7 +224,7 @@ mk9660 -9cj -s /n/bootes -p srcproto cdimage .SH SOURCE \*9/src/cmd/9660 .SH "SEE ALSO -.IR proto (3) +.MR proto (3) .\" .SH "SEE ALSO" .\" .I 9660srv .\" (in diff --git a/man/man1/mkdir.1 b/man/man1/mkdir.1 index e658847c..b91ba22e 100644 --- a/man/man1/mkdir.1 +++ b/man/man1/mkdir.1 @@ -28,11 +28,11 @@ The flag sets the permissions to be used when creating the directory. The default is 0777. .SH "SEE ALSO" -.IR rm (1) +.MR rm (1) .br .IR cd in -.IR rc (1) +.MR rc (1) .SH SOURCE .B \*9/src/cmd/mkdir.c .SH DIAGNOSTICS diff --git a/man/man1/mount.1 b/man/man1/mount.1 index ec9f016e..123a395a 100644 --- a/man/man1/mount.1 +++ b/man/man1/mount.1 @@ -15,7 +15,7 @@ mounts a 9P server's files into the file system. is typically either the name of a Unix domain socket (see -.IR namespace (1)) +.MR namespace (1) ) or the name or IP address of a machine serving 9P over TCP port 564. .PP @@ -29,7 +29,7 @@ On Linux, .I mount uses the native 9P kernel module when present. Otherwise it tries to use -.IR 9pfuse (4) +.MR 9pfuse (4) with the FUSE file system module. Using the 9P kernel module requires root access. FUSE can often be used by regular users. @@ -45,7 +45,7 @@ should be invoked as .BR mount . .SH EXAMPLES Mount -.IR acme (4) +.MR acme (4) onto .B /mnt/acme : .IP @@ -64,6 +64,6 @@ cat /mnt/plumb/rules .br .B \*9/bin/unmount .SH SEE ALSO -.IR intro (4), +.MR intro (4) , .IR intro (9p), -.IR 9pfuse (4) +.MR 9pfuse (4) diff --git a/man/man1/namespace.1 b/man/man1/namespace.1 index e02a6509..7015ca25 100644 --- a/man/man1/namespace.1 +++ b/man/man1/namespace.1 @@ -7,9 +7,9 @@ namespace \- print name space directory .I Namespace prints the directory representing the current name space. See -.IR intro (4). +.MR intro (4) . .SH SOURCE .B \*9/src/cmd/namespace.c .SH SEE ALSO -.IR getns (3), -.IR intro (4) +.MR getns (3) , +.MR intro (4) diff --git a/man/man1/ndb.1 b/man/man1/ndb.1 index b37509c0..4ce7616b 100644 --- a/man/man1/ndb.1 +++ b/man/man1/ndb.1 @@ -24,9 +24,9 @@ ndbquery, ndbmkhash, ndbmkdb, ndbipquery, ndbmkhosts \- network database The network database holds administrative information used by .I authdial (see -.IR authsrv (3)) +.MR authsrv (3) ) and -.IR secstored (1). +.MR secstored (1) . .PP .I Ndbquery searches the database for an attribute of type @@ -46,7 +46,7 @@ of all the matched entries is returned. uses .I ndbipinfo (see -.IR ndb (3)) +.MR ndb (3) ) to search for the values of the attributes .I rattr corresponding to the system @@ -382,7 +382,7 @@ and by the ndb library routines. .PP .I Ndbmkdb is used in concert with -.IR awk (1) +.MR awk (1) scripts to convert uucp systems files and IP host files into database files. @@ -395,7 +395,7 @@ it is necessary to run .I ndbmkhash whenever the files are modified. It may be profitable to control this by a frequent -.IR cron (8) +.MR cron (8) job. .PP .I Ndbmkhosts @@ -439,5 +439,5 @@ hash files for .SH SOURCE .B \*9/src/cmd/ndb .SH SEE ALSO -.IR ndb (3), -.IR ndb (7) +.MR ndb (3) , +.MR ndb (7) diff --git a/man/man1/netfiles.1 b/man/man1/netfiles.1 index 69f519b1..97f72c6f 100644 --- a/man/man1/netfiles.1 +++ b/man/man1/netfiles.1 @@ -21,7 +21,7 @@ Netfiles, netfileget, netfileput, netfilestat \- network file access inside acme .SH DESCRIPTION .B Netfiles presents remote file systems in -.IR acme (4) +.MR acme (4) windows. Each window is named .BI /n/ system / path @@ -35,7 +35,7 @@ reads names of windows to create from the plumbing channel .B netfileedit (see -.IR plumber (4) +.MR plumber (4) and the example section below). In a .IR netfiles -controlled @@ -60,13 +60,13 @@ The three first check to see if .I system is a service in the current name space (see -.IR intro (4)). +.MR intro (4) ). If so, they use -.IR 9p (1) +.MR 9p (1) to access it. Otherwise, they assume that the system is a network name and use -.IR ssh (1)'s +.MR ssh (1) 's .I sftp to access it. .PP @@ -100,7 +100,7 @@ or .SH EXAMPLES The following plumbing rule (see -.IR plumb (7)) +.MR plumb (7) ) passes .B /n/ paths to @@ -118,17 +118,17 @@ plumb client Netfiles .SH SOURCE .B \*9/src/cmd/netfiles .SH SEE ALSO -.IR 9p (1), -.IR ssh (1), -.IR ssh-agent (1), -.IR intro (4), -.IR acme (4), -.IR factotum (4), +.MR 9p (1) , +.MR ssh (1) , +.MR ssh-agent (1) , +.MR intro (4) , +.MR acme (4) , +.MR factotum (4) , .HR http://v9fs.sf.net .SH BUGS .I Netfiles depends on -.IR sftpcache (1), +.MR sftpcache (1) , which only works with OpenSSH versions 4.3 and earlier; later versions do not print the .B sftp> diff --git a/man/man1/page.1 b/man/man1/page.1 index 99fba2b3..8edefe26 100644 --- a/man/man1/page.1 +++ b/man/man1/page.1 @@ -1,7 +1,7 @@ .TH PAGE 1 .SH NAME -page \- view -FAX, +page \- view +FAX, image, graphic, PostScript, PDF, and typesetter output files @@ -24,23 +24,24 @@ It can be used to display the individual pages of a PostScript, PDF, -or -.IR troff (1) -or -Unix's \fItex\fR(1) +or +.MR troff (1) +or +Unix's +.IR tex (1) device-independent output file. .I Troff -or +or .I tex output is simply converted to PostScript in order to be viewed. It can also be used to view any number of graphics files -(such as a +(such as a FAX -page, +page, a Plan 9 -.IR image (7) +.MR image (7) file, an Inferno bitmap file, or other common format). .I Page displays these @@ -53,26 +54,26 @@ By default, .I page runs in the window in which it is started and leaves the window unchanged. -The +The .B -R -option causes -.I page +option causes +.I page to grow the window if necessary to display the page being viewed. The .B -w -option causes -.I page +option causes +.I page to create a new window for itself. The newly created window will grow as under the .B -R option. -If being used to display +If being used to display multipage documents, only one file may be specified on the command line. .PP -The -.B -p +The +.B -p option sets the resolution for PostScript and PDF files, in pixels per inch. The default is 100 ppi. @@ -85,13 +86,13 @@ When viewing a document, will try to guess the true bounding box, usually rounding up from the file's bounding box to 8½×11 or A4 size. -The +The .B -b option causes it to respect the bounding box given in the file. As a more general problem, some PostScript files claim to conform to Adobe's Document Structuring Conventions but do not. -The +The .B -P option enables a slightly slower and slightly more skeptical version of the PostScript processing code. @@ -101,34 +102,35 @@ that can only be viewed with the option, and there are PostScript documents that can only be viewed without it. .PP -When viewing images with +When viewing images with .IR page , -it listens to the +it listens to the .B image plumbing channel -(see -.IR plumber (4)) +(see +.MR plumber (4) ) for more images to display. -The +The .B -i -option causes +option causes .I page -to not load any graphics files nor to read +to not load any graphics files nor to read from standard input but rather to listen for ones to load from the plumbing channel. .PP -The +The .B -v option turns on extra debugging output, and the .B -V option turns on even more debugging output. -The +The .B -a -option causes +option causes .I page to call -Unix's \fIabort\fR(3) +Unix's +.IR abort (3) rather than exit cleanly on errors, to facilitate debugging. .PP @@ -145,7 +147,7 @@ The button 2 menu operations are: Restores the image to the original. All modifications are lost. .TP .B Zoom -Prompts the user to sweep a rectangle on the image which is +Prompts the user to sweep a rectangle on the image which is expanded proportionally to the rectangle. .TP .B Fit window @@ -164,7 +166,7 @@ Displays the next page. Displays the previous page. .TP .B Zerox -Displays the current image in a new page window. +Displays the current image in a new page window. Useful for selecting important pages from large documents. .TP .B Reverse @@ -189,14 +191,14 @@ toggles whether images are displayed upside-down. Typing a .B r reverses the order in which pages are displayed. -Typing a +Typing a .B w will write the currently viewed page to a new file as a compressed -.IR image (7) +.MR image (7) file. When possible, the filename is of the form .IR basename . pagenum . bit . -Typing a +Typing a .B d removes an image from the working set. .PP @@ -208,13 +210,14 @@ changing pages when panning off the top or bottom of the page. .PP .I Page calls -Unix's \fIgs\fR(1) +Unix's +.IR gs (1) to draw each page of PostScript and PDF .IR files . It also calls a variety of conversion programs, such as those described in -.IR jpg (1), +.MR jpg (1) , to convert the various raster graphics formats into Inferno bitmap files. Pages are converted ``on the fly,'' as needed. @@ -232,11 +235,11 @@ Browse the Inferno bitmap library. man -t page | page -w Preview this manual in a new window. .SH "SEE ALSO -.IR gs (1), -.IR jpg (1), -.IR proof (1), -.IR tex (1), -.IR troff (1) +.MR gs (1) , +.MR jpg (1) , +.MR proof (1) , +.MR tex (1) , +.MR troff (1) .SH SOURCE .B \*9/src/cmd/page .SH DIAGNOSTICS @@ -254,19 +257,19 @@ When viewing multipage PostScript files that do not contain .RB `` %%Page '' comments, the button 3 menu only contains ``this page'' and ``next page'': -correctly determining +correctly determining page boundaries in Postscript code is not computable in the general case. .PP If .I page has trouble viewing a Postscript file, -it might not be exactly conforming: try viewing it with the +it might not be exactly conforming: try viewing it with the .B -P option. .PP The interface to the plumber is unsatisfactory. In particular, -document references cannot be sent +document references cannot be sent via plumbing messages. .PP There are too many keyboard commands and menu items. @@ -274,7 +277,7 @@ There are too many keyboard commands and menu items. Displaying a PostScript or PDF file depends both on having GhostScript (see -.IR gs (1)) +.MR gs (1) ) installed and on the underlying operating system providing a file descriptor device tree at .BR /dev/fd . diff --git a/man/man1/paint.1 b/man/man1/paint.1 index 2bcbf245..838535c0 100644 --- a/man/man1/paint.1 +++ b/man/man1/paint.1 @@ -19,7 +19,7 @@ If the optional argument is specified, then it is read and used as the canvas. .I Paint only recognizes Plan 9 bitmap format (see -.IR image (6)). +.MR image (6) ). .PP A number of immediate keyboard commands are recognized: .TP @@ -74,12 +74,12 @@ Quits the program. .SH SOURCE .B /sys/src/cmd/paint.c .SH "SEE ALSO" -.IR resample (1), -.IR rotate (1), -.IR crop (1), -.IR jpg (1), -.IR page (1), -.IR image (6) +.MR resample (1) , +.MR rotate (1) , +.MR crop (1) , +.MR jpg (1) , +.MR page (1) , +.MR image (6) .SH HISTORY .I Paint first appeared in 9front (October, 2011). diff --git a/man/man1/passwd.1 b/man/man1/passwd.1 index f6843b39..9f32497f 100644 --- a/man/man1/passwd.1 +++ b/man/man1/passwd.1 @@ -36,7 +36,7 @@ It is a substitute for a SecureNet box. .br .B \*9/src/cmd/auth/passwd.c .SH "SEE ALSO" -.IR encrypt (3) +.MR encrypt (3) .PP Robert Morris and Ken Thompson, ``UNIX Password Security,'' diff --git a/man/man1/pem.1 b/man/man1/pem.1 index 391cd5cc..9911af95 100644 --- a/man/man1/pem.1 +++ b/man/man1/pem.1 @@ -20,7 +20,7 @@ Privacy Enhanced Mail program but now commonly used for other applications, notably TLS. PEM encodes data in base 64 (see -.IR encode (3)) +.MR encode (3) ) between lines of the form: .IP .EX @@ -33,7 +33,7 @@ where may be any string describing the encoded data. The most common use of PEM format on Plan 9 is for encoding X.509 certificates; see -.IR rsa (1). +.MR rsa (1) . .PP .I Pemdecode extracts the named @@ -62,4 +62,4 @@ hello world .SH SOURCE .B \*9/src/cmd/auth .SH "SEE ALSO -.IR rsa (1) +.MR rsa (1) diff --git a/man/man1/pic.1 b/man/man1/pic.1 index 0ee526fe..d122ff3b 100644 --- a/man/man1/pic.1 +++ b/man/man1/pic.1 @@ -31,7 +31,7 @@ pic, tpic, svgpic \- troff and tex preprocessors for drawing pictures .SH DESCRIPTION .I Pic is a -.IR troff (1) +.MR troff (1) preprocessor for drawing figures on a typesetter. .I Pic code is contained between @@ -300,7 +300,7 @@ statement removes the definition of a macro. .PP .I Tpic is a -.IR tex (1) +.MR tex (1) preprocessor that accepts .IR pic language. @@ -345,8 +345,8 @@ A: ellipse .B \*9/src/cmd/pic .SH "SEE ALSO" .IR grap (1), -.IR doctype (1), -.IR troff (1) +.MR doctype (1) , +.MR troff (1) .br B. W. Kernighan, ``PIC\(ema Graphics Language for Typesetting'', diff --git a/man/man1/plot.1 b/man/man1/plot.1 index 3c8803f8..87d6936a 100644 --- a/man/man1/plot.1 +++ b/man/man1/plot.1 @@ -14,7 +14,7 @@ from the .I files or standard input, drawing the results in a newly created -.IR rio (1) +.MR rio (1) window. Plot persists until a newline is typed in the window. Various options may be interspersed with the @@ -31,7 +31,7 @@ Erase the screen. .TP .BI -c " col" Set the foreground color (see -.IR plot (7) +.MR plot (7) for color names). .TP .BI -f " fill" @@ -57,5 +57,5 @@ middle of the screen. .SH SOURCE .B \*9/src/cmd/plot .SH "SEE ALSO" -.IR rio (1), -.IR plot (7) +.MR rio (1) , +.MR plot (7) diff --git a/man/man1/plumb.1 b/man/man1/plumb.1 index 3fa16252..39e4d6c5 100644 --- a/man/man1/plumb.1 +++ b/man/man1/plumb.1 @@ -83,6 +83,6 @@ default rules file .SH SOURCE .B \*9/src/cmd/plumb .SH "SEE ALSO" -.IR plumb (3), -.IR plumber (4), -.IR plumb (7) +.MR plumb (3) , +.MR plumber (4) , +.MR plumb (7) diff --git a/man/man1/pr.1 b/man/man1/pr.1 index 860c026c..624c25fb 100644 --- a/man/man1/pr.1 +++ b/man/man1/pr.1 @@ -106,5 +106,5 @@ characters instead of the default 72. .SH SOURCE .B \*9/src/cmd/pr.c .SH "SEE ALSO" -.IR cat (1), -.IR lp (1) +.MR cat (1) , +.MR lp (1) diff --git a/man/man1/proof.1 b/man/man1/proof.1 index 2a1de084..63b70a6b 100644 --- a/man/man1/proof.1 +++ b/man/man1/proof.1 @@ -22,7 +22,7 @@ proof \- troff output interpreter .SH DESCRIPTION .I Proof reads -.IR troff (1) +.MR troff (1) intermediate language from .I file or standard input @@ -126,8 +126,8 @@ into screen fonts and character numbers .B \*9/src/cmd/proof .SH SEE ALSO .IR lp (1), -.IR gs (1), -.IR page (1) +.MR gs (1) , +.MR page (1) .br J. F. Ossanna and B. W. Kernighan, ``Troff User's Manual'' diff --git a/man/man1/ps.1 b/man/man1/ps.1 index bb655d18..5904564a 100644 --- a/man/man1/ps.1 +++ b/man/man1/ps.1 @@ -102,6 +102,6 @@ to print the arguments for the process. Newlines in arguments will be translate .br .B \*9/bin/psu .SH "SEE ALSO" -.IR acid (1), -.IR db (1), -.IR kill (1) +.MR acid (1) , +.MR db (1) , +.MR kill (1) diff --git a/man/man1/psfonts.1 b/man/man1/psfonts.1 index c408f54a..2c4b0531 100644 --- a/man/man1/psfonts.1 +++ b/man/man1/psfonts.1 @@ -16,9 +16,9 @@ psfonts, psdownload \- add necessary fonts to PostScript document for printing ] .SH DESCRIPTION Plan 9's -.IR troff (1) +.MR troff (1) and -.IR tr2post (1) +.MR tr2post (1) use non-standard PostScript fonts (found in .BR \*9/postscript/font ). @@ -114,12 +114,12 @@ Continue running even after fatal errors occur. .PD .SH EXAMPLE See -.IR tr2post (1) +.MR tr2post (1) for an example. .SH SOURCE .B \*9/bin/psfonts .br .B \*9/src/cmd/postscript/download .SH SEE ALSO -.IR troff (1), -.IR tr2post (1) +.MR troff (1) , +.MR tr2post (1) diff --git a/man/man1/pwd.1 b/man/man1/pwd.1 index 0a3e0668..e0a506fb 100644 --- a/man/man1/pwd.1 +++ b/man/man1/pwd.1 @@ -18,8 +18,8 @@ such as constructing shell prompts. .SH SEE ALSO .I cd in -.IR rc (1), -.IR getwd (3) +.MR rc (1) , +.MR getwd (3) .SH BUGS .I Pwd is not provided. diff --git a/man/man1/rc.1 b/man/man1/rc.1 index 7553707d..38a867d7 100644 --- a/man/man1/rc.1 +++ b/man/man1/rc.1 @@ -50,7 +50,7 @@ exits or is terminated, the variable .B $status gets the process's wait message (see -.IR wait (3)); +.MR wait (3) ); it will be the null string if the command was successful. .PP A long command line may be continued on subsequent lines by typing @@ -83,7 +83,7 @@ in a directory in .B $path is the program to be executed. To be executable, the user must have execute permission (see -.IR stat (3)) +.MR stat (3) ) and the file must be either an executable binary for the current machine's CPU type, or a shell script. Shell scripts begin with a line containing the full path name of a shell @@ -350,7 +350,7 @@ or is a previously opened file descriptor and .I fd0 becomes a new copy (in the sense of -.IR dup (3)) +.MR dup (3) ) of it. A file descriptor may be closed by writing .BI >[ fd0 =] @@ -543,7 +543,7 @@ function definition. A function with a special name will be called when .I rc receives a corresponding note; see -.IR notify (3). +.MR notify (3) . The valid note names (and corresponding notes) are .B sighup .RB ( hangup ), @@ -662,7 +662,7 @@ is composed of the bitwise OR of the .B rfork flags specified by the option letters (see -.IR fork (2)). +.MR fork (2) ). If no .I flags are given, they default to @@ -829,7 +829,7 @@ parsing the .B $PATH variable (as in -.IR sh (1)) +.MR sh (1) ) or by .BR "path=(.\ /bin)" . The variables diff --git a/man/man1/readcons.1 b/man/man1/readcons.1 index 8fa1c392..6fc56a66 100644 --- a/man/man1/readcons.1 +++ b/man/man1/readcons.1 @@ -27,4 +27,4 @@ is printed instead of an empty string. .SH SOURCE .B \*9/src/cmd/readcons.c .SH SEE ALSO -.IR readcons (3) +.MR readcons (3) diff --git a/man/man1/resample.1 b/man/man1/resample.1 index f41d9e51..71c3b747 100755 --- a/man/man1/resample.1 +++ b/man/man1/resample.1 @@ -40,19 +40,19 @@ and .PP The input should be a Plan 9 image as described in -.IR image (7), +.MR image (7) , and the output will be a compressed 24-bit .B r8g8b8 image. To uncompress the image or change the pixel format, use .I iconv (see -.IR crop (1)). +.MR crop (1) ). .PP .SH SOURCE .B \*9/src/cmd/resample.c .SH "SEE ALSO -.IR crop (1), -.IR image (7) +.MR crop (1) , +.MR image (7) .SH BUGS Faster algorithms exist, but this implementation produces correct pictures. diff --git a/man/man1/rio.1 b/man/man1/rio.1 index 1fc0619d..fb4b5dfb 100644 --- a/man/man1/rio.1 +++ b/man/man1/rio.1 @@ -68,15 +68,15 @@ specifies an alternative program to run when the .I New menu item is selected. The default is to try -.IR 9term (1) +.MR 9term (1) and then to fall back to -.IR xterm (1). +.MR xterm (1) . The .B \-s option has no effect. It formerly set the scrolling mode for new windows and is recognized to avoid breaking scripts. See -.IR 9term (1) +.MR 9term (1) for a description of scrolling behavior. .PP The @@ -137,11 +137,11 @@ Very small windows may not be created. The new window is created running .IR termprog , by default -.IR 9term (1) +.MR 9term (1) or, if .I 9term is not available, -.IR xterm (1). +.MR xterm (1) . .TP .B Resize Change the size and location of a window. @@ -165,7 +165,7 @@ Deleting a window causes a .L hangup note to be sent to all processes in the window's process group (see -.IR notify (3)). +.MR notify (3) ). .TP .B Hide Hide a window. Click in the window to be hidden (gunsight cursor); @@ -241,8 +241,8 @@ starts a particular program.) .PP There is a currently a compiled-in limit of 128 hidden windows. .SH "SEE ALSO" -.IR 9term (1), -.IR xterm (1) +.MR 9term (1) , +.MR xterm (1) .PP As mentioned above, .I rio diff --git a/man/man1/rm.1 b/man/man1/rm.1 index 83bc8172..104eda93 100644 --- a/man/man1/rm.1 +++ b/man/man1/rm.1 @@ -25,4 +25,4 @@ and the directory itself. .SH SOURCE .B \*9/src/cmd/rm.c .SH "SEE ALSO" -.IR remove (3) +.MR remove (3) diff --git a/man/man1/rsa.1 b/man/man1/rsa.1 index b01c979d..4d8f286b 100644 --- a/man/man1/rsa.1 +++ b/man/man1/rsa.1 @@ -85,7 +85,7 @@ Plan 9 represents DSA and RSA keys as attribute-value pair lists prefixed with the string .BR key ; this is the generic key format used by -.IR factotum (4). +.MR factotum (4) . A full DSA private key has the following attributes: .TP .B proto @@ -334,9 +334,9 @@ scp auth.keys unix:.ssh/authorized_keys .SH SOURCE .B \*9/src/cmd/auth .SH "SEE ALSO -.IR factotum (4), -.IR pem (1), -.IR ssh (1) +.MR factotum (4) , +.MR pem (1) , +.MR ssh (1) .SH BUGS There are too many key formats. .PP diff --git a/man/man1/sam.1 b/man/man1/sam.1 index 8e771833..ac9f6e82 100644 --- a/man/man1/sam.1 +++ b/man/man1/sam.1 @@ -51,7 +51,7 @@ copies leading white space on the current line to the new line. Do not `download' the terminal part of .IR sam . Editing will be done with the command language only, as in -.IR ed (1). +.MR ed (1) . .TP .BI -r " machine Run the host part remotely @@ -69,7 +69,7 @@ for debugging. .PD .SS Regular expressions Regular expressions are as in -.IR regexp (7) +.MR regexp (7) with the addition of .BR \en to represent newlines. @@ -698,7 +698,7 @@ There is usually a `current window', marked with a dark border, to which typed text and editing commands apply. Text may be typed and edited as in -.IR rio (1); +.MR rio (1) ; also the escape key (ESC) selects (sets dot to) text typed since the last mouse button hit. .PP @@ -798,7 +798,7 @@ the white-space-delimited block of text is sent as a plumb message with a .B click attribute defining where the selection lies (see -.IR plumb (7)). +.MR plumb (7) ). .TP .B look Search forward for the next occurrence of the literal text in dot. @@ -909,11 +909,11 @@ source for the separate terminal part .TP .B \*9/bin/E .SH SEE ALSO -.IR ed (1), -.IR sed (1), -.IR grep (1), -.IR rio (1), -.IR regexp (7). +.MR ed (1) , +.MR sed (1) , +.MR grep (1) , +.MR rio (1) , +.MR regexp (7) . .PP Rob Pike, ``The text editor sam''. diff --git a/man/man1/scat.1 b/man/man1/scat.1 index 57369ab5..407b97ef 100644 --- a/man/man1/scat.1 +++ b/man/man1/scat.1 @@ -10,7 +10,7 @@ outside the solar system and implements database-like manipulations on sets of such objects. It also provides an interface to -.IR astro (1) +.MR astro (1) to plot the locations of solar system objects. Finally, it displays images from the Space Telescope Science Institute's @@ -119,7 +119,7 @@ The names and .B comet refer to the earth's penumbra at lunar distance and the comet installed in the current -.IR astro (1). +.MR astro (1) . The output is the planet's name, right ascension and declination, azimuth and altitude, and phase for the moon and sun, as shown by .BR astro . @@ -182,7 +182,7 @@ collects all objects in the patches that cover the current set. .TP .BI astro " option" Run -.IR astro (1) +.MR astro (1) with the specified .I options (to which will be appended @@ -324,7 +324,7 @@ Draw a map of the Pleiades. .SH SOURCE .B \*9/src/cmd/scat .SH SEE ALSO -.IR astro (1) +.MR astro (1) .br .B \*9/sky/constelnames\ \ the three-letter abbreviations of the constellation names. diff --git a/man/man1/secstore.1 b/man/man1/secstore.1 index 01c7903b..9374e390 100644 --- a/man/man1/secstore.1 +++ b/man/man1/secstore.1 @@ -97,7 +97,7 @@ Option .B -n says that the password should be read from NVRAM (see -.IR authsrv (3)) +.MR authsrv (3) ) instead of from .BR /dev/tty . .PP @@ -107,7 +107,7 @@ or the server specified by option .BR -s . .PP For example, to add a secret to the file read by -.IR factotum (4), +.MR factotum (4) , run .sp .EX @@ -192,8 +192,8 @@ block chaining (CBC) mode. .br .B \*9/src/cmd/auth/secstore .SH SEE ALSO -.IR factotum (4), -.IR secstored (1) +.MR factotum (4) , +.MR secstored (1) .SH BUGS There is deliberately no backup of files on the secstore, so .B -r diff --git a/man/man1/secstored.1 b/man/man1/secstored.1 index 3eee78be..82eaee3c 100644 --- a/man/man1/secstored.1 +++ b/man/man1/secstored.1 @@ -18,7 +18,7 @@ username .PP .I Secstored serves requests from -.IR secstore (1). +.MR secstore (1) . The .B -R option supplements the password check with a @@ -61,4 +61,4 @@ for mapping local userid to RADIUS userid .SH SOURCE .B \*9/src/cmd/auth/secstore .SH SEE ALSO -.IR secstore (1) +.MR secstore (1) diff --git a/man/man1/sed.1 b/man/man1/sed.1 index 7f2b5f13..8a892da1 100644 --- a/man/man1/sed.1 +++ b/man/man1/sed.1 @@ -78,7 +78,7 @@ that addresses the last line of input, or a context address, .BI / regular-expression / \f1, in the style of -.IR regexp (7), +.MR regexp (7) , with the added convention that .L \en matches a @@ -235,7 +235,7 @@ in the pattern space. Any character may be used instead of .LR / . For a fuller description see -.IR regexp (7). +.MR regexp (7) . .I Flags is zero or more of .RS @@ -374,8 +374,8 @@ formatted manuscript. .IR grep (1), .IR awk (1), .IR lex (1), -.IR sam (1), -.IR regexp (7) +.MR sam (1) , +.MR regexp (7) .br L. E. McMahon, `SED \(em A Non-interactive Text Editor', diff --git a/man/man1/seq.1 b/man/man1/seq.1 index 3f295c04..e181f5be 100644 --- a/man/man1/seq.1 +++ b/man/man1/seq.1 @@ -38,7 +38,7 @@ The options are .TP "\w'\fL-f \fIformat\fLXX'u" .BI -f format Use the -.IR print (3)-style +.MR print (3) -style .I format .IR print for printing each (floating point) number. diff --git a/man/man1/sftpcache.1 b/man/man1/sftpcache.1 index 28499b48..8c0a0ad8 100644 --- a/man/man1/sftpcache.1 +++ b/man/man1/sftpcache.1 @@ -7,7 +7,7 @@ sftpcache \- cache sftp connections .SH DESCRIPTION .I Sftpcache multiplexes clients onto persistent -.IR sftp (1) +.MR sftp (1) connections. It runs .I sftp @@ -16,7 +16,7 @@ and posts a socket named .IB system .sftp in the name space directory (see -.IR intro (4)). +.MR intro (4) ). Clients can connect to the socket, one at a time, to interact with the .I sftp @@ -24,13 +24,13 @@ session. .PP .I Sftpcache is used by -.IR netfiles (1). +.MR netfiles (1) . .SH SOURCE .B \*9/src/cmd/sftpcache.c .SH SEE ALSO -.IR ssh (1), -.IR sftp (1), -.IR netfiles (1) +.MR ssh (1) , +.MR sftp (1) , +.MR netfiles (1) .SH BUGS .I Sftpcache only works with OpenSSH versions 4.3 and earlier; diff --git a/man/man1/sleep.1 b/man/man1/sleep.1 index 3eb617b4..f5f7c4cf 100644 --- a/man/man1/sleep.1 +++ b/man/man1/sleep.1 @@ -28,4 +28,4 @@ while (){ .SH SOURCE .B \*9/src/cmd/sleep.c .SH "SEE ALSO" -.IR sleep (3) +.MR sleep (3) diff --git a/man/man1/snarfer.1 b/man/man1/snarfer.1 index 54200b4b..ef77c951 100644 --- a/man/man1/snarfer.1 +++ b/man/man1/snarfer.1 @@ -13,30 +13,31 @@ Each time a program changes the snarf buffer contents, .I snarfer copies the new contents and then takes over control of the buffer. -Because the snarf buffer contents are managed by +Because the snarf buffer contents are managed by .I snarfer instead of by individual programs, the contents remain available even after the program that wrote them exits. .PP -The +The .B -v option, intended for debugging, causes .I snarfer to print the new snarf buffer contents each time it changes. .PP -On Mac OS X, +On Mac OS X, running .I snarfer keeps the X11 snarf buffer in sync with the Carbon snarf buffer, working around a bug in the OS X X11 server. See -.IR getsnarf (3) +.MR getsnarf (3) for more details. .SH SOURCE .B \*9/src/cmd/snarfer .SH SEE ALSO -Unix's \fIxclipboard\fR(1), -.IR getsnarf (3) +Unix's +.IR xclipboard (1), +.MR getsnarf (3) .SH BUGS Both .I xclipboard diff --git a/man/man1/soelim.1 b/man/man1/soelim.1 index 6378d414..c7324035 100755 --- a/man/man1/soelim.1 +++ b/man/man1/soelim.1 @@ -11,19 +11,19 @@ soelim \- preprocess so inclusion commands in troff input .I Soelim reads the specified files or the standard input and performs the textual inclusion implied by -.IR troff (1) +.MR troff (1) directives of the form .TP .B "\&.so some_file .PP when they appear at the beginning of input lines. This is useful when using programs such as -.IR tbl (1) +.MR tbl (1) that do not normally do this, allowing placement of individual tables or other text objects in separate files to be run as a part of a large document. .SH SOURCE .B \*9/bin/soelim .SH "SEE ALSO" -.IR deroff (1), -.IR troff (1) +.MR deroff (1) , +.MR troff (1) diff --git a/man/man1/sort.1 b/man/man1/sort.1 index e68a53fc..6922114b 100644 --- a/man/man1/sort.1 +++ b/man/man1/sort.1 @@ -242,8 +242,8 @@ come out in their original order. .SH SOURCE .B \*9/src/cmd/sort.c .SH SEE ALSO -.IR uniq (1), -.IR look (1) +.MR uniq (1) , +.MR look (1) .SH DIAGNOSTICS .I Sort comments and exits with non-null status for various trouble diff --git a/man/man1/spell.1 b/man/man1/spell.1 index 5d27609b..27ae6803 100644 --- a/man/man1/spell.1 +++ b/man/man1/spell.1 @@ -31,7 +31,7 @@ not sanctioned there\(emon the standard output. .PP .I Spell ignores constructs of -.IR troff (1) +.MR troff (1) and its standard preprocessors. It understands these options: .TP @@ -82,10 +82,10 @@ the script source for .I sprog .SH SEE ALSO -.IR deroff (1) +.MR deroff (1) .SH BUGS The heuristics of -.IR deroff (1) +.MR deroff (1) used to excise formatting information are imperfect. .PP The spelling list's coverage is uneven; diff --git a/man/man1/split.1 b/man/man1/split.1 index 9b2c976f..b61ef185 100644 --- a/man/man1/split.1 +++ b/man/man1/split.1 @@ -41,7 +41,7 @@ File divisions occur at each line that matches a regular .IR expression ; see -.IR regexp (7). +.MR regexp (7) . Multiple .B -e options may appear. @@ -77,6 +77,6 @@ to lower case. .B \*9/src/cmd/split.c .SH SEE ALSO .IR sed (1), -.IR awk (1), -.IR grep (1), -.IR regexp (7) +.MR awk (1) , +.MR grep (1) , +.MR regexp (7) diff --git a/man/man1/src.1 b/man/man1/src.1 index 5f6a29cf..7648602b 100644 --- a/man/man1/src.1 +++ b/man/man1/src.1 @@ -19,11 +19,11 @@ examines the named to find the corresponding source code, which is then sent to the editor using .B B (see -.IR sam (1)). +.MR sam (1) ). If .I file is an -.IR rc (1) +.MR rc (1) script, the source is the file itself. If .I file @@ -35,7 +35,7 @@ and will point the editor at the line that begins the definition. .I Src uses -.IR db (1) +.MR db (1) to extract the symbol table information that identifies the source. .PP .I Src @@ -78,6 +78,6 @@ src -s strcmp rc .SH SOURCE .B \*9/bin/src .SH "SEE ALSO" -.IR db (1), -.IR plumb (1), -.IR sam (1). +.MR db (1) , +.MR plumb (1) , +.MR sam (1) . diff --git a/man/man1/ssam.1 b/man/man1/ssam.1 index 6dbdc236..aa9fc647 100755 --- a/man/man1/ssam.1 +++ b/man/man1/ssam.1 @@ -63,8 +63,8 @@ Count frequency of words read from standard input. .B \*9/bin/ssam .SH SEE ALSO .IR sed (1), -.IR sam (1), -.IR regexp (7) +.MR sam (1) , +.MR regexp (7) .PP Rob Pike, ``The text editor sam''. diff --git a/man/man1/ssh-agent.1 b/man/man1/ssh-agent.1 index 1617e17f..70ecec64 100644 --- a/man/man1/ssh-agent.1 +++ b/man/man1/ssh-agent.1 @@ -10,9 +10,9 @@ ssh-agent \- SSH authentication agent .SH DESCRIPTION .I Ssh-agent presents -.IR factotum (4) +.MR factotum (4) using the interface that -.IR ssh (1) +.MR ssh (1) requires. .PP Once @@ -33,7 +33,7 @@ via a Unix socket named .B ssh-agent.socket in the name space directory (see -.IR intro (4)). +.MR intro (4) ). Note that although the socket is posted in the name space directory, it is not for 9P conversations. .I Ssh @@ -81,10 +81,10 @@ Invoke this one with .B 9 .BR ssh-agent ; see -.IR 9 (1). +.MR 9 (1) . .SH EXAMPLES Assume -.IR factotum (4) +.MR factotum (4) is already running and initialized with keys. .PP Start a new agent, copying the commands by hand: @@ -103,7 +103,7 @@ $ .EE .PP Start the agent from -.IR sh (1): +.MR sh (1) : .IP .EX $ eval `9 ssh-agent -e` @@ -111,7 +111,7 @@ $ .EE .PP Start the agent from -.IR rc (1): +.MR rc (1) : .IP .EX % eval `{9 ssh-agent} @@ -128,9 +128,9 @@ tux% ^D .SH SOURCE .B \*9/src/cmd/auth/ssh-agent.c .SH SEE ALSO -.IR ssh (1), -.IR rsa (1), -.IR factotum (4) +.MR ssh (1) , +.MR rsa (1) , +.MR factotum (4) .SH BUGS A surprise rather than a bug: .I ssh-agent diff --git a/man/man1/strings.1 b/man/man1/strings.1 index d04dc41f..b4070f0f 100644 --- a/man/man1/strings.1 +++ b/man/man1/strings.1 @@ -25,4 +25,4 @@ line with the offset of the continuation line. .SH SOURCE .B \*9/src/cmd/strings.c .SH SEE ALSO -.IR nm (1) +.MR nm (1) diff --git a/man/man1/sum.1 b/man/man1/sum.1 index b95851db..727f273f 100644 --- a/man/man1/sum.1 +++ b/man/man1/sum.1 @@ -73,5 +73,5 @@ summed. .br .B \*9/src/cmd/sha1sum.c .SH "SEE ALSO" -.IR cmp (1), -.IR wc (1) +.MR cmp (1) , +.MR wc (1) diff --git a/man/man1/tar.1 b/man/man1/tar.1 index 80e3f40b..dc4d666c 100644 --- a/man/man1/tar.1 +++ b/man/man1/tar.1 @@ -112,14 +112,14 @@ archive entries. .B z Operate on compressed tar archives. The type of compression is inferred from the file name extension: -.IR gzip (1) +.MR gzip (1) for .B .tar.gz and .BR .tgz ; .I bzip2 (see -.IR gzip (1)) +.MR gzip (1) ) for .BR .tar.bz , .BR .tbz , @@ -153,8 +153,8 @@ can be used to copy hierarchies thus: .SH SEE ALSO .I 9ar in -.IR 9c (1), -.IR bundle (1) +.MR 9c (1) , +.MR bundle (1) .SH BUGS There is no way to ask for any but the last occurrence of a file. diff --git a/man/man1/tbl.1 b/man/man1/tbl.1 index ce13a4a4..c241a0ab 100644 --- a/man/man1/tbl.1 +++ b/man/man1/tbl.1 @@ -11,7 +11,7 @@ tbl \- format tables for nroff or troff is a preprocessor for formatting tables for .I nroff or -.IR troff (1). +.MR troff (1) . The input .I files are copied to the standard output, @@ -74,7 +74,7 @@ recognize and .I y as -.IR eqn (1) +.MR eqn (1) delimiters .PD .RE @@ -275,8 +275,8 @@ Bernardsville 2018 3.30 .B \*9/src/cmd/tbl .SH SEE ALSO .IR troff (1), -.IR eqn (1), -.IR doctype (1) +.MR eqn (1) , +.MR doctype (1) .br M. E. Lesk and L. L. Cherry, ``TBL\(ema Program to Format Tables'', diff --git a/man/man1/tcs.1 b/man/man1/tcs.1 index f23d1cee..ef871fa4 100644 --- a/man/man1/tcs.1 +++ b/man/man1/tcs.1 @@ -36,7 +36,7 @@ is the .SM UTF encoding described in -.IR utf (7). +.MR utf (7) . The .B -l option lists the character sets known to @@ -164,4 +164,4 @@ Print an up to date list of the supported character sets. .SH SEE ALSO .IR ascii (1), .IR rune (3), -.IR utf (7). +.MR utf (7) . diff --git a/man/man1/test.1 b/man/man1/test.1 index 9957b29d..0a849913 100644 --- a/man/man1/test.1 +++ b/man/man1/test.1 @@ -182,7 +182,7 @@ and must be enclosed in quotes. .I Test is a dubious way to check for specific character strings: it uses a process to do what an -.IR rc (1) +.MR rc (1) match or switch statement can do. The first example is not only inefficient but wrong, because .I test diff --git a/man/man1/time.1 b/man/man1/time.1 index 57a0a566..25d3dbf2 100644 --- a/man/man1/time.1 +++ b/man/man1/time.1 @@ -18,4 +18,4 @@ followed by the command line. .SH SOURCE .B \*9/src/cmd/time.c .SH "SEE ALSO" -.IR prof (1) +.MR prof (1) diff --git a/man/man1/touch.1 b/man/man1/touch.1 index a02440d2..2a48c3c2 100644 --- a/man/man1/touch.1 +++ b/man/man1/touch.1 @@ -27,9 +27,9 @@ is present. .SH SOURCE .B \*9/src/cmd/touch.c .SH SEE ALSO -.IR ls (1), -.IR stat (3), -.IR chmod (1) +.MR ls (1) , +.MR stat (3) , +.MR chmod (1) .SH BUGS .I Touch will not touch directories. diff --git a/man/man1/tr.1 b/man/man1/tr.1 index cef4a177..74c512fb 100644 --- a/man/man1/tr.1 +++ b/man/man1/tr.1 @@ -94,4 +94,4 @@ tr -cs A-Za-z ' .SH SOURCE .B \*9/src/cmd/tr.c .SH "SEE ALSO" -.IR sed (1) +.MR sed (1) diff --git a/man/man1/tr2post.1 b/man/man1/tr2post.1 index 3a54e4d2..29d3e85c 100644 --- a/man/man1/tr2post.1 +++ b/man/man1/tr2post.1 @@ -15,7 +15,7 @@ converts .I files (or standard input), which should be the device-independent output of -.IR troff (1), +.MR troff (1) , into the PostScript printer language. .PP The options are: @@ -29,7 +29,8 @@ to stretch the PostScript output (default 1.0). Set a comment in the PostScript output marking the number of copies that should be printed. The comment is intended for ancient versions of the Unix -\fIlp\fR(1) and is not recognized by any current printer +.IR lp (1) +and is not recognized by any current printer or print spooler. .TP .BI -d @@ -46,11 +47,11 @@ logical pages per physical page Using this option emits PostScript with invalid document structuring comments. It will print fine but will not view correctly in -.IR gv (1) +.MR gv (1) or .I psv (see -.IR page (1)). +.MR page (1) ). .TP .BI -o " pagelist Print only the pages in the @@ -109,5 +110,5 @@ psv /tmp/a.ps .SH SOURCE .B \*9/src/cmd/postscript/tr2post .SH SEE ALSO -.IR troff (1), -.IR psfonts (1) +.MR troff (1) , +.MR psfonts (1) diff --git a/man/man1/troff.1 b/man/man1/troff.1 index 7af3f3c1..032e8c70 100644 --- a/man/man1/troff.1 +++ b/man/man1/troff.1 @@ -176,18 +176,18 @@ font width tables for .SH SOURCE .B \*9/src/cmd/troff .SH "SEE ALSO" -.IR lpr (1), -.IR proof (1), -.IR tr2post (1), +.MR lpr (1) , +.MR proof (1) , +.MR tr2post (1) , .IR eqn (1), .IR tbl (1), .IR pic (1), -.IR grap (1), +.MR grap (1) , .IR doctype (1), -.IR ms (7), -.IR image (7), -.IR tex (1), -.IR deroff (1) +.MR ms (7) , +.MR image (7) , +.MR tex (1) , +.MR deroff (1) .br J. F. Ossanna and B. W. Kernighan, ``Troff User's Manual'' diff --git a/man/man1/troff2html.1 b/man/man1/troff2html.1 index a40e22f0..06465e9b 100644 --- a/man/man1/troff2html.1 +++ b/man/man1/troff2html.1 @@ -13,7 +13,7 @@ troff2html \- convert troff output into HTML .SH DESCRIPTION .I Troff2html reads the -.IR troff (1) +.MR troff (1) output in the named .IR files , default standard input, @@ -25,12 +25,13 @@ does a tolerable job with straight output, but it is helped by annotations, described below. Its main use is for .B man2html -(see Plan 9's \fIhttpd\fR(8)), +(see Plan 9's +.IR httpd (8)), which converts -.IR man (1) +.MR man (1) pages into HTML and depends on a specially annotated set of -.IR man (7) +.MR man (7) macros, invoked by .B troff .BR -manhtml . @@ -57,25 +58,25 @@ x X html manref end cp 1 .EE .PP which are used to create HTML hyperlinks around text of the form -.IR cp (1) +.MR cp (1) pointing to .BR /magic/man2html/1/cp . .PP .I Troff2html is new and experimental; in time, it may improve and subsume Plan 9's -\fIms2html\fR(1). +.IR ms2html (1). On the one hand, because it uses the input, .B ms2html can handle -.IR pic (1), -.IR eqn (1), +.MR pic (1) , +.MR eqn (1) , etc., which .I troff2html does not handle at all; on the other hand, .B ms2html understands only -.IR ms (7) +.MR ms (7) documents and is easily confused by complex .B troff constructions. @@ -83,13 +84,13 @@ constructions. has the reverse properties: it does not handle the preprocessors but its output is reliable and (modulo helper annotations) is independent of macro package. .SH SEE ALSO -.IR troff (1), +.MR troff (1) , Plan 9's -\fIms2html\fR(1), +.IR ms2html (1), .I man2html in Plan 9's -\fIhttpd\fR(8). +.IR httpd (8). .SH BUGS .B Troff and HTML have different models, and they don't mesh well in all cases. diff --git a/man/man1/tweak.1 b/man/man1/tweak.1 index ac52a9b5..773ec325 100644 --- a/man/man1/tweak.1 +++ b/man/man1/tweak.1 @@ -35,14 +35,14 @@ If the file is a subfont, a second line presents a hexadecimal 16-bit .B offset to be applied to character values from the subfont (typically as stored in a font file; see -.IR font (7)); +.MR font (7) ); and the subfont's .BR n , .BR height , and .B ascent as defined in -.IR cachechars (3). +.MR cachechars (3) . .PP By means described below, magnified views of portions of the images may be displayed. @@ -61,7 +61,7 @@ default font; the character's and .BR width as defined in -.IR cachechars (3); +.MR cachechars (3) ; and .BR iwidth , the physical width of the image in the subfont's image. @@ -158,9 +158,9 @@ The program will complain once about modified but unwritten files. .SH SOURCE .B \*9/src/cmd/draw/tweak.c .SH "SEE ALSO" -.IR cachechars (3), -.IR image (7), -.IR font (7) +.MR cachechars (3) , +.MR image (7) , +.MR font (7) .SH BUGS For a program written to adjust width tables in fonts, .I tweak diff --git a/man/man1/uniq.1 b/man/man1/uniq.1 index ae17f095..07629ea4 100644 --- a/man/man1/uniq.1 +++ b/man/man1/uniq.1 @@ -56,4 +56,4 @@ Fields are skipped before characters. .IR sort (1) .SH BUGS Field selection and comparison should be compatible with -.IR sort (1). +.MR sort (1) . diff --git a/man/man1/vac.1 b/man/man1/vac.1 index 39f7c00f..53f89b2a 100644 --- a/man/man1/vac.1 +++ b/man/man1/vac.1 @@ -53,7 +53,7 @@ is used on a file tree that shares data with an existing archive, the consumptio storage will be approximately equal to an incremental backup. This reduction in storage consumption occurs transparently to the user. .PP -As an optimization, the +As an optimization, the .B -d and .B -q @@ -78,7 +78,8 @@ the files under an extra two levels of directory hierarchy named .I yyyy/mmdd (year, month, day) in the style of the dump file system -(see Plan 9's \fIfs\fR(4)). +(see Plan 9's +.IR fs (4)). If .I vacfile already exists, an additional backup day is added to the @@ -89,7 +90,7 @@ Typically, this option is used as part of a nightly backup script. This option cannot be used with .B -d -or +or .BR -f . .TP .BI -b " blocksize @@ -114,13 +115,13 @@ Do not include the file or directory specified by This option may be repeated multiple times. .I Exclude can be a shell pattern as accepted by -.IR rc (1), -with one extension: +.MR rc (1) , +with one extension: .B \&... matches any sequence of characters including slashes. .TP .BI -f " vacfile -The results of +The results of .I vac are placed in .IR vacfile , @@ -136,7 +137,7 @@ The network address of the Venti server. The default is taken from the environment variable .BR venti . .\" If this variable does not exist, then the default is the -.\" metaname +.\" metaname .\" .BR $venti , .\" which can be configured via .\" .IR ndb (6). @@ -155,7 +156,7 @@ the archive to be unpacked. .TP .B -q Increase the performance of the -.B -a +.B -a or .B -d options by detecting unchanged files based on a match of the files name and other meta data, @@ -169,9 +170,9 @@ Produce more verbose output on standard error, including the name of the files a and the vac archives that are expanded and merged. .TP .BI -x " excfile -Read exclude patterns from the file +Read exclude patterns from the file .IR excfile . -Blank lines and lines beginning with +Blank lines and lines beginning with .B # are ignored. All other lines should be of the form @@ -224,5 +225,5 @@ If listing files, print metadata in addition to the names. .SH SOURCE .B \*9/src/cmd/vac .SH "SEE ALSO" -.IR vacfs (4), -.IR venti (8) +.MR vacfs (4) , +.MR venti (8) diff --git a/man/man1/venti.1 b/man/man1/venti.1 index e14052aa..b35b2ac1 100644 --- a/man/man1/venti.1 +++ b/man/man1/venti.1 @@ -40,7 +40,7 @@ read, write, copy \- simple Venti clients .SH DESCRIPTION Venti is a SHA1-addressed block storage server. See -.IR venti (7) +.MR venti (7) for a full introduction. .PP .I Read @@ -167,13 +167,13 @@ messages send/received. .SH SOURCE .B \*9/src/cmd/venti .SH SEE ALSO -.IR vac (1), -.IR venti (3), -.IR vacfs (4), -.IR venti (7), -.IR vbackup (8), -.IR venti (8), -.IR venti-fmt (8) +.MR vac (1) , +.MR venti (3) , +.MR vacfs (4) , +.MR venti (7) , +.MR vbackup (8) , +.MR venti (8) , +.MR venti-fmt (8) .SH BUGS There should be programs to read and write venti files and directories. diff --git a/man/man1/web.1 b/man/man1/web.1 index 06d304df..0d57ad9f 100644 --- a/man/man1/web.1 +++ b/man/man1/web.1 @@ -81,7 +81,7 @@ URL passed to and .I wmail are invoked as start commands in the -.IR plumber (4)'s +.MR plumber (4) 's rules for opening web pages and writing mail messages. .SH FILES .TP @@ -93,4 +93,4 @@ and .SH SOURCE .B \*9/bin .SH SEE ALSO -.IR plumber (4) +.MR plumber (4) diff --git a/man/man1/wintext.1 b/man/man1/wintext.1 index 966b307b..b7108e46 100644 --- a/man/man1/wintext.1 +++ b/man/man1/wintext.1 @@ -22,11 +22,11 @@ wintext, ", "" \- access text in current window prints the text of the current .I win (see -.IR acme (1)), -.IR 9term (1), +.MR acme (1) ), +.MR 9term (1) , or (Unix's) -.IR tmux (1) +.MR tmux (1) window to standard output. .PP .I \*y @@ -43,7 +43,7 @@ prints the last command executed. prints the last command that .I \*y would print and then executes it by piping it into -.IR rc (1). +.MR rc (1) . .PP Both .I \*y @@ -61,7 +61,7 @@ or .BR # . .SH EXAMPLES Print the -.IR ls (1) +.MR ls (1) and .I lc commands executed in this window: @@ -87,8 +87,8 @@ ramfs rc read rio rm % .EE .SH SEE ALSO -.IR 9term (1), -.IR acme (1) +.MR 9term (1) , +.MR acme (1) .SH SOURCE .B \*9/bin .SH BUGS @@ -96,5 +96,5 @@ ramfs rc read rio rm and .I \*(yy are hard to type in shells other than -.IR rc (1). +.MR rc (1) . .\" and in troff! diff --git a/man/man1/winwatch.1 b/man/man1/winwatch.1 index afbf541d..98031fbc 100644 --- a/man/man1/winwatch.1 +++ b/man/man1/winwatch.1 @@ -17,7 +17,7 @@ winwatch \- monitor rio windows .SH DESCRIPTION .I Winwatch displays the labels of all current -.IR rio (1) +.MR rio (1) windows, refreshing the display every second. Right clicking a window's label unhides, raises and gives focus to that window. Typing @@ -53,5 +53,5 @@ Excluding winwatch and stats from being shown. .SH SOURCE .B \*9/src/cmd/winwatch.c .SH SEE ALSO -.IR rio (1), -.IR regexp (7). +.MR rio (1) , +.MR regexp (7) . diff --git a/man/man1/xd.1 b/man/man1/xd.1 index 5ec167bd..3a98d936 100644 --- a/man/man1/xd.1 +++ b/man/man1/xd.1 @@ -91,7 +91,7 @@ followed by an asterisk. .SH SOURCE .B \*9/src/cmd/xd.c .SH "SEE ALSO" -.IR db (1) +.MR db (1) .SH BUGS The various output formats don't line up properly in the output of .IR xd . diff --git a/man/man1/yacc.1 b/man/man1/yacc.1 index cbd1eb73..b291473f 100644 --- a/man/man1/yacc.1 +++ b/man/man1/yacc.1 @@ -23,7 +23,7 @@ to produce a program This program must be loaded with a lexical analyzer function, .B yylex(void) (often generated by -.IR lex (1)), +.MR lex (1) ), with a .B main(int argc, char *argv[]) program, and with an error handling routine, @@ -115,7 +115,7 @@ option reverses this. The parser accepts .SM UTF input text (see -.IR utf (7)), +.MR utf (7) ), which has a couple of effects. First, the return value of .B yylex() @@ -156,7 +156,7 @@ parser prototype using stdio .SH SOURCE .B \*9/src/cmd/yacc.c .SH "SEE ALSO" -.IR lex (1) +.MR lex (1) .br S. C. Johnson and R. Sethi, ``Yacc: A parser generator'', diff --git a/man/man1/yesterday.1 b/man/man1/yesterday.1 index 665c7b22..eae046e0 100644 --- a/man/man1/yesterday.1 +++ b/man/man1/yesterday.1 @@ -91,8 +91,8 @@ by convention, root of the dump file system .SH SOURCE .B \*9/bin/yesterday .SH SEE ALSO -.IR diff (1), -.IR hist (1), -.IR vbackup (8) +.MR diff (1) , +.MR hist (1) , +.MR vbackup (8) .SH BUGS It's hard to use this command without singing. diff --git a/man/man3/0intro.3 b/man/man3/0intro.3 index e544cc8d..fe75e798 100644 --- a/man/man3/0intro.3 +++ b/man/man3/0intro.3 @@ -49,7 +49,7 @@ automatically, so it is rarely necessary to tell the loader which libraries a program needs; see -.IR 9c (1). +.MR 9c (1) . .PP The library to which a function belongs is defined by the header file that defines its interface. @@ -121,7 +121,7 @@ and plus macros that define the layout of .IR jmp_buf (see -.IR setjmp (3)); +.MR setjmp (3) ); .\" definitions of the bits in the floating-point control register .\" as used by .\" .IR getfcr (2); @@ -198,27 +198,27 @@ by or .I create (see -.IR open (3)). +.MR open (3) ). These calls return an integer called a .IR "file descriptor" which identifies the file to subsequent I/O calls, notably -.IR read (3) +.MR read (3) and .IR write . The system allocates the numbers by selecting the lowest unused descriptor. They are allocated dynamically; there is no visible limit to the number of file descriptors a process may have open. They may be reassigned using -.IR dup (3). +.MR dup (3) . File descriptors are indices into a kernel resident .IR "file descriptor table" . Each process has an associated file descriptor table. In threaded programs (see -.IR thread (3)), +.MR thread (3) ), the file descriptor table is shared by all the procs. .PP By convention, @@ -236,22 +236,22 @@ Files are normally read or written in sequential order. The I/O position in the file is called the .IR "file offset" and may be set arbitrarily using the -.IR seek (3) +.MR seek (3) system call. .PP Directories may be opened like regular files. Instead of reading them with -.IR read (3), +.MR read (3) , use the .B Dir structure-based routines described in -.IR dirread (3). +.MR dirread (3) . The entry corresponding to an arbitrary file can be retrieved by .IR dirstat (see -.IR stat (3)) +.MR stat (3) ) or .IR dirfstat ; .I dirwstat @@ -262,9 +262,9 @@ write back entries, thus changing the properties of a file. New files are made with .I create (see -.IR open (3)) +.MR open (3) ) and deleted with -.IR remove (3). +.MR remove (3) . Directories may not directly be written; .IR create , .IR remove , @@ -273,27 +273,27 @@ and .I fwstat alter them. .PP -.IR Pipe (3) +.MR Pipe (3) creates a connected pair of file descriptors, useful for bidirectional local communication. .SS "Process execution and control" A new process is created when an existing one calls -.IR fork (2). +.MR fork (2) . The new (child) process starts out with copies of the address space and most other attributes of the old (parent) process. In particular, the child starts out running the same program as the parent; -.IR exec (3) +.MR exec (3) will bring in a different one. .PP Each process has a unique integer process id; a set of open files, indexed by file descriptor; and a current working directory (changed by -.IR chdir (2)). +.MR chdir (2) ). .PP Each process has a set of attributes \(em memory, open files, name space, etc. \(em that may be shared or unique. @@ -302,9 +302,9 @@ Flags to control the sharing of these attributes. .PP A process terminates by calling -.IR exits (3). +.MR exits (3) . A parent process may call -.IR wait (3) +.MR wait (3) to wait for some child to terminate. A bit of status information may be passed from @@ -317,14 +317,14 @@ The Plan 9 interface persists here, although the functionality does not. Instead, empty strings are converted to exit status 0 and non-empty strings to 1. .PP A process can go to sleep for a specified time by calling -.IR sleep (3). +.MR sleep (3) . .PP There is a .I notification mechanism for telling a process about events such as address faults, floating point faults, and messages from other processes. A process uses -.IR notify (3) +.MR notify (3) to register the function to be called (the .IR "notification handler" ) when such events occur. @@ -334,12 +334,12 @@ the main C library works properly in multiprocess programs; .IR malloc , .IR print , and the other routines use locks (see -.IR lock (3)) +.MR lock (3) ) to synchronize access to their data structures. The graphics library defined in .B is also multi-process capable; details are in -.IR graphics (3). +.MR graphics (3) . In general, though, multiprocess programs should use some form of synchronization to protect shared data. .PP @@ -365,12 +365,12 @@ Therefore, a program that shouldn't block unexpectedly will use a process to serve the I/O request, passing the result to the main processes over a channel when the request completes. For examples of this design, see -.IR ioproc (3) +.MR ioproc (3) or -.IR mouse (3). +.MR mouse (3) . .SH SEE ALSO .IR nm (1), -.IR 9c (1) +.MR 9c (1) .SH DIAGNOSTICS Math functions in .I libc @@ -378,14 +378,14 @@ return special values when the function is undefined for the given arguments or when the value is not representable (see -.IR nan (3)). +.MR nan (3) ). .PP Some of the functions in .I libc are system calls and many others employ system calls in their implementation. All system calls return integers, with \-1 indicating that an error occurred; -.IR errstr (3) +.MR errstr (3) recovers a string describing the error. Some user-level library functions also use the .I errstr diff --git a/man/man3/9p-cmdbuf.3 b/man/man3/9p-cmdbuf.3 index 6aca825b..4ba3b6c8 100644 --- a/man/man3/9p-cmdbuf.3 +++ b/man/man3/9p-cmdbuf.3 @@ -44,7 +44,7 @@ bytes at using .I tokenize (see -.IR getfields (3)). +.MR getfields (3) ). It returns a .B Cmdbuf structure holding pointers to each field in the message. @@ -116,4 +116,4 @@ is a good example. .SH SOURCE .B \*9/src/lib9p/parse.c .SH SEE ALSO -.IR 9p (3) +.MR 9p (3) diff --git a/man/man3/9p-fid.3 b/man/man3/9p-fid.3 index ddc3e093..239f58ce 100644 --- a/man/man3/9p-fid.3 +++ b/man/man3/9p-fid.3 @@ -73,7 +73,7 @@ and .BR Reqpool s. They are primarily used by the 9P server loop described in -.IR 9p (3). +.MR 9p (3) . .PP .B Fid structures are intended to represent @@ -115,7 +115,7 @@ element points at a .B File structure (see -.IR 9p-file (3)) +.MR 9p-file (3) ) corresponding to the fid. The .B aux @@ -200,5 +200,5 @@ structures. .SH SOURCE .B \*9/src/lib9p .SH SEE ALSO -.IR 9p (3), -.IR 9p-file (3) +.MR 9p (3) , +.MR 9p-file (3) diff --git a/man/man3/9p-file.3 b/man/man3/9p-file.3 index 80866177..e849f713 100644 --- a/man/man3/9p-file.3 +++ b/man/man3/9p-file.3 @@ -144,7 +144,7 @@ When creating new file references by copying pointers, call .I incref (see -.IR lock (3)) +.MR lock (3) ) to update the reference count. To note the removal of a reference to a file, call .IR closefile . @@ -218,6 +218,6 @@ return nf; .SH SOURCE .B \*9/src/lib9p/file.c .SH SEE ALSO -.IR 9p (3) +.MR 9p (3) .SH BUGS The reference counting is cumbersome. diff --git a/man/man3/9p-intmap.3 b/man/man3/9p-intmap.3 index 9d4dfef0..486e1826 100644 --- a/man/man3/9p-intmap.3 +++ b/man/man3/9p-intmap.3 @@ -122,5 +122,5 @@ and .SH SOURCE .B \*9/src/lib9p/intmap.c .SH SEE ALSO -.IR 9p (3), -.IR 9p-fid (3) +.MR 9p (3) , +.MR 9p-fid (3) diff --git a/man/man3/9p.3 b/man/man3/9p.3 index 6dc4c9c1..86b37faf 100644 --- a/man/man3/9p.3 +++ b/man/man3/9p.3 @@ -6,7 +6,6 @@ emalloc9p, erealloc9p, estrdup9p, postfd, -postmountsrv, readbuf, readstr, respond, @@ -61,7 +60,6 @@ typedef struct Srv { .ft L .ta \w'\fLvoid* 'u int srv(Srv *s) -void postmountsrv(Srv *s, char *name, char *mtpt, int flag) void threadpostmountsrv(Srv *s, char *name, char *mtpt, int flag) int postfd(char *srvname, int fd) void respond(Req *r, char *error) @@ -96,8 +94,6 @@ and writing the responses to .BR s->outfd . (Typically, -.I postmountsrv -or .I threadpostmountsrv initializes the .B infd @@ -110,13 +106,13 @@ and .B Fid structures are allocated one-to-one with uncompleted requests and active fids, and are described in -.IR 9p-fid (3). +.MR 9p-fid (3) . .PP The behavior of .I srv depends on whether there is a file tree (see -.IR 9p-file (3)) +.MR 9p-file (3) ) associated with the server, that is, whether the .B tree @@ -148,12 +144,10 @@ but abort the program if they run out of memory. If alternate behavior is desired, clients can link against alternate implementations of these functions. .PP -.I Postmountsrv -and .I threadpostmountsrv -are wrappers that create a separate process in which to run +is a wrapper that creates a separate process in which to run .IR srv . -They do the following: +It does the following: .IP If .IB s -> nopipe @@ -178,11 +172,11 @@ as .BI /srv/ name . .IP Fork a child process via -.IR rfork (3) +.MR rfork (3) or .I procrfork (see -.IR thread (3)), +.MR thread (3) ), using the .BR RFFDG , .RR RFNOTEG , @@ -214,7 +208,7 @@ The parent returns to the caller. .LP If any error occurs during this process, the entire process is terminated by calling -.IR sysfatal (3). +.MR sysfatal (3) . .SS Service functions The functions in a .B Srv @@ -296,9 +290,7 @@ the service functions. The service loop provided by .I srv (and indirectly by -.I postmountsrv -and -.IR threadpostmountsrv ) +.I threadpostmountsrv ) is single-threaded. If it is expected that some requests might block, arranging for alternate processes @@ -332,7 +324,7 @@ where is the program name variable as set by .I ARGBEGIN (see -.IR arg (3)). +.MR arg (3) ). .TP .I Attach The @@ -707,7 +699,7 @@ the service loop (which runs in a separate process from its caller) terminates using .I _exits (see -.IR exits (3)). +.MR exits (3) ). .PD .PP If the @@ -752,6 +744,6 @@ or is maintained elsewhere. .SH SOURCE .B \*9/src/lib9p .SH SEE ALSO -.IR 9p-fid (3), -.IR 9p-file (3), +.MR 9p-fid (3) , +.MR 9p-file (3) , .IR intro (9p) diff --git a/man/man3/9pclient.3 b/man/man3/9pclient.3 index 1bb868cc..74537ab4 100644 --- a/man/man3/9pclient.3 +++ b/man/man3/9pclient.3 @@ -149,7 +149,7 @@ connects to a service named .I name in the current name space directory (see -.IR intro (4)). +.MR intro (4) ). Both attach to the root of the file system using the attach name .IR aname . @@ -228,7 +228,7 @@ the allocated structures will be freed and the file descriptor corresponding to the connection will be closed (see -.IR close (2)). +.MR close (2) ). Fids are not reference counted: when .I fsclose is called, the clunk transaction and freeing of storage @@ -308,7 +308,7 @@ sets the offset; the and .I type arguments are used as in -.IR seek (3). +.MR seek (3) . Calling .I fspread or @@ -340,7 +340,7 @@ for the given fid. .PP .I Fsaccess behaves like Unix's -.IR access (2). +.MR access (2) . .I Fsremove removes the named path. .I Fsfremove @@ -358,7 +358,7 @@ are like and .I vfprint (see -.IR print (3)) +.MR print (3) ) but write to .BR CFid* s. .PP @@ -376,7 +376,7 @@ is similar but reads the entire directory. The returned pointer should be freed with .I free (see -.IR malloc (3)) +.MR malloc (3) ) when no longer needed. .PP .I Fsdirfstat @@ -396,7 +396,7 @@ structure returned by should be freed with .I free (see -.IR malloc (3)) +.MR malloc (3) ) when no longer needed. .PP .I Fsdirstat @@ -418,7 +418,7 @@ opens a file on the 9P server for reading or writing but returns a Unix file descriptor instead of a fid structure. The file descriptor is actually one end of a -.IR pipe (2). +.MR pipe (2) . A proxy process on the other end is ferrying data between the pipe and the 9P fid. Because of the implementation as a pipe, @@ -443,18 +443,18 @@ If the flag is set, the library calls .I threadexitsall (see -.IR thread (3)) +.MR thread (3) ) when it detects EOF on a 9P connection. .SH SOURCE .B \*9/src/lib9pclient .SH SEE ALSO -.IR intro (4), +.MR intro (4) , .IR intro (9p), .I fsaopen and .I nsaopen in -.IR auth (3) +.MR auth (3) .SH BUGS The implementation should use a special version string to distinguish between diff --git a/man/man3/INDEX b/man/man3/INDEX index 6654ea7c..39e10b41 100644 --- a/man/man3/INDEX +++ b/man/man3/INDEX @@ -50,7 +50,6 @@ emalloc9p 9p.3 erealloc9p 9p.3 estrdup9p 9p.3 postfd 9p.3 -postmountsrv 9p.3 readbuf 9p.3 readstr 9p.3 respond 9p.3 diff --git a/man/man3/acme.3 b/man/man3/acme.3 index 1683061a..7c4ac67a 100644 --- a/man/man3/acme.3 +++ b/man/man3/acme.3 @@ -141,7 +141,7 @@ char* evsmprint(char *fmt, va_list arg) .SH DESCRIPTION .I Libacme provides a simple C interface for interacting with -.IR acme (1) +.MR acme (1) windows. .PP A @@ -168,7 +168,7 @@ Most of the library routines access files in the window's .I acme directory. See -.IR acme (4) +.MR acme (4) for details. Many library routines take a format string .I fmt @@ -179,11 +179,11 @@ denotes the result of formatting the string and arguments using .I smprint (see -.IR print (3)). +.MR print (3) ). .PP .I Pipetowin runs the -.IR rc (1) +.MR rc (1) command line .I fmt\fR, \fP... with @@ -199,7 +199,7 @@ Otherwise the command inherits the caller's standard error. .PP .I Pipewinto runs the -.IR rc (1) +.MR rc (1) command line .I fmt\fR, \fP... with the window's @@ -300,7 +300,7 @@ to position relative to .I type (see -.IR seek (3)). +.MR seek (3) ). .PP .I Winwrite writes the @@ -317,7 +317,7 @@ The fields correspond to the fields in .IR acme 's event messages. See -.IR acme (4) +.MR acme (4) for detailed explanations. The fields are: .TP @@ -384,7 +384,7 @@ that it should be handled internally. returns a pointer to a .B Channel (see -.IR thread (3)) +.MR thread (3) ) on which event structures (not pointers) can be read. The first call to .I wineventchan @@ -404,20 +404,20 @@ after calling and .I evsmprint are like -.IR malloc (3), +.MR malloc (3) , .IR realloc , .IR strdup (see -.IR strcat (3)), +.MR strcat (3) ), and .IR vsmprint (see -.IR print (3)), +.MR print (3) ), but they call -.IR sysfatal (3) +.MR sysfatal (3) on error rather than returning nil. .SH SOURCE .B \*9/src/libacme .SH SEE ALSO -.IR acme (1), -.IR acme (4) +.MR acme (1) , +.MR acme (4) diff --git a/man/man3/addpt.3 b/man/man3/addpt.3 index c00a1de1..74d19634 100644 --- a/man/man3/addpt.3 +++ b/man/man3/addpt.3 @@ -185,4 +185,4 @@ They are implemented as macros. .SH SOURCE .B \*9/src/libdraw .SH SEE ALSO -.IR graphics (3) +.MR graphics (3) diff --git a/man/man3/aes.3 b/man/man3/aes.3 index 06f42de5..94ff54a7 100644 --- a/man/man3/aes.3 +++ b/man/man3/aes.3 @@ -39,13 +39,13 @@ cryptographically strongly unpredictable. .SH SOURCE .B \*9/src/libsec .SH SEE ALSO -.IR mp (3), -.IR blowfish (3), -.IR des (3), -.IR dsa (3), -.IR elgamal (3), -.IR rc4 (3), -.IR rsa (3), -.IR sechash (3), -.IR prime (3), -.IR rand (3) +.MR mp (3) , +.MR blowfish (3) , +.MR des (3) , +.MR dsa (3) , +.MR elgamal (3) , +.MR rc4 (3) , +.MR rsa (3) , +.MR sechash (3) , +.MR prime (3) , +.MR rand (3) diff --git a/man/man3/allocimage.3 b/man/man3/allocimage.3 index 8bfd323d..518d6b32 100644 --- a/man/man3/allocimage.3 +++ b/man/man3/allocimage.3 @@ -135,7 +135,7 @@ The field will have been set to the identifying number used by .B /dev/draw (see -.IR draw (3)), +.MR draw (3) ), and the .I cache field will be zero. @@ -148,7 +148,7 @@ The field will be set to the number of bits per pixel specified by the channel descriptor (see -.IR image (7)). +.MR image (7) ). .I Allocimage returns 0 if the server has run out of image memory. .PP @@ -191,7 +191,7 @@ These routines permit unrelated applications sharing a display to share an image for example they provide the mechanism behind .B getwindow (see -.IR graphics (3)). +.MR graphics (3) ). .PP The RGB values in a color are .I premultiplied @@ -214,7 +214,7 @@ values between image and user space or external files. There is a fixed format for the exchange and storage of image data (see -.IR image (7)). +.MR image (7) ). .PP .I Unloadimage reads a rectangle of pixels from image @@ -271,7 +271,7 @@ but for bytes of compressed image .I data (see -.IR image (7)). +.MR image (7) ). On each call to .IR cloadimage, the @@ -289,7 +289,7 @@ return the number of bytes copied. .PP .I Readimage creates an image from data contained in an external file (see -.IR image (7) +.MR image (7) for the file format); .I fd is a file descriptor obtained by opening such a file for reading. @@ -333,10 +333,10 @@ To allocate a single-pixel replicated image that may be used to paint a region r .SH SOURCE .B \*9/src/libdraw .SH "SEE ALSO" -.IR graphics (3), -.IR draw (3), -.IR draw (3), -.IR image (7) +.MR graphics (3) , +.MR draw (3) , +.MR draw (3) , +.MR image (7) .SH DIAGNOSTICS These functions return pointer 0 or integer \-1 on failure, usually due to insufficient memory. diff --git a/man/man3/arg.3 b/man/man3/arg.3 index 3124930d..d9aa812f 100644 --- a/man/man3/arg.3 +++ b/man/man3/arg.3 @@ -20,7 +20,7 @@ These macros assume the names and .I argv are in scope; see -.IR exec (3). +.MR exec (3) . .I ARGBEGIN and .I ARGEND @@ -58,7 +58,7 @@ but instead of returning zero runs .I code and, if that returns, calls -.IR abort (3). +.MR abort (3) . A typical value for .I code is diff --git a/man/man3/arith3.3 b/man/man3/arith3.3 index 1e764c7b..039df33e 100644 --- a/man/man3/arith3.3 +++ b/man/man3/arith3.3 @@ -266,4 +266,4 @@ Subtract the coordinates of two points. .SH SOURCE .B \*9/src/libgeometry .SH "SEE ALSO -.IR matrix (3) +.MR matrix (3) diff --git a/man/man3/atof.3 b/man/man3/atof.3 index 0da22379..8b462aa9 100644 --- a/man/man3/atof.3 +++ b/man/man3/atof.3 @@ -129,7 +129,7 @@ after calling .SH SOURCE .B \*9/src/lib9 .SH SEE ALSO -.IR fscanf (3) +.MR fscanf (3) .SH DIAGNOSTICS Zero is returned if the beginning of the input string is not interpretable as a number; even in this case, @@ -175,4 +175,4 @@ are preprocessor macros defined as and .IR p9atoll ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/auth.3 b/man/man3/auth.3 index 24189822..9fda7de3 100644 --- a/man/man3/auth.3 +++ b/man/man3/auth.3 @@ -95,7 +95,7 @@ CFsys* nsamount(char *name, char *aname); .SH DESCRIPTION .PP This library, in concert with -.IR factotum (4), +.MR factotum (4) , is used to authenticate users. It provides the primary interface to .IR factotum . @@ -168,7 +168,7 @@ It provides the primary interface to The following routines use the .B AuthInfo structure returned after a successful authentication by -.IR factotum (4). +.MR factotum (4) . .PP .ne 8 .EX @@ -212,11 +212,11 @@ file, as opened by An .B sprint (see -.IR print (3)) +.MR print (3) ) of .I fmt and the variable arg list yields a key template (see -.IR factotum (4)) +.MR factotum (4) ) specifying the key to use. The template must specify at least the protocol ( .BI proto= xxx ) @@ -258,7 +258,7 @@ arranges a connection to either by opening .B /mnt/factotum/rpc or by using -.IR 9pclient (3) +.MR 9pclient (3) to connect to a .B factotum service posted in the current name space. @@ -266,7 +266,7 @@ The returned connection is freed using .IR auth_freerpc . Individual commands can be sent to -.IR factotum (4) +.MR factotum (4) by invoking .IR auth_rpc . .PP @@ -418,7 +418,7 @@ and but execute the protocol on a .B CFid* (see -.IR 9pclient (3)) +.MR 9pclient (3) ) instead of a file descriptor. .PP .I Fsamount @@ -429,15 +429,15 @@ are like and .I nsmount (see -.IR 9pclient (3)) +.MR 9pclient (3) ) but use .I factotum to authenticate to the file servers. .SH SOURCE .B \*9/src/libauth .SH SEE ALSO -.IR factotum (4), -.IR authsrv (3) +.MR factotum (4) , +.MR authsrv (3) .SH DIAGNOSTICS These routines set .IR errstr . diff --git a/man/man3/authsrv.3 b/man/man3/authsrv.3 index a0b68578..e1ace0c4 100644 --- a/man/man3/authsrv.3 +++ b/man/man3/authsrv.3 @@ -68,7 +68,7 @@ If is non-nil, the network database (see -.IR ndb (1)) +.MR ndb (1) ) is queried for an entry which contains .B authdom=\fIad\fP or @@ -212,10 +212,10 @@ to recieve an answer. .SH SOURCE .B \*9/src/libauthsrv .SH SEE ALSO -.IR passwd (1), -.IR dial (3), +.MR passwd (1) , +.MR dial (3) , Plan 9's -\fIauthsrv\fR(6). +.IR authsrv (6). .SH DIAGNOSTICS These routines set .IR errstr . diff --git a/man/man3/bin.3 b/man/man3/bin.3 index c888193f..e8685494 100644 --- a/man/man3/bin.3 +++ b/man/man3/bin.3 @@ -82,7 +82,7 @@ are ignored, and the result is the same as calling and .I bingrow allocate large chunks of memory using -.IR malloc (3) +.MR malloc (3) and return pieces of these chunks. The chunks are .IR free 'd @@ -91,7 +91,7 @@ upon a call to .SH SOURCE .B \*9/src/libbin .SH SEE ALSO -.IR malloc (3) +.MR malloc (3) .SH DIAGNOSTICS .I binalloc and diff --git a/man/man3/bio.3 b/man/man3/bio.3 index 0c48bea6..05721f8b 100644 --- a/man/man3/bio.3 +++ b/man/man3/bio.3 @@ -93,7 +93,7 @@ for mode or creates for mode .BR OWRITE . It calls -.IR malloc (3) +.MR malloc (3) to allocate a buffer. .PP .I Bfdopen @@ -104,7 +104,7 @@ for mode or .BR OWRITE . It calls -.IR malloc (3) +.MR malloc (3) to allocate a buffer. .PP .I Binit @@ -173,7 +173,7 @@ of the most recent string returned by .PP .I Brdstr returns a -.IR malloc (3)-allocated +.MR malloc (3) -allocated buffer containing the next line of input delimited by .IR delim , terminated by a NUL (0) byte. @@ -225,7 +225,7 @@ may back up a maximum of five bytes. uses .I charstod (see -.IR atof (3)) +.MR atof (3) ) and .I Bgetc to read the formatted @@ -246,7 +246,7 @@ and a negative value is returned if a read error occurred. .PP .I Bseek applies -.IR seek (3) +.MR seek (3) to .IR bp . It returns the new file offset. @@ -278,7 +278,7 @@ on the output stream. .PP .I Bprint is a buffered interface to -.IR print (3). +.MR print (3) . If this causes a .IR write to occur and there is an error, @@ -325,10 +325,10 @@ written. .SH SOURCE .B \*9/src/libbio .SH SEE ALSO -.IR open (3), -.IR print (3), -.IR exits (3), -.IR utf (7), +.MR open (3) , +.MR print (3) , +.MR exits (3) , +.MR utf (7) , .SH DIAGNOSTICS .I Bio routines that return integers yield diff --git a/man/man3/blowfish.3 b/man/man3/blowfish.3 index 20d43f66..95d77507 100644 --- a/man/man3/blowfish.3 +++ b/man/man3/blowfish.3 @@ -40,13 +40,13 @@ must be a multiple of eight bytes as padding is currently unsupported. .SH SOURCE .B \*9/src/libsec .SH SEE ALSO -.IR mp (3), -.IR aes (3), -.IR des (3), -.IR dsa (3), -.IR elgamal (3), -.IR rc4 (3), -.IR rsa (3), -.IR sechash (3), -.IR prime (3), -.IR rand (3) +.MR mp (3) , +.MR aes (3) , +.MR des (3) , +.MR dsa (3) , +.MR elgamal (3) , +.MR rc4 (3) , +.MR rsa (3) , +.MR sechash (3) , +.MR prime (3) , +.MR rand (3) diff --git a/man/man3/cachechars.3 b/man/man3/cachechars.3 index f2d82f19..1b2cc5b0 100644 --- a/man/man3/cachechars.3 +++ b/man/man3/cachechars.3 @@ -30,7 +30,7 @@ A may contain too many characters to hold in memory simultaneously. The graphics library and draw device (see -.IR draw (3)) +.MR draw (3) ) cooperate to solve this problem by maintaining a cache of recently used character images. The details of this cooperation need not be known by most programs: @@ -127,7 +127,7 @@ A .B Font consists of an overall height and ascent and a collection of subfonts together with the ranges of runes (see -.IR utf (7)) +.MR utf (7) ) they represent. Fonts are described by the following structures. .IP @@ -181,7 +181,7 @@ The and .LR ascent fields of Font are described in -.IR graphics (3). +.MR graphics (3) . .L Sub contains .L nsub @@ -302,12 +302,12 @@ for replacement when the cache is full. .SH SOURCE .B \*9/src/libdraw .SH SEE ALSO -.IR graphics (3), -.IR allocimage (3), -.IR draw (3), -.IR subfont (3), -.IR image (7), -.IR font (7) +.MR graphics (3) , +.MR allocimage (3) , +.MR draw (3) , +.MR subfont (3) , +.MR image (7) , +.MR font (7) .SH DIAGNOSTICS All of the functions use the graphics error function (see -.IR graphics (3)). +.MR graphics (3) ). diff --git a/man/man3/cleanname.3 b/man/man3/cleanname.3 index efb7d823..75fdd805 100644 --- a/man/man3/cleanname.3 +++ b/man/man3/cleanname.3 @@ -31,4 +31,4 @@ must contain room for at least two bytes. .SH SOURCE .B \*9/src/lib9/cleanname.c .SH SEE ALSO -.IR cleanname (1) +.MR cleanname (1) diff --git a/man/man3/color.3 b/man/man3/color.3 index 5428337b..e08d9194 100644 --- a/man/man3/color.3 +++ b/man/man3/color.3 @@ -19,7 +19,7 @@ int cmap2rgba(int col) .SH DESCRIPTION These routines convert between `true color' red/green/blue triples and the Plan 9 color map. See -.IR color (7) +.MR color (7) for a description of RGBV, the standard color map. .PP .I Rgb2cmap @@ -41,16 +41,16 @@ and the next 8 representing blue, then green, then red, as for .I cmap2rgba shifted up 8 bits. This 32-bit representation is the format used by -.IR draw (3) +.MR draw (3) and -.IR memdraw (3) +.MR memdraw (3) library routines that take colors as arguments. .SH SOURCE .B \*9/src/libdraw .SH SEE ALSO -.IR graphics (3), -.IR allocimage (3), -.IR draw (3), -.IR image (7), -.IR color (7) +.MR graphics (3) , +.MR allocimage (3) , +.MR draw (3) , +.MR image (7) , +.MR color (7) diff --git a/man/man3/complete.3 b/man/man3/complete.3 index 52702acc..f1d0c280 100644 --- a/man/man3/complete.3 +++ b/man/man3/complete.3 @@ -86,15 +86,15 @@ function frees a structure and its contents. .PP In -.IR rio (1) +.MR rio (1) and -.IR acme (1), +.MR acme (1) , file name completion is triggered by a control-F character or an Insert character. .SH SOURCE .B \*9/src/libcomplete .SH SEE ALSO -.IR rio (1), -.IR acme (1) +.MR rio (1) , +.MR acme (1) .SH DIAGNOSTICS The .I complete diff --git a/man/man3/ctime.3 b/man/man3/ctime.3 index 5491d39f..5d80d411 100644 --- a/man/man3/ctime.3 +++ b/man/man3/ctime.3 @@ -26,7 +26,7 @@ long tm2sec(Tm *tm) converts a time .I clock such as returned by -.IR time (3) +.MR time (3) into .SM ASCII (sic) @@ -85,8 +85,8 @@ is not .br .B \*9/src/lib9/tm2sec.c .SH "SEE ALSO" -.IR date (1), -.IR time (3) +.MR date (1) , +.MR time (3) .SH BUGS The return values point to static data whose content is overwritten by each call. @@ -112,4 +112,4 @@ are preprocessor macros defined as and .IR p9tm2sec ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/des.3 b/man/man3/des.3 index 3c3cd201..686fc4c9 100644 --- a/man/man3/des.3 +++ b/man/man3/des.3 @@ -132,13 +132,13 @@ using .SH SOURCE .B \*9/src/libsec .SH SEE ALSO -.IR mp (3), -.IR aes (3), -.IR blowfish (3), -.IR dsa (3), -.IR elgamal (3), -.IR rc4 (3), -.IR rsa (3), -.IR sechash (3), -.IR prime (3), -.IR rand (3) +.MR mp (3) , +.MR aes (3) , +.MR blowfish (3) , +.MR dsa (3) , +.MR elgamal (3) , +.MR rc4 (3) , +.MR rsa (3) , +.MR sechash (3) , +.MR prime (3) , +.MR rand (3) diff --git a/man/man3/dial.3 b/man/man3/dial.3 index 39092ae0..24efc702 100644 --- a/man/man3/dial.3 +++ b/man/man3/dial.3 @@ -264,7 +264,7 @@ int callkremvax(void) .EE .PP Connect to a Unix socket served by -.IR acme (4): +.MR acme (4) : .IP .EX int dialacme(void) @@ -346,4 +346,4 @@ are preprocessor macros defined as .IR p9announce , and so on; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/dirread.3 b/man/man3/dirread.3 index 2522e9a6..cce8d978 100644 --- a/man/man3/dirread.3 +++ b/man/man3/dirread.3 @@ -19,11 +19,11 @@ long dirreadall(int fd, Dir **buf) #define DIRMAX (sizeof(Dir)+STATMAX) .SH DESCRIPTION The data returned by a -.IR read (3) +.MR read (3) on a directory is a set of complete directory entries in a machine-independent format, exactly equivalent to the result of a -.IR stat (3) +.MR stat (3) on each file or subdirectory in the directory. .I Dirread decodes the directory entries into a machine-dependent form. @@ -35,11 +35,11 @@ structures whose address is returned in .B *buf (see -.IR stat (3) +.MR stat (3) for the layout of a .BR Dir ). The array is allocated with -.IR malloc (3) +.MR malloc (3) each time .I dirread is called. @@ -50,7 +50,7 @@ is like but reads in the entire directory; by contrast, .I dirread steps through a directory one -.IR read (3) +.MR read (3) at a time. .PP Directory entries have variable length. @@ -85,9 +85,9 @@ The file offset is advanced by the number of bytes actually read. .SH SOURCE .B \*9/src/lib9/dirread.c .SH SEE ALSO -.IR intro (3), -.IR open (3), -.IR read (3) +.MR intro (3) , +.MR open (3) , +.MR read (3) .SH DIAGNOSTICS .I Dirread and diff --git a/man/man3/draw.3 b/man/man3/draw.3 index 1fa5dea1..4ad680b3 100644 --- a/man/man3/draw.3 +++ b/man/man3/draw.3 @@ -259,7 +259,7 @@ The clipping region may be modified dynamically using .TP .B chan The pixel channel format descriptor, as described in -.IR image (7). +.MR image (7) . The value should not be modified after the image is created. .TP .B depth @@ -268,7 +268,7 @@ number of bits per pixel in the picture; it is identically .B chantodepth(chan) (see -.IR graphics (3)) +.MR graphics (3) ) and is provided as a convenience. The value should not be modified after the image is created. .TP @@ -712,7 +712,7 @@ what is to .B atan (see -.IR sin (3)). +.MR sin (3) ). .TP .BI border( dst\fP,\fP\ r\fP,\fP\ i\fP,\fP\ color\fP,\fP\ sp\fP) .I Border @@ -810,11 +810,11 @@ is non-zero. .SH SOURCE .B \*9/src/libdraw .SH SEE ALSO -.IR graphics (3), -.IR stringsize (3), -.IR color (7), -.IR utf (7), -.IR addpt (3) +.MR graphics (3) , +.MR stringsize (3) , +.MR color (7) , +.MR utf (7) , +.MR addpt (3) .PP T. Porter, T. Duff. ``Compositing Digital Images'', diff --git a/man/man3/drawfcall.3 b/man/man3/drawfcall.3 index 1c8d376b..1ee37cd8 100644 --- a/man/man3/drawfcall.3 +++ b/man/man3/drawfcall.3 @@ -30,15 +30,15 @@ int readwsysmsg(int fd, uchar *buf, uint nbuf) uint sizeW2M(Wsysmsg *w) .SH DESCRIPTION These routines are analogues of the routines described in -.IR fcall (3). +.MR fcall (3) . They manipulate graphics device protocol messages rather than 9P protocol messages. The graphics device protocol is used for internal communication between the -.IR devdraw (1) +.MR devdraw (1) graphics server and the -.IR draw (3) +.MR draw (3) library. A .B Wsysmsg @@ -48,6 +48,6 @@ The protocol is intentionally undocumented and may change. .SH SOURCE .B \*9/src/libdraw/drawfcall.c .SH SEE ALSO -.IR devdraw (1), -.IR draw (3), -.IR graphics (3) +.MR devdraw (1) , +.MR draw (3) , +.MR graphics (3) diff --git a/man/man3/dsa.3 b/man/man3/dsa.3 index 41532b89..78714010 100644 --- a/man/man3/dsa.3 +++ b/man/man3/dsa.3 @@ -84,7 +84,7 @@ and generated by .IR DSAprimes (see -.IR prime (3)). +.MR prime (3) ). Otherwise, .B p and @@ -128,17 +128,17 @@ are provided to manage signature storage. converts an ASN1 formatted DSA private key into the corresponding .B DSApriv structure; see -.IR rsa (3) +.MR rsa (3) for other ASN1 routines. .SH SOURCE .B \*9/src/libsec .SH SEE ALSO -.IR mp (3), -.IR aes (3), -.IR blowfish (3), -.IR des (3), -.IR rc4 (3), -.IR rsa (3), -.IR sechash (3), -.IR prime (3), -.IR rand (3) +.MR mp (3) , +.MR aes (3) , +.MR blowfish (3) , +.MR des (3) , +.MR rc4 (3) , +.MR rsa (3) , +.MR sechash (3) , +.MR prime (3) , +.MR rand (3) diff --git a/man/man3/dup.3 b/man/man3/dup.3 index 392e6fe6..26887363 100644 --- a/man/man3/dup.3 +++ b/man/man3/dup.3 @@ -36,4 +36,4 @@ To avoid name conflicts with the underlying system, is a preprocessor macro defined as .IR p9dup ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/elgamal.3 b/man/man3/elgamal.3 index 2fc75ac6..af4bc03b 100644 --- a/man/man3/elgamal.3 +++ b/man/man3/elgamal.3 @@ -113,13 +113,13 @@ are provided to manage signature storage. .SH SOURCE .B \*9/src/libsec .SH SEE ALSO -.IR mp (3), -.IR aes (3), -.IR blowfish (3), -.IR des (3), -.IR dsa (3), -.IR rc4 (3), -.IR rsa (3), -.IR sechash (3), -.IR prime (3), -.IR rand (3) +.MR mp (3) , +.MR aes (3) , +.MR blowfish (3) , +.MR des (3) , +.MR dsa (3) , +.MR rc4 (3) , +.MR rsa (3) , +.MR sechash (3) , +.MR prime (3) , +.MR rand (3) diff --git a/man/man3/encode.3 b/man/man3/encode.3 index fde8296c..57b5cd08 100644 --- a/man/man3/encode.3 +++ b/man/man3/encode.3 @@ -49,9 +49,9 @@ of 8. .PP .I Encodefmt can be used with -.IR fmtinstall (3) +.MR fmtinstall (3) and -.IR print (3) +.MR print (3) to print encoded representations of byte arrays. The verbs are .TP diff --git a/man/man3/encrypt.3 b/man/man3/encrypt.3 index 1f44689d..894020d8 100644 --- a/man/man3/encrypt.3 +++ b/man/man3/encrypt.3 @@ -84,4 +84,4 @@ are preprocessor macros defined as and .IR p9decrypt ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/errstr.3 b/man/man3/errstr.3 index 3964d8d5..703f2ee0 100644 --- a/man/man3/errstr.3 +++ b/man/man3/errstr.3 @@ -53,7 +53,7 @@ the result is an empty string. The verb .B r in -.IR print (3) +.MR print (3) calls .I errstr and outputs the error string. @@ -92,8 +92,8 @@ will reset .I Errstr always returns 0. .SH SEE ALSO -.IR intro (3), -.IR perror (3) +.MR intro (3) , +.MR perror (3) .SH BUGS The implementation sets .I errno @@ -104,4 +104,4 @@ When .I errno is set to other values, the error string is synthesized using -.IR strerror (3). +.MR strerror (3) . diff --git a/man/man3/event.3 b/man/man3/event.3 index 5991a17d..f76e5ea2 100644 --- a/man/man3/event.3 +++ b/man/man3/event.3 @@ -93,12 +93,12 @@ enum{ These routines provide an interface to multiple sources of input for unthreaded programs. Threaded programs (see -.IR thread (3)) +.MR thread (3) ) should instead use the threaded mouse and keyboard interface described in -.IR mouse (3) +.MR mouse (3) and -.IR keyboard (3). +.MR keyboard (3) . .PP .I Einit must be called first. @@ -113,7 +113,7 @@ the mouse and keyboard events will be enabled; in this case, .IR initdraw (see -.IR graphics (3)) +.MR graphics (3) ) must have already been called. The user must provide a function called .IR eresized @@ -123,7 +123,7 @@ is running has been resized; the argument is a flag specifying whether the program must call .I getwindow (see -.IR graphics (3)) +.MR graphics (3) ) to re-establish a connection to its window. After resizing (and perhaps calling .IR getwindow ), @@ -266,7 +266,7 @@ The return is the same as for .IR eread . .PP As described in -.IR graphics (3), +.MR graphics (3) , the graphics functions are buffered. .IR Event , .IR eread , @@ -370,15 +370,15 @@ changes the cursor image to that described by the .B Cursor .I c (see -.IR mouse (3)). +.MR mouse (3) ). If .B c is nil, it restores the image to the default arrow. .SH SOURCE .B \*9/src/libdraw .SH "SEE ALSO" -.IR rio (1), -.IR graphics (3), -.IR plumb (3), +.MR rio (1) , +.MR graphics (3) , +.MR plumb (3) , .\" .IR cons (3), -.IR draw (3) +.MR draw (3) diff --git a/man/man3/exec.3 b/man/man3/exec.3 index 1a0a8a87..51096cc9 100644 --- a/man/man3/exec.3 +++ b/man/man3/exec.3 @@ -25,11 +25,11 @@ points to the name of the file to be executed; it must not be a directory, and the permissions must allow the current user to execute it (see -.IR stat (3)). +.MR stat (3) ). It should also be a valid binary image, as defined by the local operating system, or a shell script (see -.IR rc (1)). +.MR rc (1) ). The first line of a shell script must begin with .L #! @@ -92,24 +92,24 @@ files remain open across .B OCEXEC OR'd into the open mode; see -.IR open (3)); +.MR open (3) ); and the working directory and environment (see -.IR getenv (3)) +.MR getenv (3) ) remain the same. However, a newly .I exec'ed process has no notification handlers (see -.IR notify (3)). +.MR notify (3) ). .SH SOURCE .B \*9/src/lib9/exec.c .br .B \*9/src/lib9/execl.c .SH SEE ALSO -.IR prof (1), -.IR intro (3), -.IR stat (3) +.MR prof (1) , +.MR intro (3) , +.MR stat (3) .SH DIAGNOSTICS If these functions fail, they return and set .IR errstr . @@ -138,4 +138,4 @@ are preprocessor macros defined as and .IR p9execl ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/exits.3 b/man/man3/exits.3 index 1bab40af..2f4b1f4f 100644 --- a/man/man3/exits.3 +++ b/man/man3/exits.3 @@ -39,7 +39,7 @@ explanation of the reason for exiting, or a null pointer or empty string to indicate normal termination. The string is passed to the parent process, prefixed by the name and process id of the exiting process, when the parent does a -.IR wait (3). +.MR wait (3) . .PP Before calling .I _exits @@ -85,8 +85,8 @@ cancels a previous registration of an exit function. .br .B \*9/src/lib9/_exits.c .SH "SEE ALSO" -.IR fork (2), -.IR wait (3) +.MR fork (2) , +.MR wait (3) .SH BUGS Because of limitations of Unix, the exit status of a process can only be an 8-bit integer. @@ -117,4 +117,4 @@ are preprocessor macros defined as and .IR p9atexitdont ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/fcall.3 b/man/man3/fcall.3 index fe696a4b..5e9bd195 100644 --- a/man/man3/fcall.3 +++ b/man/man3/fcall.3 @@ -225,7 +225,7 @@ by a successful call to Another structure is .BR Dir , used by the routines described in -.IR stat (3). +.MR stat (3) . .I ConvM2D converts the machine-independent form starting at .I ap @@ -293,7 +293,7 @@ contain a validly formatted machine-independent entry suitable as an argument, for example, for the .B wstat (see -.IR stat (3)) +.MR stat (3) ) system call. It checks that the sizes of all the elements of the the entry sum to exactly .IR nbuf , @@ -321,7 +321,7 @@ for an incorrectly formatted entry. and .I dirmodefmt are formatting routines, suitable for -.IR fmtinstall (3). +.MR fmtinstall (3) . They convert .BR Dir* , .BR Fcall* , @@ -343,7 +343,7 @@ with format letter .PP .I Read9pmsg calls -.IR read (3) +.MR read (3) multiple times, if necessary, to read an entire 9P message into .BR buf . The return value is 0 for end of file, or -1 for error; it does not return @@ -351,7 +351,7 @@ partial messages. .SH SOURCE .B \*9/src/lib9 .SH SEE ALSO -.IR intro (3), -.IR 9p (3), -.IR stat (3), +.MR intro (3) , +.MR 9p (3) , +.MR stat (3) , .IR intro (9p) diff --git a/man/man3/flate.3 b/man/man3/flate.3 index b7b1a197..81f82dcf 100644 --- a/man/man3/flate.3 +++ b/man/man3/flate.3 @@ -173,7 +173,7 @@ The block functions return the number of bytes produced when they succeed. .I Mkcrctab allocates (using -.IR malloc (3)), +.MR malloc (3) ), initializes, and returns a table for rapid computation of 32 bit CRC values using the polynomial .IR poly . .I Blockcrc diff --git a/man/man3/fmtinstall.3 b/man/man3/fmtinstall.3 index da766d77..b68cd008 100644 --- a/man/man3/fmtinstall.3 +++ b/man/man3/fmtinstall.3 @@ -94,16 +94,16 @@ int fmtrunestrcpy(Fmt *f, Rune *s); int errfmt(Fmt *f); .SH DESCRIPTION The interface described here allows the construction of custom -.IR print (3) +.MR print (3) verbs and output routines. In essence, they provide access to the workings of the formatted print code. .PP The -.IR print (3) +.MR print (3) suite maintains its state with a data structure called .BR Fmt . A typical call to -.IR print (3) +.MR print (3) or its relatives initializes a .B Fmt structure, passes it to subsidiary routines to process the output, @@ -154,7 +154,7 @@ to generate the output. These behave like .B fprint (see -.IR print (3)) +.MR print (3) ) or .B vfprint except that the characters are buffered until @@ -207,7 +207,7 @@ In are the width and precision, and .IB fp ->flags the decoded flags for the verb (see -.IR print (3) +.MR print (3) for a description of these items). The standard flag values are: .B FmtSign @@ -282,7 +282,7 @@ produced. .PP Some internal functions may be useful to format primitive types. They honor the width, precision and flags as described in -.IR print (3). +.MR print (3) . .I Fmtrune formats a single character .BR r . @@ -307,7 +307,7 @@ regardless of whether the output is bytes or runes. This function prints an error message with a variable number of arguments and then quits. Compared to the corresponding example in -.IR print (3), +.MR print (3) , this version uses a smaller buffer, will never truncate the output message, but might generate multiple .B write @@ -364,9 +364,9 @@ main(...) .SH SOURCE .B \*9/src/lib9/fmt .SH SEE ALSO -.IR print (3), -.IR utf (7), -.IR errstr (3) +.MR print (3) , +.MR utf (7) , +.MR errstr (3) .SH DIAGNOSTICS These routines return negative numbers or nil for errors and set .IR errstr . diff --git a/man/man3/frame.3 b/man/man3/frame.3 index 1e063802..4b027acb 100644 --- a/man/man3/frame.3 +++ b/man/man3/frame.3 @@ -73,9 +73,9 @@ enum{ This library supports .I frames of editable text in a single font on raster displays, such as in -.IR sam (1) +.MR sam (1) and -.IR 9term (1). +.MR 9term (1) . Frames may hold any character except NUL (0). Long lines are folded and tabs are at fixed intervals. .PP @@ -239,7 +239,7 @@ If a .B Frame is being moved but not resized, that is, if the shape of its containing rectangle is unchanged, it is sufficient to use -.IR draw (3) +.MR draw (3) to copy the containing rectangle from the old to the new location and then call .I frsetrects to establish the new geometry. @@ -357,6 +357,6 @@ and .SH SOURCE .B \*9/src/libframe .SH SEE ALSO -.IR graphics (3), -.IR draw (3), -.IR cachechars (3). +.MR graphics (3) , +.MR draw (3) , +.MR cachechars (3) . diff --git a/man/man3/genrandom.3 b/man/man3/genrandom.3 index ddf481e4..b5875635 100644 --- a/man/man3/genrandom.3 +++ b/man/man3/genrandom.3 @@ -25,11 +25,11 @@ number generator. The X9.17 generator is seeded by 24 truly random bytes read via .I truerand (see -.IR rand (3)). +.MR rand (3) ). .PP .I Prng uses the native -.IR rand (3) +.MR rand (3) pseudo-random number generator to fill the buffer. Used with .IR srand , this function can produce a reproducible stream of pseudo random @@ -38,8 +38,8 @@ numbers useful in testing. Both functions may be passed to .I mprand (see -.IR mp (3)). +.MR mp (3) ). .SH SOURCE .B \*9/src/libsec .SH SEE ALSO -.IR mp (3) +.MR mp (3) diff --git a/man/man3/get9root.3 b/man/man3/get9root.3 index 52fb6f09..a6bdd02f 100644 --- a/man/man3/get9root.3 +++ b/man/man3/get9root.3 @@ -49,7 +49,7 @@ if different from should be freed with .I free (see -.IR malloc (3)) +.MR malloc (3) ) when no longer needed. .PP As a convention, programs should never @@ -57,7 +57,7 @@ As a convention, programs should never paths obtained from user input. .SH EXAMPLE The -.IR plumber (4) +.MR plumber (4) uses this code to find unrooted file names included by plumb rules. .IP .EX @@ -69,7 +69,7 @@ fd = open(unsharp(buf), OREAD); .br .B \*9/src/lib9/unsharp.c .SH SEE ALSO -.IR intro (4) +.MR intro (4) .SH BUGS .I Get9root could be smarter about finding the tree when diff --git a/man/man3/getenv.3 b/man/man3/getenv.3 index a817b6ef..a37cb659 100644 --- a/man/man3/getenv.3 +++ b/man/man3/getenv.3 @@ -18,7 +18,7 @@ int putenv(char *name, char *val) fetches the environment value associated with .I name into memory allocated with -.IR malloc (3), +.MR malloc (3) , 0-terminates it, and returns a pointer to that area. If no file exists, 0 @@ -44,4 +44,4 @@ are preprocessor macros defined as and .IR p9putenv ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/getfields.3 b/man/man3/getfields.3 index feaf10d8..79a1ed78 100644 --- a/man/man3/getfields.3 +++ b/man/man3/getfields.3 @@ -75,9 +75,9 @@ with non-zero, except that fields may be quoted using single quotes, in the manner of -.IR rc (1). +.MR rc (1) . See -.IR quote (3) +.MR quote (3) for related quote-handling software. .PP .I Tokenize @@ -91,5 +91,5 @@ set to \f5"\et\er\en "\fP. .SH SEE ALSO .I strtok in -.IR strcat (3), -.IR quote (3). +.MR strcat (3) , +.MR quote (3) . diff --git a/man/man3/getns.3 b/man/man3/getns.3 index b2e03f93..6d0a5a9c 100644 --- a/man/man3/getns.3 +++ b/man/man3/getns.3 @@ -14,9 +14,9 @@ returns a pointer to a malloced string that contains the path to the name space directory for the current process. The name space directory is a clumsy substitute for Plan 9's per-process name spaces; see -.IR intro (4) +.MR intro (4) for details. .SH SOURCE .B \*9/src/lib9/getns.c .SH SEE ALSO -.IR intro (4) +.MR intro (4) diff --git a/man/man3/getsnarf.3 b/man/man3/getsnarf.3 index 938aae3f..30d22082 100644 --- a/man/man3/getsnarf.3 +++ b/man/man3/getsnarf.3 @@ -20,7 +20,7 @@ returns a copy of the current buffer; the returned pointer should be freed with .I free (see -.IR malloc (3)) +.MR malloc (3) ) when no longer needed. .PP .I Putsnarf @@ -36,4 +36,4 @@ will convert as necessary. .SH SOURCE .B \*9/src/libdraw/snarf.c .SH SEE ALSO -.IR snarfer (1) +.MR snarfer (1) diff --git a/man/man3/getuser.3 b/man/man3/getuser.3 index 41e78e3d..45531b4c 100644 --- a/man/man3/getuser.3 +++ b/man/man3/getuser.3 @@ -19,7 +19,7 @@ name of the user who owns the current process. .I Getuser calls -.IR getuid (2) +.MR getuid (2) and then reads .B /etc/passwd to find the corresponding name. @@ -33,7 +33,7 @@ looks first for an environment variable If there is no such variable, .I sysname calls -.IR gethostname (2) +.MR gethostname (2) and truncates the returned name at the first dot. If .I gethostname diff --git a/man/man3/getwd.3 b/man/man3/getwd.3 index 245914f3..f9ef1949 100644 --- a/man/man3/getwd.3 +++ b/man/man3/getwd.3 @@ -23,10 +23,10 @@ bytes in the buffer provided. .SH SOURCE .B \*9/src/lib9/getwd.c .SH "SEE ALSO" -.IR pwd (1) +.MR pwd (1) .SH DIAGNOSTICS On error, zero is returned. -.IR Errstr (3) +.MR Errstr (3) may be consulted for more information. .SH BUGS To avoid name conflicts with the underlying system, @@ -34,4 +34,4 @@ To avoid name conflicts with the underlying system, is a preprocessor macro defined as .IR p9getwd ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/graphics.3 b/man/man3/graphics.3 index 4f58451a..da0b61cf 100644 --- a/man/man3/graphics.3 +++ b/man/man3/graphics.3 @@ -107,7 +107,7 @@ extern Font *font A .B Display structure represents a connection to the graphics device, -.IR draw (3), +.MR draw (3) , holding all graphics resources associated with the connection, including in particular raster image data in use by the client program. The structure is defined (in part) as: @@ -135,7 +135,7 @@ A .B Point is a location in an Image (see below and -.IR draw (3)), +.MR draw (3) ), such as the display, and is defined as: .IP .EX @@ -184,18 +184,18 @@ contains the coordinates of the first point beyond the rectangle. The .B Image data structure is defined in -.IR draw (3). +.MR draw (3) . .PP A .B Font is a set of character images, indexed by runes (see -.IR utf (7)). +.MR utf (7) ). The images are organized into .BR Subfonts , each containing the images for a small, contiguous set of runes. The detailed format of these data structures, which are described in detail in -.IR cachechars (3), +.MR cachechars (3) , is immaterial for most applications. .B Font and @@ -210,7 +210,7 @@ and the distance from the top of the highest character to the bottom of the lowest character (and hence, the interline spacing). See -.IR cachechars (3) +.MR cachechars (3) for more details. .PP .I Buildfont @@ -221,7 +221,7 @@ returning a pointer that can be used by .B string (see -.IR draw (3)) +.MR draw (3) ) to draw characters from the font. .I Openfont does the same, but reads the description @@ -231,7 +231,7 @@ frees a font. In contrast to Plan 9, font names in Plan 9 from User Space are a small language describing the desired font. See -.IR font (7) +.MR font (7) for details. .PP A @@ -274,7 +274,7 @@ structure representing the connection), (an .B Image representing the display memory itself or, if -.IR rio (1) +.MR rio (1) is running, the client's window), and .B font @@ -287,7 +287,7 @@ which is written to .B /dev/label if non-nil so that it can be used to identify the window when hidden (see -.IR rio (1)). +.MR rio (1) ). The font is created by reading the named .I font file. If @@ -301,7 +301,7 @@ if is not set, it imports the default (usually minimal) font from the operating system. (See -.IR font (7) +.MR font (7) for a full discussion of font syntaxes.) The global .I font @@ -322,7 +322,7 @@ is nil, the library provides a default, called Another effect of .I initdraw is that it installs -.IR print (3) +.MR print (3) formats .I Pfmt and @@ -360,9 +360,9 @@ and files; and .I ref specifies the refresh function to be used to create the window, if running under -.IR rio (1) +.MR rio (1) (see -.IR window (3)). +.MR window (3) ). .\" .PP .\" The function .\" .I newwindow @@ -435,11 +435,11 @@ by looking in to find the name of the window and opening it using .B namedimage (see -.IR allocimage (3)). +.MR allocimage (3) ). The resulting window will be created using the refresh method .I ref (see -.IR window (3)); +.MR window (3) ); this should almost always be .B Refnone because @@ -456,7 +456,7 @@ defining the window (or the overall display, if no window system is running); an a pointer to the .B Screen representing the root of the window's hierarchy. (See -.IR window (3). +.MR window (3) . The overloading of the .B screen word is an unfortunate historical accident.) @@ -528,15 +528,15 @@ the window boundaries; otherwise is a no-op. .PP The graphics functions described in -.IR draw (3), -.IR allocimage (3), -.IR cachechars (3), +.MR draw (3) , +.MR allocimage (3) , +.MR cachechars (3) , and -.IR subfont (3) +.MR subfont (3) are implemented by writing commands to files under .B /dev/draw (see -.IR draw (3)); +.MR draw (3) ); the writes are buffered, so the functions may not take effect immediately. .I Flushimage flushes the buffer, doing all pending graphics operations. @@ -546,7 +546,7 @@ is non-zero, any changes are also copied from the `soft screen' (if any) in the driver to the visible frame buffer. The various allocation routines in the library flush automatically, as does the event package (see -.IR event (3)); +.MR event (3) ); most programs do not need to call .IR flushimage . It returns \-1 on error. @@ -563,13 +563,13 @@ and .I chantostr convert between the channel descriptor strings used by -.IR image (7) +.MR image (7) and the internal .B ulong representation used by the graphics protocol (see -.IR draw (3)'s +.MR draw (3) 's .B b message). .B Chantostr @@ -599,7 +599,7 @@ if(getwindow(display, Refnone) < 0) .EE .PP To create and set up a new -.IR rio (1) +.MR rio (1) window, .IP .EX @@ -630,23 +630,23 @@ if(gengetwindow(display, "/tmp/winname", .SH SOURCE .B \*9/src/libdraw .SH "SEE ALSO" -.IR rio (1), -.IR addpt (3), -.IR allocimage (3), -.IR cachechars (3), -.IR subfont (3), -.IR draw (3), -.IR event (3), -.IR frame (3), -.IR print (3), -.IR window (3), -.IR draw (3), +.MR rio (1) , +.MR addpt (3) , +.MR allocimage (3) , +.MR cachechars (3) , +.MR subfont (3) , +.MR draw (3) , +.MR event (3) , +.MR frame (3) , +.MR print (3) , +.MR window (3) , +.MR draw (3) , .\" .IR rio (4), -.IR image (7), -.IR font (7) +.MR image (7) , +.MR font (7) .SH DIAGNOSTICS An error function may call -.IR errstr (3) +.MR errstr (3) for further diagnostics. .SH BUGS The names diff --git a/man/man3/html.3 b/man/man3/html.3 index 7dc486ae..b77fda91 100644 --- a/man/man3/html.3 +++ b/man/man3/html.3 @@ -1411,7 +1411,7 @@ would not otherwise fit), and .SH SOURCE .B \*9/src/libhtml .SH SEE ALSO -.IR fmt (1) +.MR fmt (1) .PP W3C World Wide Web Consortium, ``HTML 4.01 Specification''. diff --git a/man/man3/ioproc.3 b/man/man3/ioproc.3 index a87fa775..38609d7b 100644 --- a/man/man3/ioproc.3 +++ b/man/man3/ioproc.3 @@ -80,14 +80,14 @@ and execute the similarly named library or system calls (see -.IR close (2), -.IR dial (3), -.IR open (3), -.IR read (3), -.IR fcall (3), -.IR sendfd (3), +.MR close (2) , +.MR dial (3) , +.MR open (3) , +.MR read (3) , +.MR fcall (3) , +.MR sendfd (3) , and -.IR sleep (3)) +.MR sleep (3) ) in the slave process associated with .IR io . It is an error to execute more than one call @@ -187,10 +187,10 @@ ioread(Ioproc *io, int fd, void *a, long n) .SH SOURCE .B \*9/src/libthread .SH SEE ALSO -.IR dial (3), -.IR open (3), -.IR read (3), -.IR thread (3) +.MR dial (3) , +.MR open (3) , +.MR read (3) , +.MR thread (3) .SH BUGS .I Iointerrupt is currently unimplemented. diff --git a/man/man3/ip.3 b/man/man3/ip.3 index 2d9e8289..da3855ed 100644 --- a/man/man3/ip.3 +++ b/man/man3/ip.3 @@ -126,7 +126,7 @@ The string representation of Ethernet addresses is exactly .PP .I Eipfmt is a -.IR print (3) +.MR print (3) formatter for Ethernet (verb .BR E ) addresses, @@ -340,4 +340,4 @@ point to point. .SH SOURCE .B \*9/src/libip .SH SEE ALSO -.IR print (3) +.MR print (3) diff --git a/man/man3/isalpharune.3 b/man/man3/isalpharune.3 index 7b5cf301..f9b20a0c 100644 --- a/man/man3/isalpharune.3 +++ b/man/man3/isalpharune.3 @@ -35,7 +35,7 @@ in particular a subset of their properties as defined in the Unicode standard. Unicode defines some characters as alphabetic and specifies three cases: upper, lower, and title. Analogously to -.IR isalpha (3) +.MR isalpha (3) for .SM ASCII\c , diff --git a/man/man3/keyboard.3 b/man/man3/keyboard.3 index 4641b86d..feedfd2e 100644 --- a/man/man3/keyboard.3 +++ b/man/man3/keyboard.3 @@ -23,14 +23,14 @@ void closekeyboard(Keyboard *kc) .SH DESCRIPTION These functions access and control a keyboard interface for character-at-a-time I/O in a multi-threaded environment, usually in combination with -.IR mouse (3). +.MR mouse (3) . They use the message-passing .B Channel interface in the threads library (see -.IR thread (3)); +.MR thread (3) ); programs that wish a more event-driven, single-threaded approach should use -.IR event (3). +.MR event (3) . .PP .I Initkeyboard opens a connection to the keyboard and returns a @@ -86,10 +86,10 @@ structure. .SH SOURCE .B \*9/src/libdraw .SH SEE ALSO -.IR graphics (3), -.IR draw (3), -.IR event (3), -.IR thread (3). +.MR graphics (3) , +.MR draw (3) , +.MR event (3) , +.MR thread (3) . .SH BUGS Because the interface delivers complete runes, there is no way to report lesser actions such as diff --git a/man/man3/lock.3 b/man/man3/lock.3 index adc75d1f..2dea7467 100644 --- a/man/man3/lock.3 +++ b/man/man3/lock.3 @@ -80,7 +80,7 @@ are rendezvous points. Locks and rendezvous points have trivial implementations in programs not using the thread library (see -.IR thread (3)), +.MR thread (3) ), since such programs have no concurrency. .PP Used carelessly, spin locks can be expensive and can easily generate deadlocks. diff --git a/man/man3/mach-cmd.3 b/man/man3/mach-cmd.3 index ac6b3bbd..a2b4462d 100644 --- a/man/man3/mach-cmd.3 +++ b/man/man3/mach-cmd.3 @@ -64,7 +64,7 @@ fields) of all currently open headers (see .I symopen in -.IR mach-symbol (3)). +.MR mach-symbol (3) ). When dynamically linked objects have been attached, they are present in this linked list, and therefore included in searches by @@ -73,7 +73,7 @@ and therefore included in searches by and .I findsym (see -.IR mach-symbol (3)). +.MR mach-symbol (3) ). .TP .I corhdr The file header for the core dump, if any. @@ -118,9 +118,9 @@ loaded. uses all of these functions while parsing an argument vector as would be passed to a debugger like -.IR db (1) +.MR db (1) or -.IR acid (1). +.MR acid (1) . It expects a list of executable files, core dump files, or process ids, given in any order. If extra arguments are given (for example, more than one executable, or both @@ -133,9 +133,9 @@ fills them in as best it can. .SH SOURCE .B \*9/src/libmach .SH "SEE ALSO -.IR mach (3), -.IR mach-file (3), -.IR mach-map (3) +.MR mach (3) , +.MR mach-file (3) , +.MR mach-map (3) .SH BUGS The interface needs to be changed to support multiple threads, each with its own register set. diff --git a/man/man3/mach-file.3 b/man/man3/mach-file.3 index 19a10b81..cd275c5e 100644 --- a/man/man3/mach-file.3 +++ b/man/man3/mach-file.3 @@ -161,10 +161,10 @@ The memory at should be freed via .I free (see -.IR malloc (3)) +.MR malloc (3) ) when no longer needed. .SH SOURCE .B \*9/src/libmach .SH "SEE ALSO" -.IR mach (3), -.IR mach-map (3) +.MR mach (3) , +.MR mach-map (3) diff --git a/man/man3/mach-map.3 b/man/man3/mach-map.3 index c5822572..a0e27402 100644 --- a/man/man3/mach-map.3 +++ b/man/man3/mach-map.3 @@ -133,10 +133,10 @@ via data structures that provides access to an address space and register set. The functions described in -.IR mach-file (3) +.MR mach-file (3) are typically used to construct these maps. Related library functions described in -.IR mach-symbol (3) +.MR mach-symbol (3) provide similar access to symbol tables. .PP Each @@ -178,7 +178,7 @@ The .B rw function is most commonly used to provide access to executing processes via -.IR ptrace (2) +.MR ptrace (2) and to zeroed segments. .PP .I Allocmap @@ -346,7 +346,7 @@ such locations are useful for passing specific constants to functions expect locations, such as .I unwind (see -.IR mach-stack (3)). +.MR mach-stack (3) ). .PP .I Loccmp compares two locations, returning negative, zero, or positive @@ -360,7 +360,7 @@ which are ordered before indirections. .PP .I Locfmt is a -.IR print (3)-verb +.MR print (3) -verb that formats a .B Loc structure @@ -371,7 +371,7 @@ Indirection locations are needed in some contexts (e.g., when using .I findlsym (see -.IR mach-symbol (3))), +.MR mach-symbol (3) )), but bothersome in most. .I Locsimplify rewrites indirections as absolute memory addresses, by evaluating @@ -397,8 +397,8 @@ function families as necessary. .SH SOURCE .B \*9/src/libmach .SH "SEE ALSO" -.IR mach (3), -.IR mach-file (3) +.MR mach (3) , +.MR mach-file (3) .SH DIAGNOSTICS These routines set .IR errstr . diff --git a/man/man3/mach-stack.3 b/man/man3/mach-stack.3 index d75f641f..4c34abb1 100644 --- a/man/man3/mach-stack.3 +++ b/man/man3/mach-stack.3 @@ -68,7 +68,7 @@ a new .I rget function, and a symbol (see -.IR mach-symbol (3)) +.MR mach-symbol (3) ) describing the current function (nil if no symbol is known). The value returned by the tracer @@ -180,6 +180,6 @@ trace(Map *map, ulong pc, ulong callerpc, .SH SOURCE .B \*9/src/libmach .SH SEE ALSO -.IR mach (3) +.MR mach (3) .SH BUGS Need to talk about Regs diff --git a/man/man3/mach-swap.3 b/man/man3/mach-swap.3 index eb6091f3..eda66911 100644 --- a/man/man3/mach-swap.3 +++ b/man/man3/mach-swap.3 @@ -114,4 +114,4 @@ and low 32-bits are in .SH SOURCE .B \*9/src/libmach .SH "SEE ALSO" -.IR mach (3) +.MR mach (3) diff --git a/man/man3/mach-symbol.3 b/man/man3/mach-symbol.3 index e14a7b2e..a761a12b 100644 --- a/man/man3/mach-symbol.3 +++ b/man/man3/mach-symbol.3 @@ -61,10 +61,10 @@ int fnbound(ulong pc, ulong bounds[2]) .SH DESCRIPTION These functions provide machine-independent access to the symbol table of an executable file or executing process. -.IR Mach (3), -.IR mach-file (3), +.MR Mach (3) , +.MR mach-file (3) , and -.IR mach-map (3) +.MR mach-map (3) describe additional library functions for accessing executable files and executing processes. .PP @@ -74,7 +74,7 @@ uses the data in the structure filled by .I crackhdr (see -.IR mach-file (3)) +.MR mach-file (3) ) to initialize in-memory structures used to access the symbol tables contained in the file. .IR Symclose @@ -371,6 +371,6 @@ in the system error buffer where it is available via .SH SOURCE .B \*9/src/libmach .SH "SEE ALSO" -.IR mach (3), -.IR mach-file (3), -.IR mach-map (3) +.MR mach (3) , +.MR mach-file (3) , +.MR mach-map (3) diff --git a/man/man3/mach.3 b/man/man3/mach.3 index 9c065d00..bf260d58 100644 --- a/man/man3/mach.3 +++ b/man/man3/mach.3 @@ -40,7 +40,7 @@ points at the structure for the architecture being debugged. It is set implicitly by .I crackhdr (see -.IR mach-file (3)) +.MR mach-file (3) ) and can be set explicitly by calling .I machbyname or @@ -66,31 +66,31 @@ Mac OS X). Other manual pages describe the library functions in detail. .PP -.IR Mach-cmd (3) +.MR Mach-cmd (3) describes some convenience routines for attaching to processes and core files. .PP -.IR Mach-file (3) +.MR Mach-file (3) describes the manipulation of binary files. .PP -.IR Mach-map (3) +.MR Mach-map (3) describes the interface to address spaces and register sets in executable files and executing programs. .PP -.IR Mach-stack (3) +.MR Mach-stack (3) describes support for unwinding the stack. .PP -.IR Mach-swap (3) +.MR Mach-swap (3) describes helper functions for accessing data in a particular byte order. .PP -.IR Mach-symbol (3) +.MR Mach-symbol (3) describes the interface to debugging symbol information. .SH SOURCE .B \*9/src/libmach .SH "SEE ALSO -.IR mach-file (3), -.IR mach-map (3), -.IR mach-stack (3), -.IR mach-swap (3), -.IR mach-symbol (3) +.MR mach-file (3) , +.MR mach-map (3) , +.MR mach-stack (3) , +.MR mach-swap (3) , +.MR mach-symbol (3) diff --git a/man/man3/malloc.3 b/man/man3/malloc.3 index 1cdff577..02498ab9 100644 --- a/man/man3/malloc.3 +++ b/man/man3/malloc.3 @@ -132,8 +132,8 @@ the source of allocation. .SH SEE ALSO .I trump (in -.IR acid (1)), -.IR getcallerpc (3) +.MR acid (1) ), +.MR getcallerpc (3) .SH DIAGNOSTICS .I Malloc, realloc and @@ -153,7 +153,7 @@ The library for .I acid can be used to obtain traces of malloc execution; see -.IR acid (1). +.MR acid (1) . .SH BUGS The different specification of .I calloc @@ -182,4 +182,4 @@ are preprocessor macros defined as and .IR p9free ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/matrix.3 b/man/man3/matrix.3 index 7291725c..7d6c9e6b 100644 --- a/man/man3/matrix.3 +++ b/man/man3/matrix.3 @@ -347,4 +347,4 @@ coordinates. .SH SOURCE .B \*9/src/libgeometry/matrix.c .SH "SEE ALSO -.IR arith3 (3) +.MR arith3 (3) diff --git a/man/man3/memdraw.3 b/man/man3/memdraw.3 index 243cfe16..8dad89d0 100644 --- a/man/man3/memdraw.3 +++ b/man/man3/memdraw.3 @@ -168,46 +168,46 @@ type defines memory-resident rectangular pictures and the methods to draw upon t differ from .BR Image s (see -.IR draw (3)) +.MR draw (3) ) in that they are manipulated directly in user memory rather than by RPCs to the .B /dev/draw hierarchy. The .Bmemdraw -library is the basis for the kernel -.IR draw (3) +library is the basis for the kernel +.MR draw (3) driver and also used by a number of programs that must manipulate images without a display. .PP -The -.BR r, +The +.BR r, .BR clipr , .BR depth , .BR nchan , and -.BR chan +.BR chan structure elements are identical to the ones of the same name -in the +in the .B Image structure. .PP The .B flags -element of the +element of the .B Memimage structure holds a number of bits of information about the image. In particular, it subsumes the purpose of the .B repl -element of +element of .B Image structures. .PP .I Memimageinit initializes various static data that the library depends on, -as well as the replicated solid color images +as well as the replicated solid color images .BR memopaque , .BR memtransparent , .BR memblack , @@ -216,15 +216,15 @@ and It should be called before referring to any of these images and before calling any of the other library functions. .PP -Each +Each .B Memimage -points at a +points at a .B Memdata structure that in turn points at the actual pixel data for the image. -This allows multiple images to be associated with the same +This allows multiple images to be associated with the same .BR Memdata . The first word of the data pointed at by -the +the .B base element of .B Memdata @@ -232,18 +232,19 @@ points back at the .B Memdata structure, so that in the Plan 9 kernel, the memory allocator (see -Plan 9's \fIpool\fR(3)) +Plan 9's +.IR pool (3)) can compact image memory using .IR memimagemove . .PP Because images can have different coordinate systems, -the +the .B zero -element of the +element of the .B Memimage structure contains the offset that must be added -to the +to the .B bdata element of the corresponding .B Memdata @@ -261,18 +262,18 @@ do not include the origin, although one should only dereference pointers corresponding to pixels within the image rectangle. .I Wordaddr and -.IR byteaddr -perform these calculations, +.IR byteaddr +perform these calculations, returning pointers to the word and byte, respectively, that contain the beginning of the data for a given pixel. .PP .I Allocmemimage -allocates +allocates images with a given rectangle and channel descriptor -(see +(see .B strtochan in -.IR graphics (3)), +.MR graphics (3) ), creating a fresh .B Memdata structure and associated storage. @@ -282,7 +283,7 @@ is similar but uses the supplied structure rather than a new one. The .I readmemimage -function reads an uncompressed bitmap +function reads an uncompressed bitmap from the given file descriptor, while .I creadmemimage @@ -293,7 +294,7 @@ writes a compressed representation of to file descriptor .IR fd . For more on bitmap formats, see -.IR image (7). +.MR image (7) . .I Freememimage frees images returned by any of these routines. The @@ -315,7 +316,7 @@ data, respectively. When calling .IR cloadmemimage , the buffer must contain an -integral number of +integral number of compressed chunks of data that exactly cover the rectangle. .I Unloadmemimage retrieves the uncompressed pixel data for a given rectangle of an image. @@ -324,8 +325,8 @@ and \-1 in case of an error. .PP .I Memfillcolor fills an image with the given color, a 32-bit number as -described in -.IR color (3). +described in +.MR color (3) . .PP .IR Memarc , .IR mempoly , @@ -334,7 +335,7 @@ described in .IR memimageline , and .I memimagedraw -are identical to the +are identical to the .IR arc , .IR poly , .IR ellipse , @@ -343,40 +344,40 @@ are identical to the and .IR gendraw , routines described in -.IR draw (3), +.MR draw (3) , except that they operate on .BR Memimage s -rather than +rather than .BR Image s. -Similarly, +Similarly, .IR allocmemsubfont , .IR openmemsubfont , .IR freememsubfont , .IR memsubfontwidth , and .I memimagestring -are the +are the .B Memimage -analogues of +analogues of .IR allocsubfont , .IR openfont , .IR freesubfont , .IR strsubfontwidth , and .B string -(see -.IR subfont (3) +(see +.MR subfont (3) and -.IR graphics (3)), +.MR graphics (3) ), except that they operate -only on +only on .BR Memsubfont s rather than .BR Font s. .PP .I Drawclip takes the images involved in a draw operation, -together with the destination rectangle +together with the destination rectangle .B dr and source and mask alignment points @@ -407,7 +408,7 @@ an end of a given style. .PP The .I hwdraw -and +and .I iprint functions are no-op stubs that may be overridden by clients of the library. @@ -415,7 +416,7 @@ of the library. is called at each call to .I memimagedraw with the current request's parameters. -If it can satisfy the request, it should do so +If it can satisfy the request, it should do so and return 1. If it cannot satisfy the request, it should return 0. This allows (for instance) the kernel to take advantage @@ -432,15 +433,15 @@ prints to a serial line rather than the screen, for obvious reasons. .SH SOURCE .B \*9/src/libmemdraw .SH SEE ALSO -.IR addpt (3), -.IR color (3), -.IR draw (3), -.IR graphics (3), -.IR memlayer (3), -.IR stringsize (3), -.IR subfont (3), -.IR color (7), -.IR utf (7) +.MR addpt (3) , +.MR color (3) , +.MR draw (3) , +.MR graphics (3) , +.MR memlayer (3) , +.MR stringsize (3) , +.MR subfont (3) , +.MR color (7) , +.MR utf (7) .SH BUGS .I Memimagestring is unusual in using a subfont rather than a font, diff --git a/man/man3/memlayer.3 b/man/man3/memlayer.3 index a40efdc7..d7f06510 100644 --- a/man/man3/memlayer.3 +++ b/man/man3/memlayer.3 @@ -97,18 +97,18 @@ int memunload(Memimage *i, Rectangle r, .PP .SH DESCRIPTION These functions build upon the -.IR memdraw (3) +.MR memdraw (3) interface to maintain overlapping graphical windows on in-memory images. They are used by the kernel to implement the windows interface presented by -.IR draw (3) +.MR draw (3) and -.IR window (3) +.MR window (3) and probably have little use outside of the kernel. .PP The basic function is to extend the definition of a .B Memimage (see -.IR memdraw (3)) +.MR memdraw (3) ) to include overlapping windows defined by the .B Memlayer type. @@ -270,7 +270,7 @@ They have the signatures of and .I memimageline (see -.IR memdraw (3)) +.MR memdraw (3) ) but accept .B Memlayer or @@ -294,12 +294,12 @@ bytes of data in .I buf are in compressed image format (see -.IR image (7)). +.MR image (7) ). .SH SOURCE .B \*9/src/libmemlayer .SH SEE ALSO -.IR graphics (3), -.IR memdraw (3), -.IR stringsize (3), -.IR window (3), -.IR draw (3) +.MR graphics (3) , +.MR memdraw (3) , +.MR stringsize (3) , +.MR window (3) , +.MR draw (3) diff --git a/man/man3/memory.3 b/man/man3/memory.3 index 51e54479..5f191dd4 100644 --- a/man/man3/memory.3 +++ b/man/man3/memory.3 @@ -109,7 +109,7 @@ All these routines have portable C implementations in .\" Most also have machine-dependent assembly language implementations in .\" .BR \*9/lib9/$objtype . .SH SEE ALSO -.IR strcat (3) +.MR strcat (3) .SH BUGS ANSI C does not require .I memcpy diff --git a/man/man3/mouse.3 b/man/man3/mouse.3 index b5061fd9..9b835891 100644 --- a/man/man3/mouse.3 +++ b/man/man3/mouse.3 @@ -49,9 +49,9 @@ They use the message-passing .B Channel interface in the threads library (see -.IR thread (3)); +.MR thread (3) ); programs that wish a more event-driven, single-threaded approach should use -.IR event (3). +.MR event (3) . .PP The state of the mouse is recorded in a structure, .BR Mouse , @@ -107,7 +107,7 @@ are a naming the device file connected to the mouse and an .I Image (see -.IR draw (3)) +.MR draw (3) ) on which the mouse will be visible. Typically the file is nil, @@ -136,7 +136,7 @@ The actual value sent may be discarded; the receipt of the message tells the program that it should call .B getwindow (see -.IR graphics (3)) +.MR graphics (3) ) to reconnect to the window. .PP .I Readmouse @@ -152,7 +152,7 @@ or message sent on the channel. It calls .B flushimage (see -.IR graphics (3)) +.MR graphics (3) ) before blocking, so any buffered graphics requests are displayed. .PP .I Closemouse @@ -174,14 +174,14 @@ is nil, the cursor is set to the default. The format of the cursor data is spelled out in .B and described in -.IR graphics (3). +.MR graphics (3) . .PP .I Getrect returns the dimensions of a rectangle swept by the user, using the mouse, in the manner -.IR rio (1) +.MR rio (1) or -.IR sam (1) +.MR sam (1) uses to create a new window. The .I but @@ -220,7 +220,7 @@ struct Menu behaves the same as its namesake .I emenuhit described in -.IR event (3), +.MR event (3) , with two exceptions. First, it uses a .B Mousectl @@ -230,7 +230,7 @@ it creates the menu as a true window on the .B Screen .I scr (see -.IR window (3)), +.MR window (3) ), permitting the menu to be displayed in parallel with other activities on the display. If .I scr @@ -244,8 +244,8 @@ restoring the display when the menu is removed. .SH SOURCE .B \*9/src/libdraw .SH SEE ALSO -.IR graphics (3), -.IR draw (3), -.IR event (3), -.IR keyboard (3), -.IR thread (3). +.MR graphics (3) , +.MR draw (3) , +.MR event (3) , +.MR keyboard (3) , +.MR thread (3) . diff --git a/man/man3/mousescrollsize.3 b/man/man3/mousescrollsize.3 index 98147356..c4c24b10 100644 --- a/man/man3/mousescrollsize.3 +++ b/man/man3/mousescrollsize.3 @@ -28,15 +28,15 @@ causes a half-window scroll increment. .PP .I Mousescrollsize is used by -.IR 9term (1) +.MR 9term (1) and -.IR acme (1) +.MR acme (1) to set their scrolling behavior. .SH SOURCE .B \*9/src/libdraw/scroll.c .SH SEE ALSO -.IR 9term (1), -.IR acme (1) +.MR 9term (1) , +.MR acme (1) .SH BUGS .I Libdraw expects up and down scroll wheel events to be expressed as clicks of mouse buttons 4 and 5, diff --git a/man/man3/mp.3 b/man/man3/mp.3 index f0028c3f..8ea365dc 100644 --- a/man/man3/mp.3 +++ b/man/man3/mp.3 @@ -315,9 +315,9 @@ is the buffer is allocated. .I Mpfmt can be used with -.IR fmtinstall (3) +.MR fmtinstall (3) and -.IR print (3) +.MR print (3) to print hexadecimal representations of .BR mpint s. .PP diff --git a/man/man3/mux.3 b/man/man3/mux.3 index 0c429fba..ed822940 100644 --- a/man/man3/mux.3 +++ b/man/man3/mux.3 @@ -123,7 +123,7 @@ nil if an error occurred. .I Muxprocs allocates new procs (see -.IR thread (3)) +.MR thread (3) ) in which to run .I send and @@ -146,7 +146,7 @@ that need to remain active. .I Libmux also provides a non-blocking interface, useful for programs forced to use a -.IR select (3)-based +.MR select (3) -based main loop. .I Muxrpcstart runs the first half of @@ -176,7 +176,7 @@ with .SH SOURCE .B \*9/src/libmux .SH SEE ALSO -.IR thread (3), +.MR thread (3) , .IR intro (9p) .SH BUGS .I Libmux diff --git a/man/man3/ndb.3 b/man/man3/ndb.3 index 14c845b6..413c11d6 100644 --- a/man/man3/ndb.3 +++ b/man/man3/ndb.3 @@ -88,13 +88,13 @@ Ndbtuple* ndbsubstitute(Ndbtuple *t, Ndbtuple *from, Ndbtuple *to); These routines are used by network administrative programs to search the network database. They operate on the database files described in -.IR ndb (7). +.MR ndb (7) . .PP .I Ndbopen opens the database .I file and calls -.IR malloc (3) +.MR malloc (3) to allocate a buffer for it. If .I file @@ -128,7 +128,7 @@ is used to find each successive match. On a successful search both return a linked list of .I Ndbtuple structures acquired by -.IR malloc (3) +.MR malloc (3) that represent the attribute/value pairs in the entry. On failure they return zero. @@ -450,8 +450,8 @@ directory of network database files .SH SOURCE .B \*9/src/libndb .SH SEE ALSO -.IR ndb (1) -.IR ndb (7) +.MR ndb (1) +.MR ndb (7) .SH DIAGNOSTICS .IR Ndbgetvalue and diff --git a/man/man3/needstack.3 b/man/man3/needstack.3 index 071b8916..52fa8785 100644 --- a/man/man3/needstack.3 +++ b/man/man3/needstack.3 @@ -45,7 +45,7 @@ is a no-op. .I Needstack should be thought of as a comment checked at run time, like -.IR assert (3). +.MR assert (3) . .SH EXAMPLE The X Window library implementation of .I XLookupString @@ -57,7 +57,7 @@ before making calls to .IR XLookupString . If a thread (in this case, the keyboard-reading thread used inside the -.IR draw (3) +.MR draw (3) library) does not allocate a large enough stack, the problem is diagnosed immediately rather than left to corrupt memory. @@ -66,4 +66,4 @@ immediately rather than left to corrupt memory. .br .B \*9/src/libthread .SH SEE ALSO -.IR thread (3) +.MR thread (3) diff --git a/man/man3/notify.3 b/man/man3/notify.3 index 7dd768e7..9f2efb6d 100644 --- a/man/man3/notify.3 +++ b/man/man3/notify.3 @@ -33,12 +33,12 @@ or writing on a closed pipe, a is posted to communicate the exception. A note may also be posted by another process via -.IR postnote (3). +.MR postnote (3) . On Unix, notes are implemented as signals. .PP When a note is received, the action taken depends on the note. See -.IR signal (7) +.MR signal (7) for the full description of the defaults. .PP The default actions may be overridden. @@ -53,10 +53,10 @@ replaces the previous handler, if any. An argument of zero cancels a previous handler, restoring the default action. A -.IR fork (2) +.MR fork (2) system call leaves the handler registered in both the parent and the child; -.IR exec (3) +.MR exec (3) restores the default behavior. Handlers may not perform floating point operations. .PP @@ -112,17 +112,17 @@ set up with using the .I notejmp function (see -.IR setjmp (3)). +.MR setjmp (3) ). .PP Unix provides a fixed set of notes (typically there are 32) called .IR signals . It also allows a process to block certain notes from being delivered (see -.IR sigprocmask (2)) +.MR sigprocmask (2) ) and to ignore certain notes by setting the signal hander to the special value .B SIG_IGN (see -.IR signal (2)). +.MR signal (2) ). .I Noteenable and .I notedisable @@ -137,7 +137,7 @@ is called upon receipt of the note; if the handler is not called, the note is di Regardless of the origin of the note or the presence of a handler, if the process is being debugged (see -.IR ptrace (2)) +.MR ptrace (2) ) the arrival of a note puts the process in the .B Stopped state and awakens the debugger. @@ -252,7 +252,7 @@ are usually generated by the operating system. .br .B \*9/src/lib9/atnotify.c .SH SEE ALSO -.IR intro (3), +.MR intro (3) , .I notejmp in -.IR setjmp (3) +.MR setjmp (3) diff --git a/man/man3/open.3 b/man/man3/open.3 index 750aa65c..d4b2e272 100644 --- a/man/man3/open.3 +++ b/man/man3/open.3 @@ -34,7 +34,7 @@ says to truncate the file to zero length before opening it; .B OCEXEC says to close the file when an -.IR exec (3) +.MR exec (3) or .I execl system call is made; @@ -48,7 +48,7 @@ are always appended to the end of the file. fails if the file does not exist or the user does not have permission to open it for the requested purpose (see -.IR stat (3) +.MR stat (3) for a description of permissions). The user must have write permission on the .I file @@ -61,7 +61,7 @@ system call (unlike the implicit .I open in -.IR exec (3)), +.MR exec (3) ), .B OEXEC is actually identical to .BR OREAD . @@ -143,8 +143,8 @@ allows the file descriptor to be reused. .SH SOURCE .B \*9/src/lib9 .SH SEE ALSO -.IR intro (3), -.IR stat (3) +.MR intro (3) , +.MR stat (3) .SH DIAGNOSTICS These functions set .IR errstr . @@ -169,4 +169,4 @@ are preprocessor macros defined as and .IR p9create ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/opentemp.3 b/man/man3/opentemp.3 index 63af2da7..f105a57f 100644 --- a/man/man3/opentemp.3 +++ b/man/man3/opentemp.3 @@ -25,7 +25,7 @@ to .L z are tried until the name of a file that does not yet exist (see -.IR access (2)) +.MR access (2) ) is generated. .I Opentemp then opens the file for the given @@ -49,4 +49,4 @@ will never return the same name. .SH "SEE ALSO .I create in -.IR open (3) +.MR open (3) diff --git a/man/man3/pipe.3 b/man/man3/pipe.3 index 10decb69..ef4de313 100644 --- a/man/man3/pipe.3 +++ b/man/man3/pipe.3 @@ -25,7 +25,7 @@ is available for reading from After the pipe has been established, cooperating processes created by subsequent -.IR fork (2) +.MR fork (2) calls may pass data through the pipe with .I read @@ -53,14 +53,14 @@ calls. .\" .IR stat (3)). .PP When all the data has been read from a pipe and the writer has closed the pipe or exited, -.IR read (3) +.MR read (3) will return 0 bytes. Writes to a pipe with no reader will generate a note .BR "sys: write on closed pipe" . .SH SOURCE .B \*9/src/lib9/pipe.c .SH SEE ALSO -.IR intro (3), -.IR read (3) +.MR intro (3) , +.MR read (3) .SH DIAGNOSTICS Sets .IR errstr . @@ -79,7 +79,7 @@ Unix pipes are not guaranteed to be bidirectional. In order to ensure a bidirectional channel, .I p9pipe creates Unix domain sockets via the -.IR socketpair (2) +.MR socketpair (2) instead of Unix pipes. .PP The implementation of pipes as Unix domain sockets @@ -89,11 +89,11 @@ Unix's dup device. If a Unix domain socket is open as file descriptor 0, some implementations disallow the opening of .BR /dev/fd/0 ; instead one must -.IR connect (2) +.MR connect (2) to it. If this functionality is important (as it is for -.IR rc (1)), +.MR rc (1) ), one must .B #undef .B pipe diff --git a/man/man3/plumb.3 b/man/man3/plumb.3 index fa78a2b5..409c40bc 100644 --- a/man/man3/plumb.3 +++ b/man/man3/plumb.3 @@ -68,7 +68,7 @@ Plumbmsg* plumbrecvfid(CFid *fid) int plumbsendtofid(CFid *fid, Plumbmsg *m) .SH DESCRIPTION These routines manipulate -.IR plumb (7) +.MR plumb (7) messages, transmitting them, receiving them, and converting them between text and these data structures: .IP @@ -99,7 +99,7 @@ struct Plumbattr opens the named plumb .IR port , using -.IR open (3) +.MR open (3) mode .IR omode . If @@ -108,11 +108,11 @@ begins with a slash, it is taken as a literal file name; otherwise .I plumbopen searches for the location of the -.IR plumber (4) +.MR plumber (4) service and opens the port there. .PP For programs using the -.IR event (3) +.MR event (3) interface, .I eplumb registers, using the given @@ -121,9 +121,9 @@ receipt of messages from the named .IR port . .PP The library mounts the -.IR plumber (4) +.MR plumber (4) service on demand (using the -.IR 9pclient (3)) +.MR 9pclient (3) ) library and reuses the mount instance for future calls to .IR plumbopen . @@ -157,7 +157,7 @@ to frees all the data associated with the message .IR m , all the components of which must therefore have been allocated with -.IR malloc (3). +.MR malloc (3) . .PP .I Plumbrecv returns the next message available on the file descriptor @@ -259,7 +259,7 @@ The file descriptor returned by is created with .I fsopenfd (see -.IR 9pclient (3)), +.MR 9pclient (3) ), which masks information about read and write errors. This is acceptable for use in .I plumbrecv @@ -276,10 +276,10 @@ that preserves the exact error details. .SH SOURCE .B \*9/src/libplumb .SH SEE ALSO -.IR plumb (1), -.IR event (3), -.IR plumber (4), -.IR plumb (7) +.MR plumb (1) , +.MR event (3) , +.MR plumber (4) , +.MR plumb (7) .SH DIAGNOSTICS When appropriate, including when a .I plumbsend diff --git a/man/man3/post9pservice.3 b/man/man3/post9pservice.3 index c3b69d71..5eeae234 100644 --- a/man/man3/post9pservice.3 +++ b/man/man3/post9pservice.3 @@ -11,11 +11,11 @@ int post9pservice(int fd, char *name, char *mtpt) .SH DESCRIPTION .I Post9pservice invokes -.IR 9pserve (4) +.MR 9pserve (4) to post a new 9P service in the current ``name space'' (see -.IR intro (4)) +.MR intro (4) ) named .IR name . Clients connecting to the posted service @@ -30,10 +30,10 @@ is non-nil, mounts the service on .IR mtpt , using -.IR 9pfuse (4). +.MR 9pfuse (4) . .SH "SEE ALSO -.IR intro (4), -.IR 9pfuse (4), -.IR 9pserve (4) +.MR intro (4) , +.MR 9pfuse (4) , +.MR 9pserve (4) .SH SOURCE .B \*9/src/lib9/post9p.c diff --git a/man/man3/postnote.3 b/man/man3/postnote.3 index 7c323964..907710a1 100644 --- a/man/man3/postnote.3 +++ b/man/man3/postnote.3 @@ -38,8 +38,8 @@ Returns zero if the write succeeds, otherwise \-1. .SH SOURCE .B \*9/src/lib9/postnote.c .SH "SEE ALSO" -.IR notify (3), -.IR intro (3) +.MR notify (3) , +.MR intro (3) .SH DIAGNOSTICS Sets .IR errstr . diff --git a/man/man3/prime.3 b/man/man3/prime.3 index 01a308e8..d364b30c 100644 --- a/man/man3/prime.3 +++ b/man/man3/prime.3 @@ -93,8 +93,8 @@ slow algorithm. .SH SOURCE .B \*9/src/libsec .SH SEE ALSO -.IR aes (3) -.IR blowfish (3), -.IR des (3), -.IR elgamal (3), -.IR rsa (3), +.MR aes (3) +.MR blowfish (3) , +.MR des (3) , +.MR elgamal (3) , +.MR rsa (3) , diff --git a/man/man3/print.3 b/man/man3/print.3 index a701bc04..452ed7c8 100644 --- a/man/man3/print.3 +++ b/man/man3/print.3 @@ -67,7 +67,7 @@ writes to the named output file descriptor: a buffered form is described in -.IR bio (3). +.MR bio (3) . .I Sprint places text followed by the NUL character @@ -104,7 +104,7 @@ is like .IR sprint , except that it prints into and returns a string of the required length, which is allocated by -.IR malloc (3). +.MR malloc (3) . .PP The routines .IR runesprint , @@ -361,7 +361,7 @@ The .B S verb is similar, but it interprets its pointer as an array of runes (see -.IR utf (7)); +.MR utf (7) ); the runes are converted to .SM UTF before output. @@ -389,10 +389,10 @@ but that will change if pointers and integers are different sizes. The .B r verb takes no arguments; it copies the error string returned by a call to -.IR errstr (3). +.MR errstr (3) . .PP Custom verbs may be installed using -.IR fmtinstall (3). +.MR fmtinstall (3) . .SH EXAMPLE This function prints an error message with a variable number of arguments and then quits. @@ -415,9 +415,9 @@ void fatal(char *msg, ...) .SH SOURCE .B \*9/src/lib9/fmt .SH SEE ALSO -.IR fmtinstall (3), -.IR fprintf (3), -.IR utf (7) +.MR fmtinstall (3) , +.MR fprintf (3) , +.MR utf (7) .SH DIAGNOSTICS Routines that write to a file descriptor or call .IR malloc @@ -425,7 +425,7 @@ set .IR errstr . .SH BUGS The formatting is close to that specified for ANSI -.IR fprintf (3); +.MR fprintf (3) ; the main difference is that .B b and diff --git a/man/man3/proto.3 b/man/man3/proto.3 index 2d5da3af..571b932e 100644 --- a/man/man3/proto.3 +++ b/man/man3/proto.3 @@ -24,7 +24,7 @@ int rdproto(char *proto, char *root, Protoenum *enm, .I Rdproto reads and interprets the named .I proto -file relative to the +file relative to the root directory .IR root . .PP @@ -45,9 +45,9 @@ The fifth field is the name of the file from which to copy; this file is read from the current name space, not the source file tree. All fields except the first are optional. -Specifying +Specifying .B - -for permissions, owner, or group +for permissions, owner, or group causes .I rdproto to fetch the corresponding information @@ -92,29 +92,29 @@ Only the and .B length fields are guaranteed to be valid. -The argument +The argument .I a is the same argument passed to .IR rdproto ; typically it points at some extra state used by the enumeration function. .PP -When files or directories do not exist or -cannot be read by +When files or directories do not exist or +cannot be read by .IR rdproto , -it formats a warning message, calls +it formats a warning message, calls .IR warn , -and continues processing; +and continues processing; if .I warn -is nil, +is nil, .I rdproto prints the warning message to standard error. .PP .I Rdproto returns zero if -.I proto +.I proto was processed, \-1 if it could not be opened. .SH FILES .TF /sys/lib/sysconfig/proto/portproto @@ -127,5 +127,6 @@ generic prototype file. .SH SOURCE .B \*9/src/libdisk/proto.c .SH SEE ALSO -.IR mk9660 (1), -Plan 9's \fImkfs\fR(8) +.MR mk9660 (1) , +Plan 9's +.IR mkfs (8) diff --git a/man/man3/pushtls.3 b/man/man3/pushtls.3 index fa0a080c..7a086f00 100644 --- a/man/man3/pushtls.3 +++ b/man/man3/pushtls.3 @@ -46,7 +46,7 @@ TLS is nearly the same as SSL 3.0, and the software should interoperate with implementations of either standard. .PP To use just the record layer, as described in Plan 9's -\fItls\fR(3), +.IR tls (3), call .I pushtls to open the record layer device, connect to the communications channel @@ -108,7 +108,7 @@ used by a client to resume a previously negotiated security association. On output, the connection directory is set, as with .B listen (see -.IR dial (3)). +.MR dial (3) ). The input .I cert is freed and a freshly allocated copy of the remote's certificate @@ -149,7 +149,7 @@ The private key corresponding to .I cert.pem should have been previously loaded into factotum. (See -.IR rsa (3) +.MR rsa (3) .\" XXX should be rsa(8) for more about key generation.) By setting @@ -164,10 +164,10 @@ known to the client. is not required for the ongoing conversation and may be freed by the application whenever convenient. .SH FILES -.TP +.TP .B /sys/lib/tls thumbprints of trusted services -.TP +.TP .B /sys/lib/ssl PEM certificate files .SH SOURCE @@ -175,12 +175,12 @@ PEM certificate files .\" .br .B \*9/src/libsec/port .SH "SEE ALSO" -.IR dial (3), -.IR thumbprint (7); +.MR dial (3) , +.MR thumbprint (7) ; Plan 9's -\fIfactotum\fR(4) +.IR factotum (4) and -\fItls\fR(3) +.IR tls (3) .SH DIAGNOSTICS return \-1 on failure. .SH BUGS diff --git a/man/man3/qball.3 b/man/man3/qball.3 index 5929ece2..a5a67a79 100644 --- a/man/man3/qball.3 +++ b/man/man3/qball.3 @@ -68,7 +68,7 @@ and normal to the axis. .SH SOURCE .B \*9/src/libgeometry/qball.c .SH SEE ALSO -.IR quaternion (3) +.MR quaternion (3) .br Ken Shoemake, ``Animating Rotation with Quaternion Curves'', diff --git a/man/man3/quaternion.3 b/man/man3/quaternion.3 index 224baea7..31b59b90 100644 --- a/man/man3/quaternion.3 +++ b/man/man3/quaternion.3 @@ -121,7 +121,7 @@ The following routines operate on rotations or orientations represented as unit .TP .B mtoq Convert a rotation matrix (see -.IR matrix (3)) +.MR matrix (3) ) to a unit quaternion. .TP .B qtom @@ -148,12 +148,12 @@ This is just a rotation about the same axis by half the angle. .SH SOURCE .B \*9/src/libgeometry/quaternion.c .SH SEE ALSO -.IR matrix (3), -.IR qball (3) +.MR matrix (3) , +.MR qball (3) .SH BUGS To avoid name conflicts with NetBSD, .I qdiv is a preprocessor macro defined as .IR p9qdiv ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/quote.3 b/man/man3/quote.3 index ae6c6c28..30e85bdf 100644 --- a/man/man3/quote.3 +++ b/man/man3/quote.3 @@ -58,10 +58,10 @@ The empty string is represented by two quotes, The first four functions act as variants of .B strdup (see -.IR strcat (3)). +.MR strcat (3) ). Each returns a freshly allocated copy of the string, created using -.IR malloc (3). +.MR malloc (3) . .I Quotestrdup returns a quoted copy of .IR s , @@ -75,7 +75,7 @@ The versions of these functions do the same for .CW Rune strings (see -.IR runestrcat (3)). +.MR runestrcat (3) ). .PP The string returned by .I quotestrdup @@ -124,13 +124,13 @@ blanks, control characters, and quotes are always quoted. is provided as a .I doquote function that flags any character special to -.IR rc (1). +.MR rc (1) . .PP .I Quotestrfmt and .I quoterunestrfmt are -.IR print (3) +.MR print (3) formatting routines that produce quoted strings as output. They may be installed by hand, but .I quotefmtinstall @@ -154,21 +154,21 @@ statements so the compiler can type-check uses of and .B %Q in -.IR print (3) +.MR print (3) format strings. .SH SOURCE .B \*9/src/lib9/quote.c .br .B \*9/src/lib9/fmt/fmtquote.c .SH "SEE ALSO -.IR rc (1), -.IR malloc (3), -.IR print (3), -.IR strcat (3) +.MR rc (1) , +.MR malloc (3) , +.MR print (3) , +.MR strcat (3) .SH BUGS Because it is provided by the format library, .I doquote is a preprocessor macro defined as .IR fmtdoquote ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/rand.3 b/man/man3/rand.3 index 3eaa05f5..ba7ef97f 100644 --- a/man/man3/rand.3 +++ b/man/man3/rand.3 @@ -125,7 +125,7 @@ truly random bytes read from .PP .I Prng uses the native -.IR rand (3) +.MR rand (3) pseudo-random number generator to fill the buffer. Used with .IR srand , this function can produce a reproducible stream of pseudo random @@ -138,7 +138,7 @@ and may be passed to .I mprand (see -.IR mp (3)). +.MR mp (3) ). .PP .I Fastrand uses @@ -161,7 +161,7 @@ to return a uniform .B \*9/src/libsec/port .SH "SEE ALSO .\" .IR cons (3), -.IR mp (3) +.MR mp (3) .SH BUGS .I Truerand and @@ -181,7 +181,7 @@ are preprocessor macros defined as .IR p9lrand , and so on; see -.IR intro (3). +.MR intro (3) . .ie \n(HT .ds HT " .el .ds HT " (see HTML-formatted man page for link) .PP diff --git a/man/man3/rc4.3 b/man/man3/rc4.3 index 026c8352..60849150 100644 --- a/man/man3/rc4.3 +++ b/man/man3/rc4.3 @@ -43,13 +43,13 @@ structure keeps track of the algorithm. .SH SOURCE .B \*9/src/libsec .SH SEE ALSO -.IR mp (3), -.IR aes (3), -.IR blowfish (3), -.IR des (3), -.IR dsa (3), -.IR elgamal (3), -.IR rsa (3), -.IR sechash (3), -.IR prime (3), -.IR rand (3) +.MR mp (3) , +.MR aes (3) , +.MR blowfish (3) , +.MR des (3) , +.MR dsa (3) , +.MR elgamal (3) , +.MR rsa (3) , +.MR sechash (3) , +.MR prime (3) , +.MR rand (3) diff --git a/man/man3/read.3 b/man/man3/read.3 index cd4dbf3d..6fd9feb0 100644 --- a/man/man3/read.3 +++ b/man/man3/read.3 @@ -65,7 +65,7 @@ if this is not the same as requested. and .I Pwrite equivalent to a -.IR seek (3) +.MR seek (3) to .I offset followed by a @@ -83,10 +83,10 @@ without interference. .SH SOURCE .B \*9/src/lib9/readn.c .SH SEE ALSO -.IR intro (3), +.MR intro (3) , .IR open (3), -.IR dup (3), -.IR pipe (3) +.MR dup (3) , +.MR pipe (3) .SH DIAGNOSTICS These functions set .IR errstr . diff --git a/man/man3/readcolmap.3 b/man/man3/readcolmap.3 index 82ccdcfd..f0c04865 100644 --- a/man/man3/readcolmap.3 +++ b/man/man3/readcolmap.3 @@ -63,14 +63,14 @@ Both return 0 on success, or \-1 on error, setting .PP Changing the hardware color map does not change the color map used by the -.IR draw (3) +.MR draw (3) operator to convert between mapped and true color or greyscale images, which is described in -.IR color (7). +.MR color (7) . .SH SOURCE .B \*9/src/libdraw .SH "SEE ALSO" -.IR graphics (3), -.IR draw (3), -.IR color (7) +.MR graphics (3) , +.MR draw (3) , +.MR color (7) diff --git a/man/man3/readcons.3 b/man/man3/readcons.3 index dd284b97..9deaa44e 100644 --- a/man/man3/readcons.3 +++ b/man/man3/readcons.3 @@ -31,7 +31,7 @@ is non-zero, the input is not echoed to the screen. A stripped-down version of .I netkey (see -.IR passwd (1)): +.MR passwd (1) ): .IP .EX pass = readcons("password", nil, 1); diff --git a/man/man3/regexp.3 b/man/man3/regexp.3 index 069e1d23..854ad996 100644 --- a/man/man3/regexp.3 +++ b/man/man3/regexp.3 @@ -42,11 +42,11 @@ compiles a regular expression and returns a pointer to the generated description. The space is allocated by -.IR malloc (3) +.MR malloc (3) and may be released by .IR free . Regular expressions are exactly as in -.IR regexp (7). +.MR regexp (7) . .PP .I Regcomplit is like @@ -196,7 +196,7 @@ array elements should be used. .SH SOURCE .B \*9/src/libregexp .SH "SEE ALSO" -.IR grep (1) +.MR grep (1) .SH DIAGNOSTICS .I Regcomp returns diff --git a/man/man3/rfork.3 b/man/man3/rfork.3 index d1d383cc..102ec3b3 100644 --- a/man/man3/rfork.3 +++ b/man/man3/rfork.3 @@ -15,14 +15,14 @@ int rfork(int flags) is a partial implementation of the Plan 9 system call. It can be used to manipulate some process state and to create new processes a la -.IR fork (2). +.MR fork (2) . It cannot be used to create shared-memory processes (Plan 9's .B RFMEM flag); for that functionality use .I proccreate (see -.IR thread (3)). +.MR thread (3) ). .PP The .I flags @@ -45,7 +45,7 @@ If set, the child process will be dissociated from the parent. Upon exit the child will leave no .B Waitmsg (see -.IR wait (3)) +.MR wait (3) ) for the parent to collect. .\" .TP .\" .B RFNAMEG @@ -81,9 +81,9 @@ for the parent to collect. Each process is a member of a group of processes that all receive notes when a note is sent to the group (see -.IR postnote (3) +.MR postnote (3) and -.IR signal (2)). +.MR signal (2) ). The group of a new process is by default the same as its parent, but if .B RFNOTEG is set (regardless of @@ -154,7 +154,7 @@ will sleep, if necessary, until required process resources are available. Calling .B rfork(RFFDG|RFPROC) is equivalent to calling -.IR fork (2). +.MR fork (2) . .SH SOURCE .B \*9/src/lib9/rfork.c .SH DIAGNOSTICS diff --git a/man/man3/rsa.3 b/man/man3/rsa.3 index 0c1396a8..35145bda 100644 --- a/man/man3/rsa.3 +++ b/man/man3/rsa.3 @@ -197,7 +197,7 @@ The subject line is conventionally of the form using the quoting conventions of .I tokenize (see -.IR getfields (3)). +.MR getfields (3) ). .PP .I X509req creates an X.509 certification request. @@ -241,14 +241,14 @@ struct PEMChain .SH SOURCE .B \*9/src/libsec .SH SEE ALSO -.IR mp (3), -.IR aes (3), -.IR blowfish (3), -.IR des (3), -.IR dsa (3), -.IR elgamal (3), -.IR rc4 (3), -.IR sechash (3), -.IR prime (3), -.IR rand (3) +.MR mp (3) , +.MR aes (3) , +.MR blowfish (3) , +.MR des (3) , +.MR dsa (3) , +.MR elgamal (3) , +.MR rc4 (3) , +.MR sechash (3) , +.MR prime (3) , +.MR rand (3) .\" .IR pem (8) diff --git a/man/man3/rune.3 b/man/man3/rune.3 index 5bb2224e..2cff02e3 100644 --- a/man/man3/rune.3 +++ b/man/man3/rune.3 @@ -189,5 +189,5 @@ returns .br .B \*9/src/lib9/utf/utfrune.c .SH SEE ALSO -.IR utf (7), -.IR tcs (1) +.MR utf (7) , +.MR tcs (1) diff --git a/man/man3/runestrcat.3 b/man/man3/runestrcat.3 index 347c7219..42686f10 100644 --- a/man/man3/runestrcat.3 +++ b/man/man3/runestrcat.3 @@ -56,12 +56,12 @@ Rune* runestrstr(Rune *s1, Rune *s2) .SH DESCRIPTION These functions are rune string analogues of the corresponding functions in -.IR strcat (3). +.MR strcat (3) . .SH SOURCE .B \*9/src/lib9 .SH SEE ALSO -.IR memory (3), -.IR rune (3), -.IR strcat (3) +.MR memory (3) , +.MR rune (3) , +.MR strcat (3) .SH BUGS The outcome of overlapping moves varies among implementations. diff --git a/man/man3/searchpath.3 b/man/man3/searchpath.3 index e0709b2e..10b741eb 100644 --- a/man/man3/searchpath.3 +++ b/man/man3/searchpath.3 @@ -13,9 +13,9 @@ char* searchpath(char *name) searches for the executable .I name in the same way that -.IR sh (1) +.MR sh (1) and -.IR rc (1) +.MR rc (1) do. .PP The environment variable @@ -32,9 +32,9 @@ returns a pointer to a malloced string containing a path or simply .IR name ) suitable for use in -.IR open (3) +.MR open (3) or -.IR exec (3). +.MR exec (3) . .PP If .I name diff --git a/man/man3/sechash.3 b/man/man3/sechash.3 index d8b1cd48..cabfbce3 100644 --- a/man/man3/sechash.3 +++ b/man/man3/sechash.3 @@ -138,14 +138,14 @@ and .I sha1unpickle unmarshal a pickled digest. All four routines return a pointer to a newly -.IR malloc (3)'d +.MR malloc (3) 'd object. .SH SOURCE .B \*9/src/libsec .SH SEE ALSO -.IR aes (3), -.IR blowfish (3), -.IR des (3), -.IR elgamal (3), -.IR rc4 (3), -.IR rsa (3) +.MR aes (3) , +.MR blowfish (3) , +.MR des (3) , +.MR elgamal (3) , +.MR rc4 (3) , +.MR rsa (3) diff --git a/man/man3/seek.3 b/man/man3/seek.3 index 36c594c4..7282c366 100644 --- a/man/man3/seek.3 +++ b/man/man3/seek.3 @@ -39,8 +39,8 @@ Seeking in a pipe is a no-op. .SH SOURCE .B \*9/src/lib9/seek.c .SH SEE ALSO -.IR intro (3), -.IR open (3) +.MR intro (3) , +.MR open (3) .SH DIAGNOSTICS Sets .IR errstr . @@ -50,4 +50,4 @@ To avoid name conflicts with the underlying system, is a preprocessor macro defined as .IR p9seek ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/sendfd.3 b/man/man3/sendfd.3 index 771bd9ae..fe6391c2 100644 --- a/man/man3/sendfd.3 +++ b/man/man3/sendfd.3 @@ -20,14 +20,14 @@ and can be used to pass an open file descriptor over a Unix domain socket from one process to another. Since -.IR pipe (3) +.MR pipe (3) is implemented with -.IR socketpair (2) +.MR socketpair (2) instead of -.IR pipe (2), +.MR pipe (2) , .I socket can be a file descriptor obtained from -.IR pipe (3). +.MR pipe (3) . .PP .I Sendfd sends the file descriptor @@ -51,7 +51,7 @@ will not. .SH SOURCE .B \*9/src/lib9/sendfd.c .SH SEE ALSO -.IR socketpair (2), +.MR socketpair (2) , .I sendmsg in -.IR send (2) +.MR send (2) diff --git a/man/man3/setjmp.3 b/man/man3/setjmp.3 index 1210c171..33573ba8 100644 --- a/man/man3/setjmp.3 +++ b/man/man3/setjmp.3 @@ -46,7 +46,7 @@ was called. is the same as .I longjmp except that it is to be called from within a note handler (see -.IR notify (3)). +.MR notify (3) ). The .I uregs argument should be the first argument passed to the note handler. @@ -58,7 +58,7 @@ can also be used to switch stacks. .SH SOURCE .B \*9/src/lib9/jmp.c .SH SEE ALSO -.IR notify (3) +.MR notify (3) .SH BUGS .PP .I Notejmp @@ -78,10 +78,11 @@ are preprocessor macros defined as and .IR p9jmp_buf ; see -.IR intro (3). +.MR intro (3) . .PP .I P9setjmp is implemented as a preprocessor macro that calls .I sigsetjmp (see -Unix's \fIsetjmp\fR(3)). +Unix's +.IR setjmp (3)). diff --git a/man/man3/sleep.3 b/man/man3/sleep.3 index 0afa71d2..fabd2b4b 100644 --- a/man/man3/sleep.3 +++ b/man/man3/sleep.3 @@ -27,7 +27,7 @@ Sleep returns \-1 if interrupted, 0 otherwise. causes an .B alarm note (see -.IR notify (3)) +.MR notify (3) ) to be sent to the invoking process after the number of milliseconds given by the argument. Successive calls to @@ -39,7 +39,7 @@ the alarm clock. .SH SOURCE .B \*9/src/lib9/sleep.c .SH SEE ALSO -.IR intro (3) +.MR intro (3) .SH DIAGNOSTICS These functions set .IR errstr . @@ -53,4 +53,4 @@ are preprocessor macros defined as and .IR p9alarm ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/stat.3 b/man/man3/stat.3 index a992f9a5..3a652d10 100644 --- a/man/man3/stat.3 +++ b/man/man3/stat.3 @@ -105,7 +105,7 @@ struct Dir { .EE .PP The returned structure is allocated by -.IR malloc (3); +.MR malloc (3) ; freeing it also frees the associated strings. .PP This structure and @@ -283,9 +283,9 @@ to retrieve the initial values first. .SH SOURCE .B \*9/src/lib9/dirstat.c .SH SEE ALSO -.IR intro (3), -.IR fcall (3), -.IR dirread (3), +.MR intro (3) , +.MR fcall (3) , +.MR dirread (3) , .IR stat (9p) .SH DIAGNOSTICS The @@ -305,7 +305,7 @@ or is too short for the returned data, the return value will be .B BIT16SZ (see -.IR fcall (3)) +.MR fcall (3) ) and the two bytes returned will contain the initial count field of the returned data; diff --git a/man/man3/strcat.3 b/man/man3/strcat.3 index 2baa9090..7dcf51f7 100644 --- a/man/man3/strcat.3 +++ b/man/man3/strcat.3 @@ -222,7 +222,7 @@ is returned. returns a pointer to a distinct copy of the null-terminated string .I s in space obtained from -.IR malloc (3) +.MR malloc (3) or .L 0 if no space can be obtained. @@ -244,14 +244,14 @@ operates analogously, but ignores ASCII case differences when comparing strings. .SH SOURCE .B \*9/src/lib9 .SH SEE ALSO -.IR memory (3), -.IR rune (3), -.IR runestrcat (3) +.MR memory (3) , +.MR rune (3) , +.MR runestrcat (3) .SH BUGS These routines know nothing about .SM UTF. Use the routines in -.IR rune (3) +.MR rune (3) as appropriate. Note, however, that the definition of .SM UTF diff --git a/man/man3/string.3 b/man/man3/string.3 index 9b88e8d4..301185f7 100644 --- a/man/man3/string.3 +++ b/man/man3/string.3 @@ -268,4 +268,4 @@ The input stack has a maximum depth of 32 nested include files. .SH SOURCE .B \*9/src/libString .SH SEE ALSO -.IR bio (3) +.MR bio (3) diff --git a/man/man3/stringsize.3 b/man/man3/stringsize.3 index cbf15453..c0639ab3 100644 --- a/man/man3/stringsize.3 +++ b/man/man3/stringsize.3 @@ -57,13 +57,13 @@ are analogous, but accept an array of runes rather than .SH SOURCE .B \*9/src/libdraw .SH "SEE ALSO" -.IR addpt (3), -.IR cachechars (3), -.IR subfont (3), -.IR draw (3), -.IR draw (3), -.IR image (7), -.IR font (7) +.MR addpt (3) , +.MR cachechars (3) , +.MR subfont (3) , +.MR draw (3) , +.MR draw (3) , +.MR image (7) , +.MR font (7) .SH DIAGNOSTICS Because strings are loaded dynamically, these routines may generate I/O to the server and produce calls to the graphics error function. diff --git a/man/man3/subfont.3 b/man/man3/subfont.3 index 5e1b09ab..1de30246 100644 --- a/man/man3/subfont.3 +++ b/man/man3/subfont.3 @@ -53,13 +53,13 @@ Font* mkfont(Subfont *f, Rune min) .SH DESCRIPTION Subfonts are the components of fonts that hold the character images. A font comprises an array of subfonts; see -.IR cachechars (3). +.MR cachechars (3) . A new .B Subfont is allocated and initialized with .IR allocsubfont . See -.IR cachechars (3) +.MR cachechars (3) for the meaning of .IR n , .IR height , @@ -81,7 +81,7 @@ The appropriate fields of the returned structure are set to the passed arguments, and the image is registered as a subfont with the graphics device -.IR draw (3). +.MR draw (3) . .I Allocsubfont returns 0 on failure. .PP @@ -97,7 +97,7 @@ on if .B f->info was not allocated by -.IR malloc (3) +.MR malloc (3) it should be zeroed before calling .IR subffree . .PP @@ -150,7 +150,7 @@ Although it is principally a routine internal to the library, may be substituted by the application to provide a less file-oriented subfont naming scheme. .PP The format of a subfont file is described in -.IR font (7). +.MR font (7) . Briefly, it contains a image with all the characters in it, followed by a subfont header, followed by character information. .I Readsubfont @@ -181,13 +181,13 @@ the part of a subfont file that comes after the image. It should be preceded by a call to .IR writeimage (see -.IR allocimage (3)). +.MR allocimage (3) ). .PP .I Stringsubfont is analogous to .B string (see -.IR draw (3)) +.MR draw (3) ) for subfonts. Rather than use the underlying font caching primitives, it calls .B draw @@ -224,12 +224,12 @@ bitmap font file tree .SH SOURCE .B \*9/src/libdraw .SH SEE ALSO -.IR graphics (3), -.IR allocimage (3), -.IR draw (3), -.IR cachechars (3), -.IR image (7), -.IR font (7) +.MR graphics (3) , +.MR allocimage (3) , +.MR draw (3) , +.MR cachechars (3) , +.MR image (7) , +.MR font (7) .SH DIAGNOSTICS All of the functions use the graphics error function (see -.IR graphics (3)). +.MR graphics (3) ). diff --git a/man/man3/sysfatal.3 b/man/man3/sysfatal.3 index c1e9b83c..210136a9 100644 --- a/man/man3/sysfatal.3 +++ b/man/man3/sysfatal.3 @@ -16,17 +16,17 @@ void sysfatal(char *fmt, ...) prints to standard error the name of the running program, a colon and a space, the message described by the -.IR print (3) +.MR print (3) format string .I fmt and subsequent arguments, and a newline. It then calls -.IR exits (3) +.MR exits (3) with the formatted message as argument. The program's name is the value of .BR argv0 , which will be set if the program uses the -.IR arg (3) +.MR arg (3) interface to process its arguments. If .B argv0 @@ -44,7 +44,7 @@ The message is a line with several fields: the name of the machine writing the message; the date and time; the message specified by the -.IR print (3) +.MR print (3) format .I fmt and any following arguments; @@ -60,9 +60,9 @@ can be used safely in multi-threaded programs. .br .B \*9/src/lib9/syslog.c .SH "SEE ALSO" -.IR intro (3), -.IR errstr (3), +.MR intro (3) , +.MR errstr (3) , the .B %r format in -.IR print (3) +.MR print (3) diff --git a/man/man3/thread.3 b/man/man3/thread.3 index 9088ae2e..c0a59091 100644 --- a/man/man3/thread.3 +++ b/man/man3/thread.3 @@ -33,6 +33,7 @@ threadintgrp, threadkill, threadkillgrp, threadmain, +threadmaybackground, threadnotify, threadid, threadpid, @@ -80,6 +81,7 @@ struct Alt { .ft L .ta \w'\fLChannel* 'u +4n +4n +4n +4n void threadmain(int argc, char *argv[]) +int threadmaybackground(void) int mainstacksize int proccreate(void (*fn)(void*), void *arg, uint stacksize) int threadcreate(void (*fn)(void*), void *arg, uint stacksize) @@ -156,27 +158,21 @@ by The thread library provides a .I main function that sets up a proc with a single thread executing -.I threadmain -on a stack of size -.I mainstacksize -(default eight kilobytes). -To set -.IR mainstacksize , -declare a global variable -initialized to the desired value -.RI ( e.g. , -.B int -.B mainstacksize -.B = -.BR 1024 ). -When using the +.IR threadmain . +.PP +Every thread is backed by an operating system-provided .I pthread -library, -.B mainstacksize -is ignored, as is the stack size argument to -.BR proccreate : -the first thread in each proc -runs on the native system stack. +and runs on its system-provided stack; +.I mainstacksize +and the the stack size arguments to +.I proccreate +and +.I threadcreate +are ignored. +Although each thread is backed by a separate +.IR pthread , +the threads in a proc are still scheduled non-preemptively +as on Plan 9 and as described below. .PP .I Threadcreate creates a new thread in the calling proc, returning a unique integer @@ -185,7 +181,7 @@ executes .I fn(arg) on a stack of size .IR stacksize . -Thread stacks are allocated in shared memory, making it valid to pass +Thread stacks are allocated in shared memory, making it valid to pass pointers to stack variables between threads and procs. .I Proccreate creates a new proc, and inside that proc creates @@ -207,7 +203,7 @@ returning the id of the created thread. .\" in .\" .IR rforkflag .) .\" .I Proccreate -.\" is identical to +.\" is identical to .\" .I procrfork .\" with .\" .I rforkflag @@ -238,6 +234,14 @@ When the last thread in .IR threadmain 's proc exits, the program will appear to its parent to have exited. The remaining procs will still run together, but as a background program. +This functionality can only be relied upon if the program defines a function +.I threadmaybackground +returning a non-zero result. +Programs that do not define such a +.I threadmaybackground +will crash instead should the last thread in +.IR threadmain 's +proc exit leaving behind other running procs. .PP The threads in a proc are coroutines, scheduled nonpreemptively in a round-robin fashion. @@ -267,10 +271,10 @@ in arbitrary ways and should synchronize their actions using .B qlocks (see -.IR lock (3)) +.MR lock (3) ) or channel communication. System calls such as -.IR read (3) +.MR read (3) block the entire proc; all threads in a proc block until the system call finishes. .PP @@ -341,18 +345,18 @@ Also for debugging, threads have a string state associated with them. .I Threadsetstate sets the state string. -There is no +There is no .IR threadgetstate ; since the thread scheduler resets the state to .B Running -every time it runs the thread, +every time it runs the thread, it is only useful for debuggers to inspect the state. .PP .I Threaddata returns a pointer to a per-thread pointer that may be modified by threaded programs for per-thread storage. -Similarly, +Similarly, .I procdata returns a pointer to a per-proc pointer. .PP @@ -364,7 +368,7 @@ are threaded analogues of and .I execl (see -.IR exec (3)); +.MR exec (3) ); on success, they replace the calling thread and invoke the external program, never returning. @@ -398,11 +402,11 @@ response. .I Threadexecl and .I threadexec -will duplicate +will duplicate (see -.IR dup (3)) +.MR dup (3) ) the three file descriptors in -.I fd +.I fd onto standard input, output, and error for the external program and then close them in the calling thread. Beware of code that sets @@ -443,14 +447,14 @@ stop the running of the program. returns a channel of pointers to .B Waitmsg structures (see -.IR wait (3)). +.MR wait (3) ). When an exec'ed process exits, a pointer to a .B Waitmsg is sent to this channel. These .B Waitmsg structures have been allocated with -.IR malloc (3) +.MR malloc (3) and should be freed after use. .PP A @@ -467,9 +471,9 @@ operation blocks until the corresponding operation occurs and .IR "vice versa" . .IR Chancreate -allocates a new channel +allocates a new channel for messages of size -.I elsize +.I elsize and with a buffer holding .I nel messages. @@ -611,13 +615,13 @@ calls. .PP .I Chanprint formats its arguments in the manner of -.IR print (3) +.MR print (3) and sends the result to the channel .IR c. The string delivered by .I chanprint is allocated with -.IR malloc (3) +.MR malloc (3) and should be freed upon receipt. .PP Thread library functions do not return on failure; @@ -628,10 +632,10 @@ Threaded programs should use in place of .I atnotify (see -.IR notify (3)). +.MR notify (3) ). .PP It is safe to use -.IR sysfatal (3) +.MR sysfatal (3) in threaded programs. .I Sysfatal will print the error string and call @@ -645,7 +649,7 @@ from the main proc before any other procs have been created. To create new processes, use .IR proccreate . .\" .PP -.\" It is safe to use +.\" It is safe to use .\" .IR rfork .\" (see .\" .IR fork (3)) @@ -663,7 +667,7 @@ To create new processes, use .\" .BR RFCENVG. .\" (To create new processes, use .\" .I proccreate -.\" and +.\" and .\" .IR procrfork .) .\" As mentioned above, .\" the thread library depends on all procs being in the @@ -673,7 +677,7 @@ To create new processes, use .SH FILES .B \*9/acid/thread contains useful -.IR acid (1) +.MR acid (1) functions for debugging threaded programs. .PP .B \*9/src/libthread/test @@ -681,8 +685,8 @@ contains some example programs. .SH SOURCE .B \*9/src/libthread .SH SEE ALSO -.IR intro (3), -.IR ioproc (3) +.MR intro (3) , +.MR ioproc (3) .SH BUGS To avoid name conflicts, .IR alt , @@ -707,7 +711,7 @@ and so on. is defined as a macro that expands to .IR threadyield . See -.IR intro (3). +.MR intro (3) . .PP Threadint, threadintgrp, diff --git a/man/man3/time.3 b/man/man3/time.3 index dfcafaf9..6095c329 100644 --- a/man/man3/time.3 +++ b/man/man3/time.3 @@ -41,4 +41,4 @@ are preprocessor macros defined as and .IR p9nsec ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/udpread.3 b/man/man3/udpread.3 index 11412596..ebf0b997 100644 --- a/man/man3/udpread.3 +++ b/man/man3/udpread.3 @@ -65,4 +65,4 @@ to send a response back to the sender of the original packet. .SH SOURCE .B \*9/src/lib9/udp.c .SH SEE ALSO -.IR ip (3) +.MR ip (3) diff --git a/man/man3/venti-cache.3 b/man/man3/venti-cache.3 index 54e46c61..15d141ea 100644 --- a/man/man3/venti-cache.3 +++ b/man/man3/venti-cache.3 @@ -112,9 +112,9 @@ the block's cache address. allocates a new cache using the client connection .I z (see -.IR venti-conn (3) +.MR venti-conn (3) and -.IR venti-client (3)), +.MR venti-client (3) ), with .I maxmem bytes of memory. @@ -195,7 +195,7 @@ The default function is .I vtwrite (see -.IR venti-client (3)); +.MR venti-client (3) ); .I vtsetcachewrite sets it. .I Vtsetcachewrite @@ -230,8 +230,8 @@ or, more commonly, that cache blocks are being leaked. .SH SOURCE .B \*9/src/libventi .SH SEE ALSO -.IR venti (3), -.IR venti-client (3), -.IR venti-conn (3), -.IR venti-file (3), -.IR venti (7) +.MR venti (3) , +.MR venti-client (3) , +.MR venti-conn (3) , +.MR venti-file (3) , +.MR venti (7) diff --git a/man/man3/venti-client.3 b/man/man3/venti-client.3 index cc8d14f4..1f81acaf 100644 --- a/man/man3/venti-client.3 +++ b/man/man3/venti-client.3 @@ -53,7 +53,7 @@ int vtping(VtConn *z) extern int ventidoublechecksha1; /* default 1 */ .SH DESCRIPTION These routines execute the client side of the -.IR venti (7) +.MR venti (7) protocol. .PP .I Vtrpc @@ -84,7 +84,7 @@ is typically called only indirectly, via calls .I vtversion (see -.IR venti-conn (3)) +.MR venti-conn (3) ) and .IR vthello , in that order, returning success only @@ -171,14 +171,14 @@ in the same proc should start separate procs running and .I vtrecvproc as described in -.IR venti-conn (3). +.MR venti-conn (3) . .SH SOURCE .B \*9/src/libventi .SH SEE ALSO -.IR venti (3), -.IR venti-conn (3), -.IR venti-packet (3), -.IR venti (7) +.MR venti (3) , +.MR venti-conn (3) , +.MR venti-packet (3) , +.MR venti (7) .SH DIAGNOSTICS .I Vtrpc and diff --git a/man/man3/venti-conn.3 b/man/man3/venti-conn.3 index ea597de3..ba40ff6e 100644 --- a/man/man3/venti-conn.3 +++ b/man/man3/venti-conn.3 @@ -90,21 +90,21 @@ for reading and writing. .I Vtdial dials the given network address (see -.IR dial (3)) +.MR dial (3) ) and returns a corresponding connection. It returns nil if the connection cannot be established. .PP .I Vtversion exchanges version information with the remote side as described in -.IR venti (7). +.MR venti (7) . The negotiated version is stored in .IB z ->version \fR. .PP .I Vtsend writes a packet (see -.IR venti-packet (3)) +.MR venti-packet (3) ) on the connection .IR z . The packet @@ -115,7 +115,7 @@ be returned by .I vtsend will add the two-byte length field (see -.IR venti (7)) +.MR venti (7) ) at the begnning. .I Vtsend frees @@ -137,7 +137,7 @@ and block until the packet can be written or read from the network. In a threaded program (see -.IR thread (3)), +.MR thread (3) ), this may not be desirable. If the caller arranges for .IR vtsendproc @@ -192,12 +192,12 @@ as they are sent or received. .SH SOURCE .B \*9/src/libventi .SH SEE ALSO -.IR venti (1), -.IR venti (3), -.IR venti-client (3), -.IR venti-packet (3), -.IR venti-server (3), -.IR venti (7) +.MR venti (1) , +.MR venti (3) , +.MR venti-client (3) , +.MR venti-packet (3) , +.MR venti-server (3) , +.MR venti (7) .SH DIAGNOSTICS Routines that return pointers return nil on error. Routines returning integers return 0 on success, \-1 on error. diff --git a/man/man3/venti-fcall.3 b/man/man3/venti-fcall.3 index ed3916ff..f721669e 100644 --- a/man/man3/venti-fcall.3 +++ b/man/man3/venti-fcall.3 @@ -109,7 +109,7 @@ converts a .B VtEntry structure describing a Venti file (see -.IR venti (7)) +.MR venti (7) ) into a 40-byte .RB ( VtEntrySize ) structure at @@ -122,7 +122,7 @@ converts a .B VtFcall structure describing a Venti protocol message (see -.IR venti (7)) +.MR venti (7) ) into a packet. .I Vtfcallunpack does the reverse conversion. @@ -130,7 +130,7 @@ does the reverse conversion. The fields in a .B VtFcall are named after the protocol fields described in -.IR venti (7), +.MR venti (7) , except that the .B type field is renamed @@ -158,7 +158,7 @@ and the packet The block type enumeration defined in .B (presented in -.IR venti (7)) +.MR venti (7) ) differs from the one used on disk and in the network protocol. The disk and network representation uses different @@ -232,7 +232,7 @@ is nil, the label is ignored. and .I vtscorefmt are -.IR print (3) +.MR print (3) formatters to print .B VtFcall structures and scores. @@ -244,9 +244,9 @@ is installed as .SH SOURCE .B \*9/src/libventi .SH SEE ALSO -.IR venti (1), -.IR venti (3), -.IR venti (7) +.MR venti (1) , +.MR venti (3) , +.MR venti (7) .SH DIAGNOSTICS .IR Vtentrypack , .IR vtfcallpack , diff --git a/man/man3/venti-file.3 b/man/man3/venti-file.3 index 5378bf5c..9f3698c9 100644 --- a/man/man3/venti-file.3 +++ b/man/man3/venti-file.3 @@ -99,7 +99,7 @@ void vtfileunlock(VtFile *f); .SH DESCRIPTION These routines provide a simple interface to create and manipulate Venti file trees (see -.IR venti (7)). +.MR venti (7) ). .PP .I Vtfilecreateroot creates a new Venti file. @@ -226,7 +226,7 @@ if an error is encountered. .I Vtfilewrite writes to an in-memory copy of the data blocks (see -.IR venti-cache (3)) +.MR venti-cache (3) ) instead of writing directly to Venti. .I Vtfileflush writes all copied blocks associated with @@ -319,7 +319,7 @@ in the same directory block. .SH SOURCE .B \*9/src/libventi/file.c .SH SEE ALSO -.IR venti-cache (3), -.IR venti-conn (3), -.IR venti-client (3), -.IR venti (7) +.MR venti-cache (3) , +.MR venti-conn (3) , +.MR venti-client (3) , +.MR venti (7) diff --git a/man/man3/venti-log.3 b/man/man3/venti-log.3 index 6b74c6cd..b0a99062 100644 --- a/man/man3/venti-log.3 +++ b/man/man3/venti-log.3 @@ -122,9 +122,9 @@ passed nil log structures. .PP The server library (see -.IR venti-conn (3) +.MR venti-conn (3) and -.IR venti-server (3)) +.MR venti-server (3) ) writes debugging information to the log named .IR VtServerLog , which defaults to the string @@ -132,5 +132,5 @@ which defaults to the string .SH SOURCE .B \*9/src/libventi .SH SEE ALSO -.IR venti (3), -.IR venti (8) +.MR venti (3) , +.MR venti (8) diff --git a/man/man3/venti-mem.3 b/man/man3/venti-mem.3 index 0a872a0a..f9f83fb6 100644 --- a/man/man3/venti-mem.3 +++ b/man/man3/venti-mem.3 @@ -35,7 +35,7 @@ void vtfree(void *ptr) .SH DESCRIPTION These routines allocate and free memory. On failure, they print an error message and call -.IR sysfatal (3). +.MR sysfatal (3) . They do not return. .PP .I Vtbrk @@ -63,4 +63,4 @@ when no longer needed. .SH SOURCE .B \*9/src/libventi .SH SEE ALSO -.IR venti (3) +.MR venti (3) diff --git a/man/man3/venti-packet.3 b/man/man3/venti-packet.3 index 3ed8d6fe..faea58c2 100644 --- a/man/man3/venti-packet.3 +++ b/man/man3/venti-packet.3 @@ -129,7 +129,7 @@ because fragments may not be filled completely. compares the data sections of two packets as .I memcmp (see -.IR memory (3)) +.MR memory (3) ) would. .PP .I Packetconcat @@ -260,7 +260,7 @@ bytes at offset .SH SOURCE .B \*9/src/libventi .SH SEE ALSO -.IR venti (3) +.MR venti (3) .SH DIAGNOSTICS These functions return errors only when passed invalid inputs, diff --git a/man/man3/venti-server.3 b/man/man3/venti-server.3 index 810852e1..0265781a 100644 --- a/man/man3/venti-server.3 +++ b/man/man3/venti-server.3 @@ -33,7 +33,7 @@ VtReq* vtgetreq(VtSrv *srv) void vtrespond(VtReq *req) .SH DESCRIPTION These routines execute the server side of the -.IR venti (7) +.MR venti (7) protocol. .PP .I Vtsrvhello @@ -115,8 +115,8 @@ blocks written to it and returns error on all reads. .SH SOURCE .B \*9/src/libventi .SH SEE ALSO -.IR venti (3), -.IR venti-conn (3), -.IR venti-packet (3), -.IR venti (7), -.IR venti (8) +.MR venti (3) , +.MR venti-conn (3) , +.MR venti-packet (3) , +.MR venti (7) , +.MR venti (8) diff --git a/man/man3/venti-zero.3 b/man/man3/venti-zero.3 index 270b7680..26bc3fe7 100644 --- a/man/man3/venti-zero.3 +++ b/man/man3/venti-zero.3 @@ -52,5 +52,5 @@ is the score of the zero-length block. .br .B \*9/src/libventi/zeroscore.c .SH SEE ALSO -.IR venti (3), -.IR venti (7) +.MR venti (3) , +.MR venti (7) diff --git a/man/man3/venti.3 b/man/man3/venti.3 index 632d5998..f5222fad 100644 --- a/man/man3/venti.3 +++ b/man/man3/venti.3 @@ -15,61 +15,61 @@ This manual page describes general utility functions. .PP Other manual pages describe the library functions in detail. .PP -.IR Venti-cache (3) +.MR Venti-cache (3) describes a simple in-memory block cache to help clients. .PP -.IR Venti-conn (3) +.MR Venti-conn (3) describes routines for manipulating network connections between Venti clients and servers. -.IR Venti-client (3) +.MR Venti-client (3) and -.IR venti-server (3) +.MR venti-server (3) describe routines for writing clients and servers on top of these. .PP -.IR Venti-fcall (3) +.MR Venti-fcall (3) describes the C representation of Venti protocol messages and data structures. It also describes routines that convert between the C representation and the network and disk representations. .PP -.IR Venti-file (3) +.MR Venti-file (3) describes routines for writing clients that manipulate Venti file trees (see -.IR venti (7)). +.MR venti (7) ). .PP -.IR Venti-log (3) +.MR Venti-log (3) describes routines to access in-memory log buffers as well as the logging that is done automatically by the library. .PP -.IR Venti-mem (3) +.MR Venti-mem (3) describes wrappers around the canonical -.IR malloc (3) +.MR malloc (3) routines that abort on error. .PP -.IR Venti-packet (3) +.MR Venti-packet (3) describes routines for manipulating zero-copy chains of data buffers. .PP -.IR Venti-zero (3) +.MR Venti-zero (3) describes routines to zero truncate and zero extend blocks (see -.IR venti (7)). +.MR venti (7) ). .SH SOURCE .B \*9/src/libventi .SH SEE ALSO -.IR venti (1), -.IR venti-cache (3), -.IR venti-client (3), -.IR venti-fcall (3), -.IR venti-file (3) -.IR venti-log (3), -.IR venti-mem (3), -.IR venti-packet (3), -.IR venti-server (3), -.IR venti-zero (3), -.IR venti (7), -.IR venti (8) +.MR venti (1) , +.MR venti-cache (3) , +.MR venti-client (3) , +.MR venti-fcall (3) , +.MR venti-file (3) +.MR venti-log (3) , +.MR venti-mem (3) , +.MR venti-packet (3) , +.MR venti-server (3) , +.MR venti-zero (3) , +.MR venti (7) , +.MR venti (8) diff --git a/man/man3/wait.3 b/man/man3/wait.3 index 28d5d731..889ccd1f 100644 --- a/man/man3/wait.3 +++ b/man/man3/wait.3 @@ -29,9 +29,9 @@ int awaitfor(int pid, char *s, int n) .SH DESCRIPTION .I Wait causes a process to wait for any child process (see -.IR fork (2) +.MR fork (2) and -.IR rfork (3)) +.MR rfork (3) ) to exit. It returns a .B Waitmsg @@ -62,7 +62,7 @@ the time spent in system calls, and the child's elapsed real time, all in units of milliseconds. .B Msg contains the message that the child specified in -.IR exits (3). +.MR exits (3) . For a normal exit, .B msg[0] is zero, @@ -78,7 +78,7 @@ returns immediately, with return value nil. The .B Waitmsg structure is allocated by -.IR malloc (3) +.MR malloc (3) and should be freed after use. For programs that only need the pid of the exiting program, .I waitpid @@ -114,7 +114,7 @@ The filled-in buffer may be parsed (after appending a NUL) using .IR tokenize (see -.IR getfields (3)); +.MR getfields (3) ); the resulting fields are, in order, pid, the three times, and the exit string, which will be .B '' @@ -139,8 +139,8 @@ returns .PP .B \*9/src/lib9/await.c .SH "SEE ALSO" -.IR rfork (3), -.IR exits (3), +.MR rfork (3) , +.MR exits (3) , .SH DIAGNOSTICS These routines set .IR errstr . @@ -156,4 +156,4 @@ are preprocessor macros defined as and .IR p9waitfor ; see -.IR intro (3). +.MR intro (3) . diff --git a/man/man3/window.3 b/man/man3/window.3 index 58250443..b8a6db18 100644 --- a/man/man3/window.3 +++ b/man/man3/window.3 @@ -121,7 +121,7 @@ to color the window initially, and a refresh method The refresh methods are .BR Refbackup , which provides backing store and is the method used by -.IR rio (1) +.MR rio (1) for its clients; .BR Refnone , which provides no refresh and is designed for temporary uses @@ -142,7 +142,7 @@ pointer that may be treated like any other image. In particular, it is freed by calling .B freeimage (see -.IR allocimage (3)). +.MR allocimage (3) ). The following functions, however, apply only to windows, not regular images. .PP .B Bottomwindow @@ -199,13 +199,13 @@ and screen position .RI ( scr ). Their usage is shown in the Examples section. .PP -.IR Rio (1) +.MR Rio (1) creates its client windows with backing store, .BR Refbackup . The graphics initialization routine, .B initdraw (see -.IR graphics (3)), +.MR graphics (3) ), builds a .B Screen upon this, and then allocates upon that another window indented @@ -234,10 +234,10 @@ actual screen position of the window unless it is recorded separately. .SH SOURCE .B \*9/src/libdraw .SH SEE ALSO -.IR graphics (3), -.IR draw (3), -.IR cachechars (3), -.IR draw (3) +.MR graphics (3) , +.MR draw (3) , +.MR cachechars (3) , +.MR draw (3) .SH BUGS The refresh method .B Refmesg diff --git a/man/man4/0intro.4 b/man/man4/0intro.4 index 1e4c81d2..c80db208 100644 --- a/man/man4/0intro.4 +++ b/man/man4/0intro.4 @@ -15,7 +15,7 @@ In Plan 9, the kernel mount device \fImnt\fR(3) acts as a client to the 9P servers mounted in the current name space, translating system calls such as -.IR open (2) +.MR open (2) into 9P transactions such as .IR open (9p). The kernel also multiplexes the potentially many processes onto a single 9P conversation @@ -30,17 +30,17 @@ On Unix, 9P clients do not access servers via the traditional file system call interface. Only the Unix name space can be accessed that way. Instead, 9P clients use the -.IR 9pclient (3) +.MR 9pclient (3) library to connect and interact directly with particular 9P servers. The -.IR 9p (1) +.MR 9p (1) command-line client is useful for interactive use and in shell scripts. .PP To preserve the façade of a single 9P conversation with each server, 9P servers invoke -.IR 9pserve (4), +.MR 9pserve (4) , typically via -.IR post9pservice (3). +.MR post9pservice (3) . .I 9pserve announces a 9P service at a particular network address and multiplexes the clients that connect to @@ -58,7 +58,7 @@ Setting the .B $NAMESPACE environment variable overrides this default. The -.IR namespace (1) +.MR namespace (1) command prints the current name space directory. .PP Occasionally it is useful to be able to connect the input or output @@ -73,7 +73,7 @@ implementation of (see also .I fsopenfd in -.IR 9pclient (3)) +.MR 9pclient (3) ) returns the read or write end of a pipe; a helper process transfers data between the other end of the pipe and the 9P server. diff --git a/man/man4/9import.4 b/man/man4/9import.4 index e5b177cf..6ddff346 100644 --- a/man/man4/9import.4 +++ b/man/man4/9import.4 @@ -19,7 +19,7 @@ tool allows an arbitrary on a remote .I system, with the capability of running the Plan 9 -.IR exportfs (4) +.MR exportfs (4) service, to be imported into the local name space. Usually @@ -31,7 +31,7 @@ A process is started on the remote machine, with authority of the user of .IR 9import , to perform work for the local machine using the -.IR exportfs (4) +.MR exportfs (4) service. The default port used is TCP 17007. If @@ -55,11 +55,11 @@ Use .I keypattern to select a key to authenticate to the remote side (see -.IR auth (2)). +.MR auth (2) ). .TP .B -p Push the -.IR aan (8) +.MR aan (8) filter onto the connection to protect against temporary network outages. .TP @@ -69,11 +69,11 @@ Post the connection's mountable file descriptor as .SH SOURCE .B \*9/src/cmd/9import.c .SH SEE ALSO -.IR srv (4), -.IR aan (8), -.IR listen1 (8), +.MR srv (4) , +.MR aan (8) , +.MR listen1 (8) , .B cs in -.IR ndb (7) +.MR ndb (7) .SH BUGS Encryption is not implemented. diff --git a/man/man4/9pserve.4 b/man/man4/9pserve.4 index cd34d931..7f691b58 100644 --- a/man/man4/9pserve.4 +++ b/man/man4/9pserve.4 @@ -50,7 +50,7 @@ and clunks any outstanding fids belonging to the client. .PP .I 9pserve is typically not invoked directly; use -.IR post9pservice (3) +.MR post9pservice (3) instead. .PP The options are: @@ -73,7 +73,7 @@ rewrite all attach messages to use and .IR afid ; used to implement -.IR srv (4)'s +.MR srv (4) 's .B -a option .TP @@ -90,8 +90,8 @@ instead assume 9P2000 and a maximum message size of .IR msize .PD .SH "SEE ALSO -.IR intro (4), +.MR intro (4) , .IR intro (9p), -.IR 9pfuse (4) +.MR 9pfuse (4) .SH SOURCE .B \*9/src/cmd/9pserve.c diff --git a/man/man4/acme.4 b/man/man4/acme.4 index 7449dbd2..f55a85b7 100644 --- a/man/man4/acme.4 +++ b/man/man4/acme.4 @@ -15,12 +15,12 @@ acme \- control files for text windows \&... ] .SH DESCRIPTION The text window system -.IR acme (1) +.MR acme (1) serves a variety of files for reading, writing, and controlling windows. Some of them are virtual versions of system files for dealing with the virtual console; others control operations -of +of .I acme itself. When a command is run under @@ -28,12 +28,13 @@ When a command is run under a directory holding these files is posted as the 9P service .B acme (using -.IR 9pserve (4)). +.MR 9pserve (4) ). .PP Some of these files supply virtual versions of services available from the underlying environment, in particular the character terminal files in Plan 9's -\fIcons\fR(3). -(Unlike in Plan 9's \fIrio\fR(1), +.IR cons (3). +(Unlike in Plan 9's +.IR rio (1), each command under .I acme sees the same set of files; there is not a distinct @@ -46,7 +47,7 @@ Other files are unique to is a subdirectory used by .B win (see -.IR acme (1)) +.MR acme (1) ) as a mount point for the .I acme files associated with the window in which @@ -183,9 +184,10 @@ is always appended; the file offset is ignored. .B ctl may be read to recover the five numbers as held in the .B index -file, described above, plus three more fields: the width of the -window in pixels, the name of the font used in the window, -and the width of a tab character in pixels. +file, described above, plus five more fields: the width of the +window in pixels; the name of the font used in the window; +the width of a tab character in pixels; a 1 if there is undo history, 0 otherwise; +a 1 if there is redo history, 0 otherwise. Text messages may be written to .B ctl to affect the window. @@ -234,6 +236,11 @@ Equivalent to the .B Get interactive command with no arguments; accepts no arguments. .TP +.BI font " path +Equivalent to the +.B Font +interactive command with a single (required) argument. +.TP .B limit=addr When the .B ctl @@ -430,5 +437,5 @@ except that reads stop at the end address. .SH SOURCE .B \*9/src/cmd/acme .SH SEE ALSO -.IR rio (1), -.IR acme (1) +.MR rio (1) , +.MR acme (1) diff --git a/man/man4/factotum.4 b/man/man4/factotum.4 index 3a2d3d7c..02466fcf 100644 --- a/man/man4/factotum.4 +++ b/man/man4/factotum.4 @@ -10,7 +10,7 @@ factotum \- authentication agent ] [ .B -s .I srvname -] +] .\" [ .\" .B -m .\" .I mtpt @@ -79,7 +79,7 @@ same user id as it. For select protocols such as it can also act as a client for other processes provided its user id may speak for the other process' user id (see Plan 9's -\fIauthsrv\fR(6)). +.IR authsrv (6)). .I Factotum can act in the role of server for any process. .PP @@ -127,7 +127,7 @@ RSA encryption and signatures, used by SSH and TLS. passwords in the clear. .TP .B vnc -.IR vnc (1)'s +.MR vnc (1) 's challenge/response. .TP .B wep @@ -186,7 +186,7 @@ cpu server. On starting, it will attempt to get a key from NVRAM using .B readnvram (see -.IR authsrv (3)), +.MR authsrv (3) ), prompting for anything it needs. It will never subsequently prompt for a key that it doesn't have. @@ -227,7 +227,7 @@ the kernel at boot time. .PP A .I "key tuple -is a space delimited list of +is a space delimited list of .IB attribute = value pairs. An attribute whose name begins with an exclamation point .RB ( ! ) @@ -245,7 +245,7 @@ specific to each supported protocol. .PP All keys can have additional attibutes that act either as comments or as selectors to distinguish them in the -.IR auth (3) +.MR auth (3) library calls. .PP The factotum owner can use any key stored by factotum. @@ -305,9 +305,9 @@ such as and .B auth_challenge (see -.IR auth (3)) +.MR auth (3) ) to specify which key and protocol to use for an authentication. -Like a key tuple, a key template is also a list of +Like a key tuple, a key template is also a list of .IB attribute = value pairs. It must specify at least the protocol and enough @@ -367,7 +367,7 @@ turned on by the option. .PP By default when factotum starts it looks for a -.IR secstore (1) +.MR secstore (1) account on $auth for the user and, if one exists, prompts for a secstore password in order to fetch the file @@ -385,11 +385,11 @@ sets a public/private keypair for ssh authentication, generated by .B ssh_genkey (see -.IR ssh (1)). +.MR ssh (1) ). .PD .SS "Confirming key use .PP -The +The .B confirm file provides a connection from .I factotum @@ -397,7 +397,7 @@ to a confirmation server, normally the program .IR auth/fgui . Whenever a key with the .B confirm -attribute is used, +attribute is used, .I factotum requires confirmation of its use. If no process has .B confirm @@ -429,7 +429,7 @@ the same user id as .IR factotum . .SS "Prompting for keys .PP -The +The .B needkey file provides a connection from .I factotum @@ -481,11 +481,11 @@ RPC's) until done if successful, reading back an .I AuthInfo structure (see -.IR authsrv (3)). +.MR authsrv (3) ). .PP The RPC protocol is normally embodied by one of the routines in -.IR auth (3). +.MR auth (3) . We describe it here should anyone want to extend the library. .PP @@ -545,7 +545,7 @@ necessary authentication has succeeded, an .B AuthInfo structure (see -.IR auth (3)) +.MR auth (3) ) can be retrieved with an .B authinfo RPC @@ -621,7 +621,7 @@ is expected to be a long hexadecimal string. These are useful for manually debugging of binary protocols. .TP .B authinfo -retrieve the AuthInfo structure. +retrieve the AuthInfo structure. The possible replies are: .RS .TP @@ -661,7 +661,7 @@ with its own roles and required key attributes. and .I p9cr are used to authenticate to Plan 9 systems; -valid +valid .BR role s are .B client @@ -691,7 +691,7 @@ is a meta-protocol that negotiates a protocol .RB ( p9sk1 or .BR p9sk2 ) -and an authentication domain and then invokes the +and an authentication domain and then invokes the given protocol with a .B dom= attribute. @@ -703,7 +703,7 @@ and are intended to be proxied via .I auth_proxy (see -.IR auth (3)). +.MR auth (3) ). .\" The protocols follow .\" .IR p9any (7) .\" and @@ -736,7 +736,7 @@ before being sent over the network. .PP .I Vnc is the challenge-response protocol used by -.IR vnc (1); +.MR vnc (1) ; valid roles are .B client and @@ -746,7 +746,7 @@ The client protocol requires a key with attribute .BR !password . Conventionally, client keys also have -.B user +.B user and .B server attributes. @@ -763,7 +763,7 @@ except that the challenge and response are not textual. and .I cram are challenge-response protocols typically -used to authenticate +used to authenticate to mail servers. The client protocols require .B proto=apop @@ -774,7 +774,7 @@ keys with and .B !password attributes. -Conventionally, client keys also have +Conventionally, client keys also have .B server attributes. The server protocol requires a @@ -828,7 +828,7 @@ structure (defined in .PP .I Pass is a client-only protocol that hands out passwords -from +from .B proto=pass keys with .B user @@ -840,7 +840,7 @@ a string: a space-separated quoted user name and password that can be parsed with .I tokenize (see -.IR getfields (3)). +.MR getfields (3) ). Conventionally, client keys have distinguishing attributes like .B service @@ -860,7 +860,7 @@ keys with .BR !key2 , or .B !key3 -attributes. +attributes. The protocol with .I factotum is: @@ -873,7 +873,7 @@ opens the device's control file, sets the wireless secret using the key, and turns on encryption. If the key has an .B essid -attribute, +attribute, .I factotum uses it to set the wireless station ID. .PP @@ -891,7 +891,7 @@ uses keys with .B ek and -.B n +.B n attributes, large integers specifying the public half of the key. If a key is to be used for decryption or signing, @@ -905,13 +905,13 @@ and .BR !dk specifying the private half of the key; see -.IR rsa (3). +.MR rsa (3) . Conventionally, .I rsa keys also have .B service attributes specifying the context in which the key is used: -.B ssh +.B ssh (SSH version 1), .B ssh-rsa (SSH version 2), @@ -946,7 +946,7 @@ and The hash function must be known to .I factotum because the signature encodes the type of hash used. -The +The .B encrypt and .B verify @@ -972,11 +972,11 @@ attributes. If the key is to be used for signing, it must also have a .B !secret attribute; see -.IR dsa (3). +.MR dsa (3) . Conventionally, .I dsa keys -also have +also have .B service attributes specifying the context in which the key is used: .B ssh-dss @@ -992,7 +992,7 @@ Unlike .IR rsa , the .I dsa -protocol ignores the +protocol ignores the .B hash attribute; it always uses SHA1. .PP @@ -1019,4 +1019,4 @@ The response is a hexadecimal string of length 32. .SH SOURCE .B \*9/src/cmd/auth/factotum .SH SEE ALSO -.IR ssh-agent (1) +.MR ssh-agent (1) diff --git a/man/man4/fontsrv.4 b/man/man4/fontsrv.4 index 3fb0d66b..6cc0d0a7 100644 --- a/man/man4/fontsrv.4 +++ b/man/man4/fontsrv.4 @@ -20,7 +20,7 @@ fontsrv \- file system access to host fonts presents the host window system's fonts in the standard Plan 9 format (see -.IR font (7)). +.MR font (7) ). It serves a virtual directory tree mounted at .I mtpt (if the @@ -31,13 +31,13 @@ and posted at (default .IR font ). .PP -The +The .B -p -option changes +option changes .IR fontsrv 's behavior: rather than serve a file system, .I fontsrv -prints to standard output the contents of the named +prints to standard output the contents of the named .IR path . If .I path @@ -66,20 +66,20 @@ Each size directory contains a file and subfont files named .BR x0000.bit , -.BR x0100.bit , +.BR x0020.bit , and so on -representing 256-character Unicode ranges. +representing 32-character Unicode ranges. .PP .I Openfont (see -.IR graphics (3)) -recognizes font paths beginning with +.MR graphics (3) ) +recognizes font paths beginning with .B /mnt/font and implements them by invoking .IR fontsrv ; it need not be running already. -See -.IR font (7) +See +.MR font (7) for a full discussion of font name syntaxes. .SH EXAMPLES List the fonts on the system: @@ -95,8 +95,8 @@ or: % fontsrv -p . .EE .LP -Run -.IR acme (1) +Run +.MR acme (1) using the operating system's Monaco as the fixed-width font: .IP .EX @@ -104,7 +104,7 @@ using the operating system's Monaco as the fixed-width font: .EE .LP Run -.IR sam (1) +.MR sam (1) using the same font: .IP .EX @@ -113,7 +113,7 @@ using the same font: .SH SOURCE .B \*9/src/cmd/fontsrv .SH SEE ALSO -.IR font (7) +.MR font (7) .SH BUGS .PP Due to OS X restrictions, diff --git a/man/man4/fossil.4 b/man/man4/fossil.4 index 7c06f2f7..fd6dd0a9 100644 --- a/man/man4/fossil.4 +++ b/man/man4/fossil.4 @@ -148,10 +148,10 @@ will be named The attach name used in .I mount (see -.IR bind (1), -.IR bind (2) +.MR bind (1) , +.MR bind (2) and -.IR attach (5)) +.MR attach (5) ) selects a file system to be served and optionally a subtree, in the format @@ -163,7 +163,7 @@ An empty attach name selects normally requires all users except .L none to provide authentication tickets on each -.IR attach (5). +.MR attach (5) . To keep just anyone from connecting, .L none is only allowed to attach after another user @@ -179,7 +179,7 @@ flag to or .B srv (see -.IR fossilcons (8)). +.MR fossilcons (8) ). .PP The groups called .B noworld @@ -207,7 +207,7 @@ readable by the world but writable only to the developers. starts a new instance of the fossil file server. It is configured mainly through console commands, documented in -.IR fossilcons (8). +.MR fossilcons (8) . .PP The options are: .TF "-c\fI cmd @@ -239,7 +239,7 @@ and which starts a file server console on .BI /srv/ cons \fR. See -.IR fossilcons (8) +.MR fossilcons (8) for more information. .TP .BI -f " file @@ -269,7 +269,7 @@ for inconsistencies. is deprecated in favor of the console .B check command (see -.IR fossilcons (8)). +.MR fossilcons (8) ). .I Flchk prints .I fossil @@ -375,7 +375,7 @@ system stored on Venti at The score should have been generated by .I fossil rather than by -.IR vac (1), +.MR vac (1) , so that the appropriate snapshot metadata is present. .PD .PP @@ -450,7 +450,7 @@ See the discussion of the and .B uname commands in -.IR fossilcons (8) +.MR fossilcons (8) for more about the user table. .ne 3 .PP @@ -488,13 +488,13 @@ command to prepare the script. .SH SOURCE .B \*9/src/cmd/fossil .SH SEE ALSO -.IR yesterday (1), -.IR fs (3), -.IR fs (4), -.IR srv (4), -.IR fossilcons (8), -.IR loadfossil (8), -.IR venti (8) +.MR yesterday (1) , +.MR fs (3) , +.MR fs (4) , +.MR srv (4) , +.MR fossilcons (8) , +.MR loadfossil (8) , +.MR venti (8) .SH BUGS It is possible that the disk format (but not the Venti format) will change in the future, to make the disk a full cache diff --git a/man/man4/import.4 b/man/man4/import.4 index 9dd81d72..434a23bd 100644 --- a/man/man4/import.4 +++ b/man/man4/import.4 @@ -48,7 +48,7 @@ the path have different meanings on the two systems.) connects to .I system using -.IR ssh (1). +.MR ssh (1) . It invokes .I import on the remote system to carry out the remote @@ -109,5 +109,5 @@ sam & .SH SOURCE .B \*9/src/cmd/import.c .SH SEE ALSO -.IR 9pserve (4), -.IR intro (4) +.MR 9pserve (4) , +.MR intro (4) diff --git a/man/man4/plumber.4 b/man/man4/plumber.4 index 88801eb4..c309a39c 100644 --- a/man/man4/plumber.4 +++ b/man/man4/plumber.4 @@ -14,17 +14,17 @@ plumber \- file system for interprocess messaging The .I plumber is a user-level file server that receives, examines, rewrites, and dispatches -.IR plumb (7) +.MR plumb (7) messages between programs. Its behavior is programmed by a .I plumbing file (default .BR $HOME/lib/plumbing ) in the format of -.IR plumb (7). +.MR plumb (7) . .PP Its services are posted via -.IR 9pserve (4) +.MR 9pserve (4) as .BR plumb , and consist of two @@ -39,14 +39,14 @@ for dispatching messages to applications. Programs use .B fswrite (see -.IR 9pclient (3)) +.MR 9pclient (3) ) to deliver messages to the .B send file, and .I fsread to receive them from the corresponding port. For example, -.IR sam (1)'s +.MR sam (1) 's .B plumb menu item or the .B B @@ -115,13 +115,13 @@ statements .TP .B plumb mount name for -.IR plumber (4). +.MR plumber (4) . .SH SOURCE .B \*9/src/cmd/plumb .SH "SEE ALSO" -.IR plumb (1), -.IR plumb (3), -.IR plumb (7) +.MR plumb (1) , +.MR plumb (3) , +.MR plumb (7) .\" .SH BUGS .\" .IR Plumber 's .\" file name space is fixed, so it is difficult to plumb diff --git a/man/man4/ramfs.4 b/man/man4/ramfs.4 index 25ae4bf6..79451981 100644 --- a/man/man4/ramfs.4 +++ b/man/man4/ramfs.4 @@ -21,7 +21,7 @@ By default posts its service as .B ramfs using -.IR 9pserve (4). +.MR 9pserve (4) . .PP The .B -S @@ -46,5 +46,5 @@ It can also be used to provide high-performance temporary files. .SH SOURCE .B \*9/src/cmd/ramfs.c .SH "SEE ALSO" -.IR 9p (3), -.IR 9pserve (4) +.MR 9p (3) , +.MR 9pserve (4) diff --git a/man/man4/smugfs.4 b/man/man4/smugfs.4 index 4fb8c7f0..be3404b1 100644 --- a/man/man4/smugfs.4 +++ b/man/man4/smugfs.4 @@ -24,7 +24,7 @@ is a user-level file system that provides access to images stored on the SmugMug photo sharing service. It logs in after obtaining a password from -.IR factotum (4) +.MR factotum (4) using .B server=smugmug.com and @@ -32,7 +32,7 @@ and (if any) as key criteria (see -.IR auth (3)). +.MR auth (3) ). Then .I smugfs serves a virtual directory tree mounted at @@ -265,7 +265,7 @@ SmugMug, If multiple categories or albums have the same name, only one will be accessible via the file system interface. Renaming the accessible one via Unix's -.IR mv (1) +.MR mv (1) will resolve the problem. .PP Boolean values appear as diff --git a/man/man4/srv.4 b/man/man4/srv.4 index 856f88ff..ae6a7634 100644 --- a/man/man4/srv.4 +++ b/man/man4/srv.4 @@ -22,7 +22,7 @@ srv, 9fs \- start network file service dials the given address and initializes the connection to serve the 9P protocol. It then posts the resulting connection in the current name space (see -.IR intro (4)) +.MR intro (4) ) as .I srvname (default @@ -70,7 +70,7 @@ available as service .IR sources . .I 9fs is an -.IR rc (1) +.MR rc (1) script; examine it to see what local conventions apply. .SH EXAMPLES List the root directory on @@ -98,6 +98,6 @@ sudo mount -t 9p -o trans=unix,uname=$USER,dfltuid=`id -u`,dfltgid=`id -g` .br .B \*9/bin/9fs .SH "SEE ALSO -.IR dial (3), -.IR intro (4), -.IR netfiles (1) +.MR dial (3) , +.MR intro (4) , +.MR netfiles (1) diff --git a/man/man4/tapefs.4 b/man/man4/tapefs.4 index 3297e2a4..669cc819 100644 --- a/man/man4/tapefs.4 +++ b/man/man4/tapefs.4 @@ -91,7 +91,7 @@ Tenth Edition research Unix systems (4KB block size). .PP .I Zipfs interprets zip archives (see -.IR gzip (1)). +.MR gzip (1) ). .SH SOURCE .PP These commands are constructed in a highly stereotyped @@ -103,7 +103,7 @@ in .BR \*9/src/cmd/tapefs , which in turn derive substantially from -.IR ramfs (4). +.MR ramfs (4) . .SH "SEE ALSO -.IR intro (7), -.IR ramfs (4). +.MR intro (7) , +.MR ramfs (4) . diff --git a/man/man4/vacfs.4 b/man/man4/vacfs.4 index 143e782b..f3287e35 100644 --- a/man/man4/vacfs.4 +++ b/man/man4/vacfs.4 @@ -26,7 +26,7 @@ vacfs \- a Venti-based file system .SH DESCRIPTION .I Vacfs interprets the file system created by -.IR vac (1) +.MR vac (1) so that it can be mounted into a Plan 9 file hierarchy. The data for the file system is stored on a Venti server with a root fingerprint specified in @@ -37,7 +37,7 @@ clients are not authenticated, and groups are assumed to contain a single member with the same name. These restrictions should eventually be removed. .PP -Options to +Options to .I vacfs are: .TP @@ -49,7 +49,7 @@ The network address of the Venti server. The default is taken from the environment variable .BR venti . If this variable does not exist, then the default is the -metaname +metaname .BR $venti . .\" which can be configured via .\" .IR ndb (6). @@ -81,5 +81,6 @@ The amount of memory, in bytes, allocated to the block cache. The default is 16M .SH SOURCE .B \*9/src/cmd/vac .SH "SEE ALSO" -.IR vac (1), -Plan 9's \fIventi\fR(8) +.MR vac (1) , +Plan 9's +.IR venti (8) diff --git a/man/man7/color.7 b/man/man7/color.7 index c8b536a0..917c2521 100644 --- a/man/man7/color.7 +++ b/man/man7/color.7 @@ -121,11 +121,11 @@ which is scaled so 0 represents fully transparent and 255 represents opaque colo The alpha is .I premultiplied into the other channels, as described in the paper by Porter and Duff cited in -.IR draw (3). +.MR draw (3) . The function .B setalpha (see -.IR allocimage (3)) +.MR allocimage (3) ) aids the initialization of color values with non-trivial alpha. .PP The packing of pixels into bytes and words is odd. @@ -138,13 +138,13 @@ the byte ordering is blue, green, red. .PP To maintain a constant external representation, the -.IR draw (3) +.MR draw (3) interface as well as the various graphics libraries represent colors by 32-bit numbers, as described in -.IR color (3). +.MR color (3) . .SH "SEE ALSO" -.IR color (3), -.IR graphics (3), -.IR draw (3) +.MR color (3) , +.MR graphics (3) , +.MR draw (3) diff --git a/man/man7/face.7 b/man/man7/face.7 index 08b04a46..8cd37825 100644 --- a/man/man7/face.7 +++ b/man/man7/face.7 @@ -25,13 +25,13 @@ per color)). The large files serve no special purpose; they are stored as images (see -.IR image (7)). +.MR image (7) ). The small files are the `icons' displayed by .B faces and .B seemail (see Plan 9's -\fIfaces\fR(1)); +.IR faces (1)); for depths less than 4, their format is special. .PP One- and two-bit deep icons are stored as text, one line of the file to one scan line @@ -110,6 +110,6 @@ which then appears as a domain name in the .B .dict files. .SH "SEE ALSO" -.IR mail (1), -.IR tweak (1), -.IR image (7) +.MR mail (1) , +.MR tweak (1) , +.MR image (7) diff --git a/man/man7/font.7 b/man/man7/font.7 index 45331d4d..c9ebb919 100644 --- a/man/man7/font.7 +++ b/man/man7/font.7 @@ -5,7 +5,7 @@ font, subfont \- external format for fonts and subfonts .B #include .SH DESCRIPTION Fonts and subfonts are described in -.IR cachechars (3). +.MR cachechars (3) . .PP External bitmap fonts are described by a plain text file that can be read using .IR openfont . @@ -21,7 +21,7 @@ with an optional starting position within the subfont, and the file name names an external file suitable for .I readsubfont (see -.IR graphics (3)). +.MR graphics (3) ). The minimum number of a covered range is mapped to the specified starting position (default zero) of the corresponding subfont. @@ -36,11 +36,11 @@ that can be read and written using and .I writesubfont (see -.IR subfont (3)). +.MR subfont (3) ). The format for subfont files is: an image containing character glyphs, followed by a subfont header, followed by character information. The image has the format for external image files described in -.IR image (7). +.MR image (7) . The subfont header has 3 decimal strings: .BR n , @@ -72,7 +72,7 @@ are irrelevant. .PP Note that the convention of using the character with value zero (NUL) to represent characters of zero width (see -.IR draw (3)) +.MR draw (3) ) means that fonts should have, as their zeroth character, one with non-zero width. .SS "Font Names @@ -121,7 +121,7 @@ The command .B . lists the available fonts. See -.IR fontsrv (4) +.MR fontsrv (4) for more. .PP If the font name has the form @@ -136,7 +136,7 @@ The Plan 9 bitmap fonts were designed for screens with pixel density around 100 When used on screens with pixel density above 200 DPI, the bitmap fonts are automatically pixel doubled. Similarly, fonts loaded from -.IR fontsrv (4) +.MR fontsrv (4) are automatically doubled in size by varying the effective .I size path element. @@ -184,7 +184,7 @@ a system-installed vector font on high-density displays: .B \*9/font/* font directories .SH "SEE ALSO" -.IR graphics (3), -.IR draw (3), -.IR cachechars (3), -.IR subfont (3) +.MR graphics (3) , +.MR draw (3) , +.MR cachechars (3) , +.MR subfont (3) diff --git a/man/man7/htmlroff.7 b/man/man7/htmlroff.7 index e908c3ff..34f2cc5b 100644 --- a/man/man7/htmlroff.7 +++ b/man/man7/htmlroff.7 @@ -2,7 +2,7 @@ .SH NAME htmlroff \- HTML formatting and typesetting .SH DESCRIPTION -.IR Htmlroff (1) +.MR Htmlroff (1) accepts .I troff input with a few extensions and changes. @@ -200,7 +200,7 @@ inside .B tags. This heuristic handles simple equations formatted by -.IR eqn (1). +.MR eqn (1) . .SS Conditional input .PP To make it easier to write input files that can be formatted by both @@ -315,7 +315,7 @@ For example, redefines the .B PS macro that marks the beginning of a -.IR pic (1) +.MR pic (1) picture: .IP .EX diff --git a/man/man7/image.7 b/man/man7/image.7 index 6e613f9c..bfb299bd 100644 --- a/man/man7/image.7 +++ b/man/man7/image.7 @@ -5,9 +5,9 @@ image \- external format for images .B #include .SH DESCRIPTION Images are described in -.IR graphics (3), +.MR graphics (3) , and the definition of pixel values is in -.IR color (7). +.MR color (7) . Fonts and images are stored in external files in machine-independent formats. .PP @@ -21,7 +21,7 @@ and and .B writememimage (see -.IR memdraw (3)). +.MR memdraw (3) ). An uncompressed image file starts with 5 strings: .BR chan , @@ -34,10 +34,10 @@ Each is right-justified and blank padded in 11 characters, followed by a blank. The .B chan value is a textual string describing the pixel format -(see +(see .B strtochan in -.IR graphics (3) +.MR graphics (3) and the discussion of channel descriptors below), and the rectangle coordinates are decimal strings. The rest of the file contains the @@ -49,7 +49,7 @@ consists of the byte containing pixel .B r.min.x and all the bytes up to and including the byte containing pixel .BR r.max.x -1. -For images with depth +For images with depth .I d less than eight, a pixel with x-coordinate = .I x @@ -73,11 +73,11 @@ The and .B unloadimage functions described in -.IR allocimage (3) +.MR allocimage (3) also deal with rows in this format, stored in user memory. .PP The channel format string is a sequence of two-character channel descriptions, -each comprising a letter +each comprising a letter .RB ( r for red, .B g @@ -95,10 +95,10 @@ and for ``don't care'') followed by a number of bits per pixel. The sum of the channel bits per pixel is the -depth of the image, which must be either +depth of the image, which must be either a divisor or a multiple of eight. It is an error to have more than -one of any channel but +one of any channel but .BR x . An image must have either a greyscale channel; a color mapped channel; or red, green, and blue channels. @@ -110,13 +110,13 @@ In particular .B 'r8g8b8' pixels have byte ordering blue, green, and red within the file. See -.IR color (7) +.MR color (7) for more details of the pixel format. .PP A venerable yet deprecated format replaces the channel string with a decimal .IR ldepth , -which is the base two logarithm of the number +which is the base two logarithm of the number of bits per pixel in the image. In this case, .IR ldepth s @@ -177,9 +177,9 @@ Some small images, in particular 48\(mu48 face files as used by .I seemail (see Plan 9's -\fIfaces\fR(1) +.IR faces (1) and -.IR face (7)) +.MR face (7) ) and 16\(mu16 cursors, can be stored textually, suitable for inclusion in C source. Each line of text represents one scan line as a @@ -188,18 +188,18 @@ bytes, shorts, or words in C format. For cursors, each line defines a pair of bytes. (It takes two images to define a cursor; each must be stored separately to be processed by programs such as -.IR tweak (1).) +.MR tweak (1) .) Face files of one bit per pixel are stored as a sequence of shorts, those of larger pixel sizes as a sequence of longs. Software that reads these files must deduce the image size from the input; there is no header. These formats reflect history rather than design. .SH "SEE ALSO" -.IR jpg (1), -.IR tweak (1), -.IR graphics (3), -.IR draw (3), -.IR allocimage (3), -.IR color (7), -.IR face (7), -.IR font (7) +.MR jpg (1) , +.MR tweak (1) , +.MR graphics (3) , +.MR draw (3) , +.MR allocimage (3) , +.MR color (7) , +.MR face (7) , +.MR font (7) diff --git a/man/man7/keyboard.7 b/man/man7/keyboard.7 index 07bfb960..69094a22 100644 --- a/man/man7/keyboard.7 +++ b/man/man7/keyboard.7 @@ -49,15 +49,15 @@ in particular, control-J is a line feed and control-M a carriage return. .PP The down arrow, used by -.IR 9term (1), -.IR acme (1), +.MR 9term (1) , +.MR acme (1) , and -.IR sam (1), +.MR sam (1) , causes windows to scroll forward. The up arrow scrolls backward. .PP Characters in Plan 9 are runes (see -.IR utf (7)). +.MR utf (7) ). Any rune can be typed using a compose key followed by several other keys. The compose key is also generally near the lower right of the main key area: @@ -92,11 +92,11 @@ the compose key followed by a two- or three-character sequence. The full list is too long to repeat here, but is contained in the file .L \*9/lib/keyboard in a format suitable for -.IR grep (1) +.MR grep (1) or -.IR look (1). +.MR look (1) . To add a sequence, edit that file and then rebuild -.IR devdraw (1). +.MR devdraw (1) . .PP There are several rules guiding the design of the sequences, as illustrated by the following examples. @@ -235,10 +235,10 @@ to run them automatically at startup. sorted table of characters and keyboard sequences .PD .SH "SEE ALSO" -.IR intro (1), -.IR ascii (1), -.IR tcs (1), -.IR 9term (1), -.IR acme (1), -.IR sam (1), -.IR utf (7) +.MR intro (1) , +.MR ascii (1) , +.MR tcs (1) , +.MR 9term (1) , +.MR acme (1) , +.MR sam (1) , +.MR utf (7) diff --git a/man/man7/man.7 b/man/man7/man.7 index 0e2b52ba..f82a1bc7 100644 --- a/man/man7/man.7 +++ b/man/man7/man.7 @@ -82,9 +82,9 @@ font- or size-setting macros. The .B -man macros admit equations and tables in the style of -.IR eqn (1) +.MR eqn (1) and -.IR tbl (1), +.MR tbl (1) , but do not support arguments on .B .EQ and @@ -113,7 +113,7 @@ The root directory of the Plan 9 installation. .B \*9/tmac/tmac.antimes .SH SEE ALSO .IR troff (1), -.IR man (1) +.MR man (1) .SH REQUESTS .ta \w'.TH n c x 'u +\w'Cause 'u +\w'Argument\ 'u .di xx diff --git a/man/man7/map.7 b/man/man7/map.7 index 80e1eebf..ced8db49 100644 --- a/man/man7/map.7 +++ b/man/man7/map.7 @@ -80,7 +80,7 @@ in the map file. Both the map file and the index file are ordered by patch latitude and longitude. .SH "SEE ALSO" -.IR map (7) +.MR map (7) .br The data comes from the World Data Bank I and II and U.S. Government sources: the Census Bureau, Geological diff --git a/man/man7/mhtml.7 b/man/man7/mhtml.7 index dcf49868..f561fb43 100644 --- a/man/man7/mhtml.7 +++ b/man/man7/mhtml.7 @@ -19,14 +19,14 @@ mhtml \- macros for formatting HTML \&... .SH DESCRIPTION This package of -.IR htmlroff (1) +.MR htmlroff (1) macro definitions provides convenient macros for formatting HTML. It is usually used along with -.IR troff (1) +.MR troff (1) macro packages such as -.IR man (7) +.MR man (7) and -.IR ms (7). +.MR ms (7) . .I Mhtml replaces some macros defined in the other packages, so it should be listed after them on the @@ -64,7 +64,7 @@ before invoking Accumulate footnotes and print them at the end of the document under a \fBNotes\fP heading. These replace the macros in -.IR ms (7). +.MR ms (7) . To emit the notes accumulated so far, invoke .BR .NOTES . .TP @@ -75,7 +75,7 @@ and .B .PE with a PNG image corresponding to the output of running -.IR troff (1) +.MR troff (1) on the input. .TP .B .TS\fR, \fP.TE @@ -100,6 +100,6 @@ percent of the current output width. .SH FILES .B \*9/tmac/tmac.html .SH SEE ALSO -.IR htmlroff (1), -.IR htmlroff (7), -.IR ms (7) +.MR htmlroff (1) , +.MR htmlroff (7) , +.MR ms (7) diff --git a/man/man7/mpictures.7 b/man/man7/mpictures.7 index d6dbf964..5da1d547 100644 --- a/man/man7/mpictures.7 +++ b/man/man7/mpictures.7 @@ -10,7 +10,7 @@ mpictures \- picture inclusion macros .SH DESCRIPTION .I Mpictures macros insert PostScript pictures into -.IR troff (1) +.MR troff (1) documents. The macros are: .TP @@ -129,7 +129,7 @@ comment is present, the picture is assumed to fill an 8.5\(mu11-inch page. Nothing prevents the picture from being placed off the page. .SH SEE ALSO -.IR troff (1) +.MR troff (1) .SH DIAGNOSTICS A picture file that can't be read by the PostScript postprocessor is replaced by white space. diff --git a/man/man7/ms.7 b/man/man7/ms.7 index 931dad1b..5886a7e1 100644 --- a/man/man7/ms.7 +++ b/man/man7/ms.7 @@ -18,7 +18,7 @@ ms \- macros for formatting manuscripts This package of .I nroff and -.IR troff (1) +.MR troff (1) macro definitions provides a canned formatting facility for tech%nical papers in various formats. .PP @@ -38,11 +38,11 @@ impunity after the first .LR .na . .PP Output of the -.IR eqn (1), -.IR tbl (1), -.IR pic (1) +.MR eqn (1) , +.MR tbl (1) , +.MR pic (1) and -.IR grap (1) +.MR grap (1) preprocessors for equations, tables, pictures, and graphs is acceptable as input. .SH FILES @@ -57,8 +57,8 @@ Tenth Edition, Volume 2. .br .IR eqn (1), .IR troff (1), -.IR tbl (1), -.IR pic (1) +.MR tbl (1) , +.MR pic (1) .SH REQUESTS .ta \w'..ND \fIdate\fR 'u +\w'Initial 'u +\w'Cause 'u .br @@ -153,7 +153,7 @@ Implies produced by .I neqn or -.IR eqn (1). +.MR eqn (1) . .ti0 \fL\&.EQ\fP \fIx y\fR - yes Display equation. Equation number is @@ -234,7 +234,7 @@ is subsection level (default 1). \fL\&.P2\fP - yes End program display. .ti0 \fL\&.PE\fP - yes End picture; see -.IR pic (1). +.MR pic (1) . .ti0 \fL\&.PF\fP - yes End picture; restore vertical position. @@ -280,7 +280,7 @@ font automatically bold. Default is 5 10 15 ... .ti0 \fL\&.TE\fP - yes End table; see -.IR tbl (1). +.MR tbl (1) . .ti0 \fL\&.TH\fP - yes End heading section of table. .ti0 diff --git a/man/man7/ndb.7 b/man/man7/ndb.7 index 4387f99d..bb59d8aa 100644 --- a/man/man7/ndb.7 +++ b/man/man7/ndb.7 @@ -59,7 +59,7 @@ Within tuples, pairs on the same line bind tighter than pairs on different lines. .PP Programs search the database directly using the routines in -.IR ndb (3). +.MR ndb (3) . .\" or indirectly using .\" .B ndb/cs .\" and @@ -292,8 +292,8 @@ tcp=9fs port=564 first database file searched .SH "SEE ALSO" .\" .IR dial (2), -.IR ndb (1), -.IR ndb (3) +.MR ndb (1) , +.MR ndb (3) .\" .IR dhcpd (8), .\" .IR ipconfig (8), .\" .IR con (1) diff --git a/man/man7/plot.7 b/man/man7/plot.7 index d4550f51..87308b3f 100644 --- a/man/man7/plot.7 +++ b/man/man7/plot.7 @@ -340,4 +340,4 @@ Restore previous environment. .PD .SH "SEE ALSO" .IR plot (1), -.IR graph (1) +.MR graph (1) diff --git a/man/man7/plumb.7 b/man/man7/plumb.7 index fd30ee04..37b2385b 100644 --- a/man/man7/plumb.7 +++ b/man/man7/plumb.7 @@ -6,7 +6,7 @@ plumb \- format of plumb messages and rules .SH DESCRIPTION .SS "Message format The messages formed by the -.IR plumb (3) +.MR plumb (3) library are formatted for transmission between processes into textual form, using newlines to separate the fields. @@ -61,7 +61,7 @@ A missing field is represented by an empty line. The .B plumber (see -.IR plumb (1)) +.MR plumb (1) ) receives messages on its .B send port (applications @@ -271,7 +271,7 @@ rule should be specified in a rule set. .RE .PP The arguments to all rules may contain quoted strings, exactly as in -.IR rc (1). +.MR rc (1) . They may also contain simple string variables, identified by a leading dollar sign .BR $ . Variables may be set, between rule sets, by assignment statements in the style of @@ -341,7 +341,7 @@ field of the message. .B $plan9 The root directory of the Plan 9 tree (see -.IR get9root (3)). +.MR get9root (3) ). .RE .SH EXAMPLE The following is a modest, representative file of plumbing rules. @@ -403,7 +403,7 @@ default rules file. .TP .B plumb service name for -.IR plumber (4). +.MR plumber (4) . .TP .B \*9/plumb directory for @@ -416,7 +416,7 @@ public macro definitions. .B \*9/plumb/basic basic rule set. .SH "SEE ALSO" -.IR plumb (1), -.IR plumb (3), -.IR plumber (4), -.IR regexp (7) +.MR plumb (1) , +.MR plumb (3) , +.MR plumber (4) , +.MR regexp (7) diff --git a/man/man7/regexp.7 b/man/man7/regexp.7 index 91e73adc..73fd4dde 100644 --- a/man/man7/regexp.7 +++ b/man/man7/regexp.7 @@ -4,9 +4,9 @@ regexp \- Plan 9 regular expression notation .SH DESCRIPTION This manual page describes the regular expression syntax used by the Plan 9 regular expression library -.IR regexp (3). +.MR regexp (3) . It is the form used by -.IR egrep (1) +.MR egrep (1) before .I egrep got complicated. @@ -130,4 +130,4 @@ A match to any part of a regular expression extends as far as possible without preventing a match to the remainder of the regular expression. .SH "SEE ALSO" -.IR regexp (3) +.MR regexp (3) diff --git a/man/man7/thumbprint.7 b/man/man7/thumbprint.7 index 743172de..5a4b933b 100644 --- a/man/man7/thumbprint.7 +++ b/man/man7/thumbprint.7 @@ -9,7 +9,7 @@ for example by calling and .B okThumbprint (see -.IR pushtls (3)), +.MR pushtls (3) ), check the remote side's public key by comparing against thumbprints from a trusted list. The list is maintained by people who set local policies @@ -38,4 +38,4 @@ For example, a web server might have thumbprint x509 sha1=8fe472d31b360a8303cd29f92bd734813cbd923c cn=*.cs.bell-labs.com .EE .SH "SEE ALSO" -.IR pushtls (3) +.MR pushtls (3) diff --git a/man/man7/utf.7 b/man/man7/utf.7 index a2409457..5ad61764 100644 --- a/man/man7/utf.7 +++ b/man/man7/utf.7 @@ -57,7 +57,7 @@ in order to work properly with non-\c .SM ASCII input. See -.IR rune (3). +.MR rune (3) . .PP Letting numbers be binary, a rune x is converted to a multibyte @@ -85,7 +85,7 @@ In the inverse mapping, any sequence except those described above is incorrect and is converted to rune hexadecimal 0080. .SH "SEE ALSO" -.IR ascii (1), -.IR tcs (1), -.IR rune (3), +.MR ascii (1) , +.MR tcs (1) , +.MR rune (3) , .IR "The Unicode Standard" . diff --git a/man/man7/venti.7 b/man/man7/venti.7 index 382bf67b..800c85f3 100644 --- a/man/man7/venti.7 +++ b/man/man7/venti.7 @@ -14,19 +14,19 @@ of clients. This manual page documents the basic concepts of block storage using Venti as well as the Venti network protocol. .PP -.IR Venti (1) +.MR Venti (1) documents some simple clients. -.IR Vac (1), -.IR vacfs (4), +.MR Vac (1) , +.MR vacfs (4) , and -.IR vbackup (8) +.MR vbackup (8) are more complex clients. .PP -.IR Venti (3) +.MR Venti (3) describes a C library interface for accessing Venti servers and manipulating Venti data structures. .PP -.IR Venti (8) +.MR Venti (8) describes the programs used to run a Venti server. .PP .SS "Scores @@ -40,11 +40,11 @@ Scores may have an optional prefix, typically used to describe the format of the data. For example, -.IR vac (1) +.MR vac (1) uses a .B vac: prefix, while -.IR vbackup (8) +.MR vbackup (8) uses prefixes corresponding to the file system types: .BR ext2: , @@ -93,7 +93,7 @@ Keeping this parallel representation is a minor annoyance but makes it possible for general programs like .I venti/copy (see -.IR venti (1)) +.MR venti (1) ) to traverse the block tree without knowing the specific details of any particular program's data. .SS "Block Types @@ -202,7 +202,7 @@ Text strings are represented similarly, using a two-byte count with the text itself stored as a UTF-encoded sequence of Unicode characters (see -.IR utf (7)). +.MR utf (7) ). Text strings are not .SM NUL\c -terminated: @@ -395,7 +395,7 @@ Use and .I vtfromdisktype (see -.IR venti (3)) +.MR venti (3) ) to convert a block type enumeration value .RB ( VtDataType , etc.) @@ -457,9 +457,9 @@ in the packet may be either 2 or 4 bytes; the total packet length distinguishes the two cases. .SH SEE ALSO -.IR venti (1), -.IR venti (3), -.IR venti (8) +.MR venti (1) , +.MR venti (3) , +.MR venti (8) .br Sean Quinlan and Sean Dorward, ``Venti: a new approach to archival storage'', diff --git a/man/man8/fossilcons.8 b/man/man8/fossilcons.8 index b59b6b6a..8ad9d4be 100644 --- a/man/man8/fossilcons.8 +++ b/man/man8/fossilcons.8 @@ -340,7 +340,7 @@ con /srv/fscons .SH DESCRIPTION These are configuration and maintenance commands executed at the console of a -.IR fossil (4) +.MR fossil (4) file server. The commands are split into three groups above: file server configuration, @@ -372,11 +372,11 @@ a file in any file system served by .I 9p executes a 9P transaction; the arguments are in the same format used by -.IR 9pcon (8). +.MR 9pcon (8) . .PP .I Bind behaves similarly to -.IR bind (1). +.MR bind (1) . It is useful when fossil is started without devices it needs configured into its namespace. @@ -389,7 +389,7 @@ standard error. .PP .I Echo behaves identically to -.IR echo (1), +.MR echo (1) , writing to the console. .PP .I Listen @@ -492,7 +492,7 @@ the string used to represent this user in the 9P protocol .TP .I leader the group's leader (see Plan 9's -.IR stat (5) +.MR stat (5) for a description of the special privileges held by a group leader) .TP .I members @@ -821,7 +821,7 @@ removing a non-empty directory. A subsequent .I flchk (see -.IR fossil (4)) +.MR fossil (4) ) will identify the abandoned storage so it can be reclaimed with .I bfree commands. @@ -1013,7 +1013,7 @@ takes a temporary snapshot of the current file system, recording it in .BI /snapshot/ yyyy / mmdd / hhmm \fR, as described in -.IR fossil (4). +.MR fossil (4) . The .B -a flag causes @@ -1021,7 +1021,7 @@ flag causes to take an archival snapshot, recording it in .BI /archive/ yyyy / mmdd \fR, also described in -.IR fossil (4). +.MR fossil (4) . By default the snapshot is taken of .BR /active , the root of the active file system. @@ -1132,7 +1132,7 @@ writes dirty blocks in memory to the disk. .PP .I Vac prints the Venti score for a -.IR vac (1) +.MR vac (1) archive containing the tree rooted at .IR dir , diff --git a/man/man8/getflags.8 b/man/man8/getflags.8 index 86c295b9..776a17aa 100644 --- a/man/man8/getflags.8 +++ b/man/man8/getflags.8 @@ -16,7 +16,7 @@ not take arguments, or a letter followed by the space-separated names of its arguments. .I Getflags prints an -.IR rc (1) +.MR rc (1) script on standard output which initializes the environment variable .BI $flag x @@ -51,15 +51,15 @@ and .BR $0 , the program name (see -.IR rc (1)). +.MR rc (1) ). If run under -.IR sh (1), +.MR sh (1) , which does not set .BR $0 , the program name must be given explicitly on the command line. .SH EXAMPLE Parse the arguments for Plan 9's -.IR leak (1): +.MR leak (1) : .IP .EX flagfmt='b,s,f binary,r res,x width' @@ -74,4 +74,4 @@ if(! ifs=() eval `{getflags $*} || ~ $#* 0){ .br .B \*9/src/cmd/usage.c .SH SEE ALSO -.IR arg (3) +.MR arg (3) diff --git a/man/man8/listen1.8 b/man/man8/listen1.8 index 534766bf..98f560f3 100644 --- a/man/man8/listen1.8 +++ b/man/man8/listen1.8 @@ -17,9 +17,7 @@ listen1 \- listen for calls on a network device .I Listen1 is a lightweight listener intended for personal use, modeled from Inferno's -.\" write out this way so automatic programs -.\" don't try to make it into a real man page reference. -\fIlisten\fR(1). +.IR listen (1). It announces on .IR address , @@ -28,7 +26,7 @@ running .I args... for each incoming connection; the network directory is passed in the environment -as +as .BR $net . The .B -v @@ -36,4 +34,4 @@ flag causes verbose logging on standard output. .SH SOURCE .B \*9/src/cmd/listen1.c .SH "SEE ALSO" -.IR dial (3) +.MR dial (3) diff --git a/man/man8/mkfs.8 b/man/man8/mkfs.8 index 2eaba6c1..073e55b2 100644 --- a/man/man8/mkfs.8 +++ b/man/man8/mkfs.8 @@ -34,7 +34,7 @@ copies files from the file tree to a .B kfs file system (see -.IR kfs (4)). +.MR kfs (4) ). The kfs service is mounted on .I root (default @@ -47,7 +47,7 @@ The .I proto files are read (see -.IR proto (2) +.MR proto (2) for their format) and any files specified in them that are out of date are copied to .BR /n/kfs . @@ -183,5 +183,5 @@ disk/mkext -u -d /n/newfs < arch .br .B \*9/src/cmd/disk/mkext.c .SH "SEE ALSO" -.IR prep (8), -.IR tar (1) +.MR prep (8) , +.MR tar (1) diff --git a/man/man8/vbackup.8 b/man/man8/vbackup.8 index 26ab9178..fa201f40 100644 --- a/man/man8/vbackup.8 +++ b/man/man8/vbackup.8 @@ -70,7 +70,7 @@ back up Unix file systems to Venti .SH DESCRIPTION These programs back up and restore standard Unix file system images stored in -.IR venti (8). +.MR venti (8) . Images stored in .I venti are named by @@ -102,7 +102,7 @@ The argument .I disk should be a disk or disk partition device that would be appropriate to pass to -.IR mount (8). +.MR mount (8) . .PP The optional argument .I score @@ -135,7 +135,7 @@ The default is the name returned by .I sysname (see -.IR getuser (3)). +.MR getuser (3) ). The default .I mtpt is the place where @@ -149,7 +149,7 @@ command. The default is the name returned by .I sysname (see -.IR getuser (3)). +.MR getuser (3) ). .TP .B -n No-op mode: do not write any blocks to the server @@ -207,7 +207,7 @@ to zero unused blocks instead. .PP .I Vftp presents an -.IR ftp (1)-like +.MR ftp (1) -like interface to a physical or backed-up disk image. It is used mainly for debugging. Type @@ -228,7 +228,7 @@ must be run by the user Because .I address is passed to the host OS kernel rather than interpreted by -.IR dial (3), +.MR dial (3) , it must be only an IP address, not a full dial address. .PP .I Vnfs diff --git a/man/man8/venti-backup.8 b/man/man8/venti-backup.8 index 10614a50..131514c6 100644 --- a/man/man8/venti-backup.8 +++ b/man/man8/venti-backup.8 @@ -104,8 +104,8 @@ for a version that does this. .SH SOURCE .B \*9/src/cmd/venti/srv .SH SEE ALSO -.IR venti (7), -.IR venti (8) +.MR venti (7) , +.MR venti (8) .SH BUGS .I Wrarena can't read a pipe or network connection containing an arena; diff --git a/man/man8/venti-fmt.8 b/man/man8/venti-fmt.8 index 7c44754f..39906862 100644 --- a/man/man8/venti-fmt.8 +++ b/man/man8/venti-fmt.8 @@ -99,9 +99,9 @@ syncindex \- prepare and maintain a venti server These commands aid in the setup, maintenance, and debugging of venti servers. See -.IR venti (7) +.MR venti (7) for an overview of the venti system and -.IR venti (8) +.MR venti (8) for an overview of the data structures used by the venti server. .PP Note that the units for the various sizes in the following @@ -195,7 +195,7 @@ formats the given .I file as a Bloom filter (see -.IR venti (7)). +.MR venti (7) ). The options are: .TF "\fL-s\fI size" .PD @@ -264,7 +264,7 @@ overflow. The total size of the index should be about 2% to 10% of the total size of the arenas, but the exact percentage depends both on the index block size and the compressed size of blocks stored. See the discussion in -.IR venti (8) +.MR venti (8) for more. .PP .I Fmtindex @@ -401,8 +401,8 @@ Increase the verbosity of output. .SH SOURCE .B \*9/src/cmd/venti/srv .SH SEE ALSO -.IR venti (7), -.IR venti (8) +.MR venti (7) , +.MR venti (8) .SH BUGS .I Buildindex should allow an individual index section to be rebuilt. diff --git a/man/man8/venti.8 b/man/man8/venti.8 index 4fd40df6..6a6d53e0 100644 --- a/man/man8/venti.8 +++ b/man/man8/venti.8 @@ -40,7 +40,7 @@ venti \- archival storage server .I Venti is a SHA1-addressed archival storage server. See -.IR venti (7) +.MR venti (7) for a full introduction to the system. This page documents the structure and operation of the server. .PP @@ -138,7 +138,7 @@ less than 10 are not very useful; greater than 24 are probably a waste of memory. .I Fmtbloom (see -.IR venti-fmt (8)) +.MR venti-fmt (8) ) can be given either .I nhash or @@ -220,7 +220,7 @@ The venti server announces two network services, one .BR venti , 17034) serving the venti protocol as described in -.IR venti (7), +.MR venti (7) , and one serving HTTP (conventionally TCP port .BR http , @@ -333,7 +333,7 @@ with or .I fmtisect (see -.IR venti-fmt (8)). +.MR venti-fmt (8) ). In particular, only the configuration needs to be changed if a component is moved to a different file. .PP @@ -506,11 +506,11 @@ Start the server and check the storage statistics: .SH SOURCE .B \*9/src/cmd/venti/srv .SH "SEE ALSO" -.IR venti (1), -.IR venti (3), -.IR venti (7), -.IR venti-backup (8) -.IR venti-fmt (8) +.MR venti (1) , +.MR venti (3) , +.MR venti (7) , +.MR venti-backup (8) +.MR venti-fmt (8) .br Sean Quinlan and Sean Dorward, ``Venti: a new approach to archival storage'', @@ -523,7 +523,7 @@ Venti should not require the user to decide how to partition its memory usage. .PP Users of shells other than -.IR rc (1) +.MR rc (1) will not be able to use the program names shown. One solution is to define .B "V=$PLAN9/bin/venti" diff --git a/man/man9/0intro.9p b/man/man9/0intro.9p index 397486f8..30e153a1 100644 --- a/man/man9/0intro.9p +++ b/man/man9/0intro.9p @@ -21,7 +21,7 @@ such a machine is called, somewhat confusingly, a Another possibility for a server is to synthesize files on demand, perhaps based on information on data structures maintained in memory; the -.IR plumber (4) +.MR plumber (4) server is an example of such a server. .PP A @@ -63,7 +63,7 @@ bytes of data. Text strings are represented this way, with the text itself stored as a UTF-8 encoded sequence of Unicode characters (see -.IR utf (7)). +.MR utf (7) ). Text strings in 9P messages are not .SM NUL\c -terminated: @@ -114,7 +114,7 @@ Plan 9 names may contain any printable character (that is, any character outside hexadecimal 00-1F and 80-9F) except slash.) Messages are transported in byte form to allow for machine independence; -.IR fcall (3) +.MR fcall (3) describes routines that convert to and from this form into a machine-dependent C structure. .SH MESSAGES @@ -348,7 +348,7 @@ a ``current file'' on the server. Fids are somewhat like file descriptors in a user process, but they are not restricted to files open for I/O: directories being examined, files being accessed by -.IR stat (3) +.MR stat (3) calls, and so on \(em all files being manipulated by the operating system \(em are identified by fids. Fids are chosen by the client. @@ -461,7 +461,7 @@ to have their input or output attached to fids on 9P servers. See .IR openfd (9p) and -.IR 9pclient (3) +.MR 9pclient (3) for details. .PP The @@ -475,7 +475,7 @@ access permissions (read, write and execute for owner, group and public), access and modification times, and owner and group identifications (see -.IR stat (3)). +.MR stat (3) ). The owner and group identifications are textual names. The .B wstat @@ -523,12 +523,12 @@ into 9P messages. .SS Unix On Unix, 9P services are posted as Unix domain sockets in a well-known directory (see -.IR getns (3) +.MR getns (3) and -.IR 9pserve (4)). +.MR 9pserve (4) ). Clients connect to these servers using a 9P client library (see -.IR 9pclient (3)). +.MR 9pclient (3) ). .SH DIRECTORIES Directories are created by .B create diff --git a/man/man9/attach.9p b/man/man9/attach.9p index ddcf7476..4160f30d 100644 --- a/man/man9/attach.9p +++ b/man/man9/attach.9p @@ -122,7 +122,7 @@ and and .I fsauth (see -.IR 9pclient (3)) +.MR 9pclient (3) ) generate .B attach and @@ -163,6 +163,6 @@ transactions. .\" .B mount .\" system call on an uninitialized connection. .SH SEE ALSO -.IR 9pclient (3), +.MR 9pclient (3) , .IR version (9P), Plan 9's \fIauthsrv\fR(6) diff --git a/man/man9/clunk.9p b/man/man9/clunk.9p index ef3ecdc4..f014ac42 100644 --- a/man/man9/clunk.9p +++ b/man/man9/clunk.9p @@ -41,7 +41,7 @@ generated by and .I fsunmount (see -.IR 9pclient (3)) +.MR 9pclient (3) ) and indirectly by other actions such as failed .I fsopen calls. diff --git a/man/man9/flush.9p b/man/man9/flush.9p index 9d3ea267..862ab9a4 100644 --- a/man/man9/flush.9p +++ b/man/man9/flush.9p @@ -99,11 +99,11 @@ flushing a and flushing an invalid tag. .SH ENTRY POINTS The -.IR 9pclient (3) +.MR 9pclient (3) library does not generate .B flush transactions.. -.IR 9pserve (4) +.MR 9pserve (4) generates .B flush transactions to cancel transactions pending when a client hangs up. diff --git a/man/man9/open.9p b/man/man9/open.9p index b8ed973a..8a54f72c 100644 --- a/man/man9/open.9p +++ b/man/man9/open.9p @@ -160,7 +160,7 @@ in this case, the .I fscreate call (see -.IR 9pclient (3)) +.MR 9pclient (3) ) uses .B open with truncation. @@ -209,7 +209,7 @@ again. and .I fscreate (see -.IR 9pclient (3)) +.MR 9pclient (3) ) both generate .B open messages; only diff --git a/man/man9/openfd.9p b/man/man9/openfd.9p index 89aa254f..620b1991 100644 --- a/man/man9/openfd.9p +++ b/man/man9/openfd.9p @@ -43,18 +43,18 @@ it cannot be .PP .I Openfd is implemented by -.IR 9pserve (4). +.MR 9pserve (4) . 9P servers that post their services using -.IR 9pserve (4) +.MR 9pserve (4) (or indirectly via -.IR post9pservice (3)) +.MR post9pservice (3) ) will never see a .B Topenfd message. .SH ENTRY POINTS .I Fsopenfd (see -.IR 9pclient (3)) +.MR 9pclient (3) ) generates an .B openfd message. diff --git a/man/man9/read.9p b/man/man9/read.9p index a68f153e..675bb773 100644 --- a/man/man9/read.9p +++ b/man/man9/read.9p @@ -114,7 +114,7 @@ to be transferred atomically. and .I fswrite (see -.IR 9pclient (3)) +.MR 9pclient (3) ) generate the corresponding messages. Because they take an offset parameter, the .I fspread diff --git a/man/man9/remove.9p b/man/man9/remove.9p index a9a844a1..232c88f6 100644 --- a/man/man9/remove.9p +++ b/man/man9/remove.9p @@ -45,7 +45,7 @@ so other fids typically remain usable. .SH ENTRY POINTS .I Fsremove (see -.IR 9pclient (3)) +.MR 9pclient (3) ) generates .B remove messages. diff --git a/man/man9/stat.9p b/man/man9/stat.9p index ab68133d..7706d3eb 100644 --- a/man/man9/stat.9p +++ b/man/man9/stat.9p @@ -88,7 +88,7 @@ The and .I convD2M routines (see -.IR fcall (3)) +.MR fcall (3) ) convert between directory entries and a C structure called a .BR Dir . .PP @@ -263,7 +263,7 @@ messages are generated by and .IR fsdirstat (see -.IR 9pclient (3)). +.MR 9pclient (3) ). .PP .B Wstat messages are generated by diff --git a/man/man9/version.9p b/man/man9/version.9p index c4961217..c71ee556 100644 --- a/man/man9/version.9p +++ b/man/man9/version.9p @@ -91,7 +91,7 @@ requests is called a .SH ENTRY POINTS .I Fsversion (see -.IR 9pclient (3)) +.MR 9pclient (3) ) generates .B version messages; diff --git a/man/man9/walk.9p b/man/man9/walk.9p index 49777f21..735b7dcb 100644 --- a/man/man9/walk.9p +++ b/man/man9/walk.9p @@ -149,13 +149,13 @@ may be packed in a single message. This constant is called .B MAXWELEM in -.IR fcall (3). +.MR fcall (3) . Despite this restriction, the system imposes no limit on the number of elements in a file name, only the number that may be transmitted in a single message. .SH ENTRY POINTS .I Fswalk (see -.IR 9pclient (3)) +.MR 9pclient (3) ) generates walk messages. One or more walk messages may be generated by any call that evaluates file names: diff --git a/src/cmd/9p.c b/src/cmd/9p.c index 75511a19..a5b97f85 100644 --- a/src/cmd/9p.c +++ b/src/cmd/9p.c @@ -302,8 +302,10 @@ void xrdwr(int argc, char **argv) { char buf[4096]; + char *p; int n; CFid *fid; + Biobuf *b; ARGBEGIN{ default: @@ -313,6 +315,8 @@ xrdwr(int argc, char **argv) if(argc != 1) usage(); + if((b = Bfdopen(0, OREAD)) == nil) + sysfatal("out of memory"); fid = xopen(argv[0], ORDWR); for(;;){ fsseek(fid, 0, 0); @@ -322,15 +326,15 @@ xrdwr(int argc, char **argv) if(write(1, buf, n) < 0 || write(1, "\n", 1) < 0) sysfatal("write error: %r"); } - n = read(0, buf, sizeof buf); - if(n <= 0) + if((p = Brdstr(b, '\n', 1)) == nil) break; - if(buf[n-1] == '\n') - n--; - if(fswrite(fid, buf, n) != n) + n = strlen(p); + if(fswrite(fid, p, n) != n) fprint(2, "write: %r\n"); + free(p); } fsclose(fid); + Bterm(b); threadexitsall(0); } diff --git a/src/cmd/9pfuse/fuse.c b/src/cmd/9pfuse/fuse.c index 4c9aac9b..ea8e3bbf 100644 --- a/src/cmd/9pfuse/fuse.c +++ b/src/cmd/9pfuse/fuse.c @@ -798,16 +798,19 @@ mountfuse(char *mtpt) } return fd; #elif defined(__APPLE__) - int i, pid, fd, r; + int i, pid, fd, r, p[2]; char buf[20]; struct vfsconf vfs; char *f, *v; if(getvfsbyname(v="osxfusefs", &vfs) < 0 && + getvfsbyname(v="macfuse", &vfs) < 0 && getvfsbyname(v="osxfuse", &vfs) < 0 && getvfsbyname(v="fusefs", &vfs) < 0){ if(access((v="osxfusefs", f="/Library/Filesystems/osxfusefs.fs" "/Support/load_osxfusefs"), 0) < 0 && + access((v="macfuse", f="/Library/Filesystems/macfuse.fs" + "/Contents/Resources/load_macfuse"), 0) < 0 && access((v="osxfuse", f="/Library/Filesystems/osxfuse.fs" "/Contents/Resources/load_osxfuse"), 0) < 0 && access((v="osxfuse", f="/opt/local/Library/Filesystems/osxfuse.fs" @@ -837,6 +840,32 @@ mountfuse(char *mtpt) } } + /* MacFUSE >=4 dropped support for passing fd */ + if (strcmp(v, "macfuse") == 0) { + if(socketpair(AF_UNIX, SOCK_STREAM, 0, p) < 0) + return -1; + pid = fork(); + if(pid < 0) + return -1; + if(pid == 0){ + close(p[1]); + snprint(buf, sizeof buf, "%d", p[0]); + putenv("_FUSE_COMMFD", buf); + putenv("_FUSE_COMMVERS", "2"); + putenv("_FUSE_CALL_BY_LIB", "1"); + putenv("_FUSE_DAEMON_PATH", + "/Library/Filesystems/macfuse.fs/Contents/Resources/mount_macfus"); + execl("/Library/Filesystems/macfuse.fs/Contents/Resources/mount_macfuse", + "mount_macfuse", mtpt, nil); + fprint(2, "exec mount_macfuse: %r\n"); + _exit(1); + } + close(p[0]); + fd = recvfd(p[1]); + close(p[1]); + return fd; + } + /* Look for available FUSE device. */ /* * We need to truncate `fs` from the end of the vfs name if diff --git a/src/cmd/9pfuse/main.c b/src/cmd/9pfuse/main.c index 69d1ad75..4fa330a0 100644 --- a/src/cmd/9pfuse/main.c +++ b/src/cmd/9pfuse/main.c @@ -98,6 +98,12 @@ usage(void) void fusereader(void*); void watchfd(void*); +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char **argv) { diff --git a/src/cmd/9pserve.c b/src/cmd/9pserve.c index 255bcbb2..e26eef14 100644 --- a/src/cmd/9pserve.c +++ b/src/cmd/9pserve.c @@ -137,6 +137,12 @@ usage(void) threadexitsall("usage"); } +int +threadmaybackground(void) +{ + return 1; +} + uchar vbuf[128]; extern int _threaddebuglevel; void diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c index b28f44fa..d7391cf5 100644 --- a/src/cmd/9term/9term.c +++ b/src/cmd/9term/9term.c @@ -47,6 +47,12 @@ usage(void) threadexitsall("usage"); } +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char *argv[]) { diff --git a/src/cmd/9term/AIX.c b/src/cmd/9term/AIX.c index b7ccbf0f..eec79c28 100644 --- a/src/cmd/9term/AIX.c +++ b/src/cmd/9term/AIX.c @@ -1,2 +1 @@ -#define TIOCSCTTY 0x540E #include "bsdpty.c" diff --git a/src/cmd/9term/NetBSD.c b/src/cmd/9term/NetBSD.c index eec79c28..18294803 100644 --- a/src/cmd/9term/NetBSD.c +++ b/src/cmd/9term/NetBSD.c @@ -1 +1,17 @@ +#define getpts not_using_this_getpts #include "bsdpty.c" +#undef getpts + +#include + +int +getpts(int fd[], char *slave) +{ + if(openpty(&fd[1], &fd[0], NULL, NULL, NULL) >= 0){ + fchmod(fd[1], 0620); + strcpy(slave, ttyname(fd[0])); + return 0; + } + sysfatal("no ptys: %r"); + return 0; +} diff --git a/src/cmd/9term/bsdpty.c b/src/cmd/9term/bsdpty.c index 3710a18d..e7e047e3 100644 --- a/src/cmd/9term/bsdpty.c +++ b/src/cmd/9term/bsdpty.c @@ -63,8 +63,10 @@ childpty(int fd[], char *slave) sfd = open(slave, ORDWR); if(sfd < 0) sysfatal("child open %s: %r\n", slave); +#if !defined (__AIX__) if(ioctl(sfd, TIOCSCTTY, 0) < 0) fprint(2, "ioctl TIOCSCTTY: %r\n"); +#endif return sfd; } diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c index e5658a4e..d001a2a8 100644 --- a/src/cmd/acme/acme.c +++ b/src/cmd/acme/acme.c @@ -383,7 +383,7 @@ int erroutfd; void acmeerrorproc(void *v) { - char *buf, *s; + char *buf; int n; USED(v); @@ -391,9 +391,7 @@ acmeerrorproc(void *v) buf = emalloc(8192+1); while((n=read(errorfd, buf, 8192)) >= 0){ buf[n] = '\0'; - s = estrdup(buf); - sendp(cerr, s); - free(s); + sendp(cerr, estrdup(buf)); } free(buf); } diff --git a/src/cmd/acme/edit.c b/src/cmd/acme/edit.c index 81f80300..82a19b0d 100644 --- a/src/cmd/acme/edit.c +++ b/src/cmd/acme/edit.c @@ -635,9 +635,11 @@ simpleaddr(void) case '.': case '$': case '\'': - if(addr.type!='"') + if(addr.type=='"') + break; + /* fall through */ case '"': - editerror("bad address syntax"); + editerror("bad address syntax"); break; case 'l': case '#': diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c index be7936ae..1dd02288 100644 --- a/src/cmd/acme/exec.c +++ b/src/cmd/acme/exec.c @@ -209,14 +209,14 @@ execute(Text *t, uint aq0, uint aq1, int external, Text *argt) if(n <= EVENTSIZE) winevent(t->w, "%c%d %d %d %d %.*S\n", c, aq0, aq1, f, n, n, r); else - winevent(t->w, "%c%d %d %d 0 \n", c, aq0, aq1, f, n); + winevent(t->w, "%c%d %d %d 0 \n", c, aq0, aq1, f); if(q0!=aq0 || q1!=aq1){ n = q1-q0; bufread(&t->file->b, q0, r, n); if(n <= EVENTSIZE) winevent(t->w, "%c%d %d 0 %d %.*S\n", c, q0, q1, n, n, r); else - winevent(t->w, "%c%d %d 0 0 \n", c, q0, q1, n); + winevent(t->w, "%c%d %d 0 0 \n", c, q0, q1); } if(a){ winevent(t->w, "%c0 0 0 %d %s\n", c, utflen(a), a); diff --git a/src/cmd/acme/fns.h b/src/cmd/acme/fns.h index c0339c23..969db417 100644 --- a/src/cmd/acme/fns.h +++ b/src/cmd/acme/fns.h @@ -25,6 +25,8 @@ void savemouse(Window*); int restoremouse(Window*); void clearmouse(void); void allwindows(void(*)(Window*, void*), void*); +uint seqof(Window*, int); + uint loadfile(int, uint, int*, int(*)(void*, uint, Rune*, int), void*, DigestState*); void movetodel(Window*); diff --git a/src/cmd/acme/look.c b/src/cmd/acme/look.c index 35667c6c..a7172b50 100644 --- a/src/cmd/acme/look.c +++ b/src/cmd/acme/look.c @@ -378,7 +378,7 @@ search(Text *ct, Rune *r, uint n) int isfilec(Rune r) { - static Rune Lx[] = { '.', '-', '+', '/', ':', 0 }; + static Rune Lx[] = { '.', '-', '+', '/', ':', '@', 0 }; if(isalnum(r)) return TRUE; if(runestrchr(Lx, r)) diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c index 0cba5920..98c97368 100644 --- a/src/cmd/acme/wind.c +++ b/src/cmd/acme/wind.c @@ -689,8 +689,8 @@ winctlprint(Window *w, char *buf, int fonts) sprint(buf, "%11d %11d %11d %11d %11d ", w->id, w->tag.file->b.nc, w->body.file->b.nc, w->isdir, w->dirty); if(fonts) - return smprint("%s%11d %q %11d ", buf, Dx(w->body.fr.r), - w->body.reffont->f->name, w->body.fr.maxtab); + return smprint("%s%11d %q %11d %11d %11d ", buf, Dx(w->body.fr.r), + w->body.reffont->f->name, w->body.fr.maxtab, seqof(w, 1) != 0, seqof(w, 0) != 0); return buf; } diff --git a/src/cmd/acme/xfid.c b/src/cmd/acme/xfid.c index 9c7be2c0..e7d9f4cb 100644 --- a/src/cmd/acme/xfid.c +++ b/src/cmd/acme/xfid.c @@ -701,6 +701,24 @@ out: winsetname(w, r, nr); m += (q+1) - pp; }else + if(strncmp(p, "font ", 5) == 0){ /* execute font command */ + pp = p+5; + m = 5; + q = memchr(pp, '\n', e-pp); + if(q==nil || q==pp){ + err = Ebadctl; + break; + } + *q = 0; + nulls = FALSE; + cvttorunes(pp, q-pp, r, &nb, &nr, &nulls); + if(nulls){ + err = "nulls in font string"; + break; + } + fontx(&w->body, nil, nil, FALSE, XXX, r, nr); + m += (q+1) - pp; + }else if(strncmp(p, "dump ", 5) == 0){ /* set dump string */ pp = p+5; m = 5; diff --git a/src/cmd/auth/factotum/main.c b/src/cmd/auth/factotum/main.c index b3ace12c..6dfc2a40 100644 --- a/src/cmd/auth/factotum/main.c +++ b/src/cmd/auth/factotum/main.c @@ -20,6 +20,12 @@ usage(void) threadexitsall("usage"); } +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char *argv[]) { diff --git a/src/cmd/auth/ssh-agent.c b/src/cmd/auth/ssh-agent.c index c3b0c7ef..e944e390 100644 --- a/src/cmd/auth/ssh-agent.c +++ b/src/cmd/auth/ssh-agent.c @@ -90,6 +90,12 @@ usage(void) threadexitsall("usage"); } +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char **argv) { diff --git a/src/cmd/auxstats/Linux.c b/src/cmd/auxstats/Linux.c index 7bc4b720..74491ac2 100644 --- a/src/cmd/auxstats/Linux.c +++ b/src/cmd/auxstats/Linux.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "dat.h" void xapm(int); @@ -119,9 +120,11 @@ xnet(int first) vlong totb, totp, tote, totin, totou, totinb, totoub, b, p, e, in, ou, inb, oub; char *q; static int fd = -1; + static Reprog *netdev = nil; if(first){ fd = open("/proc/net/dev", OREAD); + netdev = regcomp("^(eth[0-9]+|wlan[0-9]+|enp[0-9]+s[0-9]+f[0-9]+|wlp[0-9]+s[0-9]+)$"); return; } @@ -140,7 +143,7 @@ xnet(int first) tokens(i); if(ntok < 8+8) continue; - if(strncmp(tok[0], "eth", 3) != 0 && strncmp(tok[0], "wlan", 4) != 0) + if(regexec(netdev, tok[0], nil, 0) != 1) continue; inb = atoll(tok[1]); oub = atoll(tok[9]); @@ -235,10 +238,12 @@ void xwireless(int first) { static int fd = -1; + static Reprog *wlan = nil; int i; if(first){ fd = open("/proc/net/wireless", OREAD); + wlan = regcomp("^(wlan[0-9]+|wlp[0-9]+s[0-9]+):$"); return; } @@ -247,7 +252,7 @@ xwireless(int first) tokens(i); if(ntok < 3) continue; - if(strcmp(tok[0], "wlan0:") == 0) + if(regexec(wlan, tok[0], nil, 0) == 1) Bprint(&bout, "802.11 =%lld 100\n", atoll(tok[2])); } } diff --git a/src/cmd/auxstats/main.c b/src/cmd/auxstats/main.c index 3fd77ac4..a37c9723 100644 --- a/src/cmd/auxstats/main.c +++ b/src/cmd/auxstats/main.c @@ -21,7 +21,8 @@ notifyf(void *v, char *msg) if(strstr(msg, "child")) noted(NCONT); - postnote(PNPROC, pid, msg); + if(pid) + postnote(PNPROC, pid, msg); exits(nil); } diff --git a/src/cmd/awk/README b/src/cmd/awk/README deleted file mode 100644 index e3efb50d..00000000 --- a/src/cmd/awk/README +++ /dev/null @@ -1,13 +0,0 @@ -This 'awk' source is directly downloaded from the Plan 9 source - -http://cm.bell-labs.com/sources/plan9/sys/src/cmd/awk/ - -as such, it's copyright is held by Lucent Technologies and distributed under the -Lucent Public License version 1.02 [http://www.opensource.org/licenses/lucent1.02.php]. - -Modifications were made by Jeff Sickel in order to build using Plan 9 from User -Space [https://9fans.github.io/plan9port/] to the following files: - - mkfile - re.c - diff --git a/src/cmd/devdraw/mac-screen.m b/src/cmd/devdraw/mac-screen.m index ad9c029e..9e51eec6 100644 --- a/src/cmd/devdraw/mac-screen.m +++ b/src/cmd/devdraw/mac-screen.m @@ -238,11 +238,14 @@ rpc_attach(Client *c, char *label, char *winsize) char *s; NSArray *allDevices; - const NSWindowStyleMask Winstyle = NSWindowStyleMaskTitled + NSWindowStyleMask Winstyle = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable; + if(label == nil || *label == '\0') + Winstyle &= ~NSWindowStyleMaskTitled; + s = winsize; sr = [[NSScreen mainScreen] frame]; r = [[NSScreen mainScreen] visibleFrame]; diff --git a/src/cmd/devdraw/mkwsysrules.sh b/src/cmd/devdraw/mkwsysrules.sh index 122e9123..56dff55a 100644 --- a/src/cmd/devdraw/mkwsysrules.sh +++ b/src/cmd/devdraw/mkwsysrules.sh @@ -7,6 +7,8 @@ if [ "x$X11" = "x" ]; then X11=/usr/X11R6 elif [ -d /usr/local/X11R6 ]; then X11=/usr/local/X11R6 + elif [ -d /usr/X11R7 ]; then + X11=/usr/X11R7 elif [ -d /usr/X ]; then X11=/usr/X elif [ -d /usr/openwin ]; then # for Sun diff --git a/src/cmd/devdraw/srv.c b/src/cmd/devdraw/srv.c index 05a08fda..479e41e0 100644 --- a/src/cmd/devdraw/srv.c +++ b/src/cmd/devdraw/srv.c @@ -88,7 +88,7 @@ threadmain(int argc, char **argv) void gfx_started(void) { - char *addr; + char *ns, *addr; if(srvname == nil) { // Legacy mode: serving single client on pipes. @@ -97,7 +97,11 @@ gfx_started(void) } // Server mode. - addr = smprint("unix!%s/%s", getns(), srvname); + if((ns = getns()) == nil) + sysfatal("out of memory"); + + addr = smprint("unix!%s/%s", ns, srvname); + free(ns); if(addr == nil) sysfatal("out of memory"); diff --git a/src/cmd/dformat b/src/cmd/dformat deleted file mode 100755 index f14b5841..00000000 --- a/src/cmd/dformat +++ /dev/null @@ -1,108 +0,0 @@ -awk ' -function error(s) { print "dformat error: " s " near input line " NR | "cat 1>&2" } - -BEGIN { s = "recht 0.3 addrht 0.055 recspread 0.15 " - s = s "charwid 0.07 textht 0.167 addrdelta 4 " - s = s "bitwid 0.125 linedisp 0.04 addr both " - s = s "fill off linethrutext 1" - n = split(s, x) - for (i = 1; i <= n-1; i += 2) oparm[x[i]] = parm[x[i]] = x[i+1] -} - -inlang == 0 { if ($0 !~ /^\.begin[ \t]/ || $2 != "dformat") print - else { - inlang = 1; print ".PS"; boxacnt = 0 - if (firstpic != 1) { firstpic = 1; print "fillval = 0.9" } - } - next - } -/^\.end/ { inlang = 0; print ".PE"; next } - -$1 == "style" { if (!($2 in parm)) error("unrecognized name: " $2) - else if ($3 == "reset") { - t = oparm[$2]; oparm[$2] = parm[$2]; parm[$2] = t - } else { - oparm[$2] = parm[$2]; parm[$2] = $3 - } - next - } - -$1 == "pic" { $1 = ""; print $0; next } - -/^[^ \t]/ { printf "BoxA: box invis ht %g wid 0", parm["recht"] - if (boxacnt++) printf " with .n at BoxA.s - (0,%g)", - parm["recspread"] + maxdy*parm["textht"] - printf "\n" - maxdy = sumboxlen = 0 - gsub(/[ \t]+$/, "") - if ($0 != "noname") { - printf " \"%s \" rjust at BoxA.w\n", $0 - printf " box invis with .e at BoxA.w ht 0 wid %g\n", - parm["charwid"] * (length($0) + 3) - } - printf " BoxB: box invis ht %g wid 0 at BoxA\n", parm["recht"] - next - } -/./ { boxname = "" - if ($1 ~ /:$/) { - boxname = substr($1, 1, length($1)-1) - $1 = ""; $0 = " " $0 - } - range = $1; $1 = "" - gsub(/^[ \t]+/, ""); gsub(/[ \t]+$/, ""); text = $0 - n = split(range, x, "-") - rlo = x[1] - rhi = (n >= 2) ? x[2] : rlo - cwid = (rhi >= rlo) ? rhi - rlo + 1 : rlo - rhi + 1 - rwid = (n >= 3) ? (0 + x[3]) : cwid - btype = x[4] - if (btype !~ /^(dot|dash|invis)/) btype = "solid" - textlen = parm["charwid"] * length(text) - boxlen = parm["bitwid"] * rwid - dy = 0 - if (textlen > boxlen) { # set dy, the channel for this text - chan[maxdy+1] = -999 - for (dy = 1; chan[dy]+textlen > sumboxlen; dy++) ; - if (dy > maxdy) maxdy = dy - if (parm["linethrutext"] == 0) - for (k = 1; k <= dy; k++) - chan[k] = sumboxlen+boxlen - else - chan[dy] = sumboxlen - } - sumboxlen += boxlen - fill = "" - if (parm["fill"] == "on") fill = " fill " - if (boxname != "") printf " %s:", boxname - printf " BoxB: box %s %s ht %g wid %g with .w at BoxB.e\n", - fill, btype, parm["recht"], boxlen - if (dy == 0) printf " \"%s\" at BoxB.c\n", text - else { if (rwid < 2) start = "BoxB.s" - else start = "BoxB.se - (" parm["linedisp"] ",0)" - printf " line from %s down %g\n", - start, dy*parm["textht"] - printf " \"%s\\|\" at last line .s rjust\n", text - printf " box invis with .e at last line .s ht 0 wid %g\n", - textlen - } - - if (parm["addr"] ~ /^(left|right|both)$/) { - dp = int(parm["addrdelta"]) # Delta Point size - if (dp < 0 || dp > 9) error("bad addrdelta value: " dp) - dah = parm["addrht"] # Delta Addr Height - pb = parm["addr"] # Parameter for Bits - if (rlo == rhi) { - printf " \"\\s-%d%s\\s+%d\" at BoxB.s + (0,%g)\n", - dp, rlo, dp, dah - } else { - if (pb == "left" || pb == "both") - printf "\t\"\\|\\s-%d%s\\s+%d\" ljust at BoxB.sw + (0,%g)\n", - dp, rlo, dp, dah - if (pb == "right" || pb == "both") - printf "\t\"\\s-%d%s\\s+%d\\|\" rjust at BoxB.se + (0,%g)\n", - dp, rhi, dp, dah - } - } - } -END { if (inlang) error("eof inside begin/end") } -' $* diff --git a/src/cmd/draw/stats.c b/src/cmd/draw/stats.c index 3b6471b7..d74b95e3 100644 --- a/src/cmd/draw/stats.c +++ b/src/cmd/draw/stats.c @@ -675,6 +675,12 @@ keyboardthread(void *v) void machproc(void*); void updateproc(void*); +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char *argv[]) { diff --git a/src/cmd/draw/tcolors.c b/src/cmd/draw/tcolors.c index 9aa4de79..05674947 100644 --- a/src/cmd/draw/tcolors.c +++ b/src/cmd/draw/tcolors.c @@ -44,6 +44,12 @@ dither[16] = { extern int chattydrawclient; +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char *argv[]) { diff --git a/src/cmd/eqn/e.h b/src/cmd/eqn/e.h index 07dc4df6..f2a71849 100644 --- a/src/cmd/eqn/e.h +++ b/src/cmd/eqn/e.h @@ -20,7 +20,7 @@ extern int class[LAST][LAST]; #undef sprintf /* Snow Leopard */ -extern char errbuf[200]; +extern char errbuf[2000]; extern char *cmdname; #define ERROR sprintf(errbuf, #define FATAL ), error(1, errbuf) diff --git a/src/cmd/eqn/input.c b/src/cmd/eqn/input.c index a0c0c34e..b146171b 100644 --- a/src/cmd/eqn/input.c +++ b/src/cmd/eqn/input.c @@ -255,7 +255,7 @@ void yyerror(char *s) error(0, s); /* temporary */ } -char errbuf[200]; +char errbuf[2000]; void eprint(void) /* try to print context around error */ { diff --git a/src/cmd/fontsrv/mac.c b/src/cmd/fontsrv/mac.c index 9829b5a8..c5a2e0f1 100644 --- a/src/cmd/fontsrv/mac.c +++ b/src/cmd/fontsrv/mac.c @@ -75,6 +75,17 @@ mac2r(CGRect r, int size, int unit) return rr; } +void +meminvert(Memimage *m) +{ + uchar *p, *ep; + + p = byteaddr(m, m->r.min); + ep = p + 4*m->width*Dy(m->r); + for(; p < ep; p++) + *p ^= 0xff; +} + void loadfonts(void) { @@ -223,8 +234,8 @@ mksubfont(XFont *f, char *name, int lo, int hi, int size, int antialias) int i, height, ascent; Fontchar *fc, *fc0; Memsubfont *sf; - CGFloat whitef[] = { 1.0, 1.0 }; - CGColorRef white; + CGFloat blackf[] = { 0.0, 1.0 }; + CGColorRef black; s = c2mac(name); desc = CTFontDescriptorCreateWithNameAndSize(s, size); @@ -267,7 +278,7 @@ mksubfont(XFont *f, char *name, int lo, int hi, int size, int antialias) color = CGColorSpaceCreateWithName(kCGColorSpaceGenericGray); ctxt = CGBitmapContextCreate(byteaddr(mc, mc->r.min), Dx(mc->r), Dy(mc->r), 8, mc->width*sizeof(u32int), color, kCGImageAlphaNone); - white = CGColorCreate(color, whitef); + black = CGColorCreate(color, blackf); CGColorSpaceRelease(color); if(ctxt == nil) { freememimage(m); @@ -293,7 +304,7 @@ mksubfont(XFont *f, char *name, int lo, int hi, int size, int antialias) CGRect r; CGPoint p1; CFStringRef keys[] = { kCTFontAttributeName, kCTForegroundColorAttributeName }; - CFTypeRef values[] = { font, white }; + CFTypeRef values[] = { font, black }; sprint(buf, "%C", (Rune)mapUnicode(name, i)); str = c2mac(buf); @@ -310,7 +321,7 @@ mksubfont(XFont *f, char *name, int lo, int hi, int size, int antialias) line = CTLineCreateWithAttributedString(attrString); CGContextSetTextPosition(ctxt, 0, y0); r = CTLineGetImageBounds(line, ctxt); - memfillcolor(mc, DBlack); + memfillcolor(mc, DWhite); CTLineDraw(line, ctxt); CFRelease(line); @@ -330,6 +341,7 @@ mksubfont(XFont *f, char *name, int lo, int hi, int size, int antialias) continue; } + meminvert(mc); memimagedraw(m, Rect(x, 0, x + p1.x, y), mc, ZP, memopaque, ZP, S); fc->width = p1.x; fc->left = 0; diff --git a/src/cmd/fontsrv/x11.c b/src/cmd/fontsrv/x11.c index 417dcfa6..c1d10197 100644 --- a/src/cmd/fontsrv/x11.c +++ b/src/cmd/fontsrv/x11.c @@ -61,6 +61,7 @@ load(XFont *f) FT_Error e; FT_ULong charcode; FT_UInt glyph_index; + int i; if(f->loaded) return; diff --git a/src/cmd/fossil/fossil.c b/src/cmd/fossil/fossil.c index 002e8510..c5672c86 100644 --- a/src/cmd/fossil/fossil.c +++ b/src/cmd/fossil/fossil.c @@ -59,6 +59,12 @@ readCmdPart(char *file, char ***pcmd, int *pncmd) *pncmd = ncmd; } +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char* argv[]) { diff --git a/src/cmd/htmlroff/roff.c b/src/cmd/htmlroff/roff.c index 34b794be..f52e0734 100644 --- a/src/cmd/htmlroff/roff.c +++ b/src/cmd/htmlroff/roff.c @@ -257,7 +257,7 @@ copyarg(void) int c; Rune *r; - if(_readx(buf, sizeof buf, ArgMode, 0) < 0) + if(_readx(buf, MaxLine, ArgMode, 0) < 0) return nil; r = runestrstr(buf, L("\\\"")); if(r){ @@ -280,7 +280,7 @@ readline(int m) static Rune buf[MaxLine]; Rune *r; - if(_readx(buf, sizeof buf, m, 1) < 0) + if(_readx(buf, MaxLine, m, 1) < 0) return nil; r = erunestrdup(buf); return r; diff --git a/src/cmd/import.c b/src/cmd/import.c index 0be2f5b6..7da70966 100644 --- a/src/cmd/import.c +++ b/src/cmd/import.c @@ -51,6 +51,12 @@ fatal(char *fmt, ...) threadexitsall("fatal"); } +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char *argv[]) { diff --git a/src/cmd/mk/NOTICE b/src/cmd/mk/NOTICE index 9911f992..f9fa9e36 100644 --- a/src/cmd/mk/NOTICE +++ b/src/cmd/mk/NOTICE @@ -1,27 +1,21 @@ -Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. -Portions Copyright © 1995-1997 C H Forsyth (forsyth@caldo.demon.co.uk). All rights reserved. -Portions Copyright © 1997-1999 Vita Nuova Limited. All rights reserved. -Portions Copyright © 2000-2002 Vita Nuova Holdings Limited (www.vitanuova.com). All rights reserved. +Copyright © 2021 Plan 9 Foundation +Portions Copyright © 1997-1999 Vita Nuova Limited +Portions Copyright © 2000-2015 Vita Nuova Holdings Limited -Under a licence agreement with Lucent Technologies Inc. effective 1st March 2000, -Vita Nuova Holdings Limited has the right to determine (within a specified scope) -the form and content of sublicences for this software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -Vita Nuova Holdings Limited now makes this software available as Free -Software under the terms of the `GNU General Public LIcense, Version 2' -(see the file LICENCE or http://www.fsf.org/copyleft/gpl.html for -the full terms and conditions). One of the conditions of that licence -is that you must keep intact all notices that refer to that licence and to the absence of -of any warranty: for this software, note that includes this NOTICE file in particular. - -This suite of programs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -`GNU General Public License' for more details. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -This copyright NOTICE applies to all files in this directory and -subdirectories, unless another copyright notice appears in a given -file or subdirectory. If you take code from this software to use in -other programs, you must somehow include with it an appropriate -copyright notice that includes the copyright notice and the other -notices above. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/src/cmd/mk/shell.c b/src/cmd/mk/shell.c index 8c15ec21..3e10146f 100644 --- a/src/cmd/mk/shell.c +++ b/src/cmd/mk/shell.c @@ -41,6 +41,8 @@ setshell(Word *w) void initshell(void) { + if(getenv("FORCERCFORMK") != nil) + shelldefault = &rcshell; shellcmd = stow(shelldefault->name); shellt = shelldefault; setvar("MKSHELL", shellcmd); diff --git a/src/cmd/mk/symtab.c b/src/cmd/mk/symtab.c index 2bb28ba8..da02f897 100644 --- a/src/cmd/mk/symtab.c +++ b/src/cmd/mk/symtab.c @@ -21,7 +21,7 @@ syminit(void) Symtab * symlook(char *sym, int space, void *install) { - ulong h; + unsigned long h; char *p; Symtab *s; @@ -45,7 +45,7 @@ symlook(char *sym, int space, void *install) void symdel(char *sym, int space) { - ulong h; + unsigned long h; char *p; Symtab *s, *ls; diff --git a/src/cmd/ndb/dns.c b/src/cmd/ndb/dns.c index cb317052..723989b9 100644 --- a/src/cmd/ndb/dns.c +++ b/src/cmd/ndb/dns.c @@ -121,6 +121,12 @@ checkaddress(void) fprint(2, "warning: announce mismatch %s %s\n", udpaddr, tcpaddr); } +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char *argv[]) { diff --git a/src/cmd/plumb/plumber.c b/src/cmd/plumb/plumber.c index c99282f0..5ead2e93 100644 --- a/src/cmd/plumb/plumber.c +++ b/src/cmd/plumb/plumber.c @@ -26,6 +26,12 @@ makeports(Ruleset *rules[]) addport(rules[i]->port); } +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char *argv[]) { diff --git a/src/cmd/rc/io.c b/src/cmd/rc/io.c index c2e9d7b4..907ba86f 100644 --- a/src/cmd/rc/io.c +++ b/src/cmd/rc/io.c @@ -1,4 +1,5 @@ #include +#include #include "rc.h" #include "exec.h" #include "io.h" @@ -257,7 +258,15 @@ int emptybuf(io *f) { int n; - if(f->fd==-1 || (n = Read(f->fd, f->buf, NBUF))<=0) return EOF; + if(f->fd==-1) + return EOF; +Loop: + errno = 0; + n = Read(f->fd, f->buf, NBUF); + if(n < 0 && errno == EINTR) + goto Loop; + if(n <= 0) + return EOF; f->bufp = f->buf; f->ebuf = f->buf+n; return *f->bufp++&0xff; diff --git a/src/cmd/sam/README b/src/cmd/sam/README deleted file mode 100644 index b78a89da..00000000 --- a/src/cmd/sam/README +++ /dev/null @@ -1,29 +0,0 @@ -This is sam (not including samterm) from the 4th edition of Plan 9, -with changes so that it can be compiled under unix. -(Tested on Solaris 7 and Debian 3.0r1.) - -Some extra libraries are needed. First, fetch libutf-2.0 and libfmt-2.0 -from - http://pdos.lcs.mit.edu/~rsc/software/ - -(Beware that in libfmt/fmt.c there is a line that says: - 'u', __ifmt, /* in Plan 9, __flagfmt */ -Thus, sam will have to fmtinstall the other thing. Other ported programs -may have to do the same. The fmt library should probably print messages -about bad format characters to stderr, since no one seems to check the -return codes.) - -Compile and install those two libraries. -Set PREFIX in the Makefile to match, then compile sam. - -Your C compiler will emit many complaints of the form: - sam.c:496: warning: passing arg 1 of `bufread' from incompatible pointer type - -This is because the Plan 9 compiler has a slightly different (better, -ala Oberon) type system than ISO C. Popular compilers generate the right -code, so in an act of civil disobediance I changed just enough to get -it to compile, but left the type errors in. Now the next C standard can -adopt this extension, because at least one important C program uses it! - --- Scott Schwartz, 4 July 2003 - diff --git a/src/cmd/sam/_libc.h b/src/cmd/sam/_libc.h deleted file mode 100644 index 65618918..00000000 --- a/src/cmd/sam/_libc.h +++ /dev/null @@ -1,40 +0,0 @@ -#define __USE_UNIX98 // for pread/pwrite, supposedly -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "utf.h" -#include "fmt.h" - -#define nil 0 -#define dup dup2 -#define exec execv -#define seek lseek -#define getwd getcwd -#define USED(a) -#define SET(a) - -enum { - OREAD = 0, - OWRITE = 1, - ORDWR = 2, - OCEXEC = 4, - ORCLOSE = 8 -}; - -enum { - ERRMAX = 255 -}; - -void exits(const char *); -void _exits(const char *); -int notify (void(*f)(void *, char *)); -int create(char *, int, int); -int errstr(char *, int); diff --git a/src/cmd/sam/cmd.c b/src/cmd/sam/cmd.c index 386fe8d4..13bd17e0 100644 --- a/src/cmd/sam/cmd.c +++ b/src/cmd/sam/cmd.c @@ -3,41 +3,41 @@ static char linex[]="\n"; static char wordx[]=" \t\n"; -struct cmdtab cmdtab[]={ +struct Cmdtab cmdtab[]={ /* cmdc text regexp addr defcmd defaddr count token fn */ - '\n', 0, 0, 0, 0, aDot, 0, 0, nl_cmd, - 'a', 1, 0, 0, 0, aDot, 0, 0, a_cmd, - 'b', 0, 0, 0, 0, aNo, 0, linex, b_cmd, - 'B', 0, 0, 0, 0, aNo, 0, linex, b_cmd, - 'c', 1, 0, 0, 0, aDot, 0, 0, c_cmd, - 'd', 0, 0, 0, 0, aDot, 0, 0, d_cmd, - 'D', 0, 0, 0, 0, aNo, 0, linex, D_cmd, - 'e', 0, 0, 0, 0, aNo, 0, wordx, e_cmd, - 'f', 0, 0, 0, 0, aNo, 0, wordx, f_cmd, - 'g', 0, 1, 0, 'p', aDot, 0, 0, g_cmd, - 'i', 1, 0, 0, 0, aDot, 0, 0, i_cmd, - 'k', 0, 0, 0, 0, aDot, 0, 0, k_cmd, - 'm', 0, 0, 1, 0, aDot, 0, 0, m_cmd, - 'n', 0, 0, 0, 0, aNo, 0, 0, n_cmd, - 'p', 0, 0, 0, 0, aDot, 0, 0, p_cmd, - 'q', 0, 0, 0, 0, aNo, 0, 0, q_cmd, - 'r', 0, 0, 0, 0, aDot, 0, wordx, e_cmd, - 's', 0, 1, 0, 0, aDot, 1, 0, s_cmd, - 't', 0, 0, 1, 0, aDot, 0, 0, m_cmd, - 'u', 0, 0, 0, 0, aNo, 2, 0, u_cmd, - 'v', 0, 1, 0, 'p', aDot, 0, 0, g_cmd, - 'w', 0, 0, 0, 0, aAll, 0, wordx, w_cmd, - 'x', 0, 1, 0, 'p', aDot, 0, 0, x_cmd, - 'y', 0, 1, 0, 'p', aDot, 0, 0, x_cmd, - 'X', 0, 1, 0, 'f', aNo, 0, 0, X_cmd, - 'Y', 0, 1, 0, 'f', aNo, 0, 0, X_cmd, - '!', 0, 0, 0, 0, aNo, 0, linex, plan9_cmd, - '>', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd, - '<', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd, - '|', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd, - '=', 0, 0, 0, 0, aDot, 0, linex, eq_cmd, - 'c'|0x100,0, 0, 0, 0, aNo, 0, wordx, cd_cmd, - 0, 0, 0, 0, 0, 0, 0, 0 + {'\n', 0, 0, 0, 0, aDot, 0, 0, nl_cmd}, + {'a', 1, 0, 0, 0, aDot, 0, 0, a_cmd}, + {'b', 0, 0, 0, 0, aNo, 0, linex, b_cmd}, + {'B', 0, 0, 0, 0, aNo, 0, linex, b_cmd}, + {'c', 1, 0, 0, 0, aDot, 0, 0, c_cmd}, + {'d', 0, 0, 0, 0, aDot, 0, 0, d_cmd}, + {'D', 0, 0, 0, 0, aNo, 0, linex, D_cmd}, + {'e', 0, 0, 0, 0, aNo, 0, wordx, e_cmd}, + {'f', 0, 0, 0, 0, aNo, 0, wordx, f_cmd}, + {'g', 0, 1, 0, 'p', aDot, 0, 0, g_cmd}, + {'i', 1, 0, 0, 0, aDot, 0, 0, i_cmd}, + {'k', 0, 0, 0, 0, aDot, 0, 0, k_cmd}, + {'m', 0, 0, 1, 0, aDot, 0, 0, m_cmd}, + {'n', 0, 0, 0, 0, aNo, 0, 0, n_cmd}, + {'p', 0, 0, 0, 0, aDot, 0, 0, p_cmd}, + {'q', 0, 0, 0, 0, aNo, 0, 0, q_cmd}, + {'r', 0, 0, 0, 0, aDot, 0, wordx, e_cmd}, + {'s', 0, 1, 0, 0, aDot, 1, 0, s_cmd}, + {'t', 0, 0, 1, 0, aDot, 0, 0, m_cmd}, + {'u', 0, 0, 0, 0, aNo, 2, 0, u_cmd}, + {'v', 0, 1, 0, 'p', aDot, 0, 0, g_cmd}, + {'w', 0, 0, 0, 0, aAll, 0, wordx, w_cmd}, + {'x', 0, 1, 0, 'p', aDot, 0, 0, x_cmd}, + {'y', 0, 1, 0, 'p', aDot, 0, 0, x_cmd}, + {'X', 0, 1, 0, 'f', aNo, 0, 0, X_cmd}, + {'Y', 0, 1, 0, 'f', aNo, 0, 0, X_cmd}, + {'!', 0, 0, 0, 0, aNo, 0, linex, plan9_cmd}, + {'>', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd}, + {'<', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd}, + {'|', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd}, + {'=', 0, 0, 0, 0, aDot, 0, linex, eq_cmd}, + {'c'|0x100,0, 0, 0, 0, aNo, 0, wordx, cd_cmd}, + {0, 0, 0, 0, 0, 0, 0, 0}, }; Cmd *parsecmd(int); Addr *compoundaddr(void); @@ -402,7 +402,7 @@ Cmd * parsecmd(int nest) { int i, c; - struct cmdtab *ct; + Cmdtab *ct; Cmd *cp, *ncp; Cmd cmd; @@ -559,9 +559,11 @@ simpleaddr(void) case '.': case '$': case '\'': - if(addr.type!='"') + if(addr.type=='"') + break; + /* fall through */ case '"': - error(Eaddress); + error(Eaddress); break; case 'l': case '#': diff --git a/src/cmd/sam/err b/src/cmd/sam/err deleted file mode 100644 index 2a36c23b..00000000 --- a/src/cmd/sam/err +++ /dev/null @@ -1,39 +0,0 @@ -address.c: In function `filematch': -address.c:159: warning: passing arg 1 of `bufreset' from incompatible pointer type -address.c:160: warning: passing arg 1 of `bufinsert' from incompatible pointer type -file.c: In function `mergeextend': -file.c:117: warning: passing arg 1 of `bufread' from incompatible pointer type -file.c: In function `fileinsert': -file.c:275: warning: passing arg 1 of `bufinsert' from incompatible pointer type -file.c: In function `filedelete': -file.c:301: warning: passing arg 1 of `bufdelete' from incompatible pointer type -file.c: In function `fileundelete': -file.c:324: warning: passing arg 1 of `bufread' from incompatible pointer type -file.c: In function `filereadc': -file.c:339: warning: passing arg 1 of `bufread' from incompatible pointer type -file.c: In function `fileload': -file.c:405: warning: passing arg 1 of `bufload' from incompatible pointer type -file.c: In function `fileundo': -file.c:528: warning: passing arg 1 of `bufdelete' from incompatible pointer type -file.c:546: warning: passing arg 1 of `bufinsert' from incompatible pointer type -file.c: In function `fileclose': -file.c:604: warning: passing arg 1 of `bufclose' from incompatible pointer type -io.c: In function `readio': -io.c:90: warning: passing arg 1 of `bufload' from incompatible pointer type -io.c: In function `writeio': -io.c:152: warning: passing arg 1 of `bufread' from incompatible pointer type -mesg.c: In function `inmesg': -mesg.c:248: warning: passing arg 1 of `bufread' from incompatible pointer type -mesg.c: In function `snarf': -mesg.c:568: warning: passing arg 1 of `bufread' from incompatible pointer type -mesg.c: In function `setgenstr': -mesg.c:612: warning: passing arg 1 of `bufread' from incompatible pointer type -sam.c: In function `readcmd': -sam.c:496: warning: passing arg 1 of `bufread' from incompatible pointer type -sam.c: In function `copy': -sam.c:676: warning: passing arg 1 of `bufread' from incompatible pointer type -xec.c: In function `s_cmd': -xec.c:234: warning: passing arg 1 of `bufread' from incompatible pointer type -xec.c:243: warning: passing arg 1 of `bufread' from incompatible pointer type -xec.c: In function `display': -xec.c:401: warning: passing arg 1 of `bufread' from incompatible pointer type diff --git a/src/cmd/sam/io.c b/src/cmd/sam/io.c index c112c0a1..c3dc9778 100644 --- a/src/cmd/sam/io.c +++ b/src/cmd/sam/io.c @@ -63,7 +63,7 @@ writef(File *f) warn(Wnotnewline); closeio(n); if(f->name.s[0]==0 || samename){ - if(statfile(name, &dev, &qid, &mtime, 0, 0) > 0){ + if(statfile(genc, &dev, &qid, &mtime, 0, 0) > 0){ f->dev = dev; f->qidpath = qid; f->mtime = mtime; diff --git a/src/cmd/sam/parse.h b/src/cmd/sam/parse.h index d5fabf14..dd837a48 100644 --- a/src/cmd/sam/parse.h +++ b/src/cmd/sam/parse.h @@ -33,7 +33,8 @@ struct Cmd #define ctext g.text #define caddr g.addr -extern struct cmdtab{ +typedef struct Cmdtab Cmdtab; +struct Cmdtab { ushort cmdc; /* command character */ uchar text; /* takes a textual argument? */ uchar regexp; /* takes a regular expression? */ @@ -43,7 +44,8 @@ extern struct cmdtab{ uchar count; /* takes a count e.g. s2/// */ char *token; /* takes text terminated by one of these */ int (*fn)(File*, Cmd*); /* function to call with parse tree */ -}cmdtab[]; +}; +extern Cmdtab cmdtab[]; enum Defaddr{ /* default addresses */ aNo, diff --git a/src/cmd/sam/plan9.c b/src/cmd/sam/plan9.c deleted file mode 100644 index 0a3fe070..00000000 --- a/src/cmd/sam/plan9.c +++ /dev/null @@ -1,185 +0,0 @@ -#include "sam.h" - -Rune samname[] = L"~~sam~~"; - -Rune *left[]= { - L"{[(<«", - L"\n", - L"'\"`", - 0 -}; -Rune *right[]= { - L"}])>»", - L"\n", - L"'\"`", - 0 -}; - -char RSAM[] = "sam"; -char SAMTERM[] = "/bin/aux/samterm"; -char HOME[] = "HOME"; -char TMPDIR[] = "/tmp"; -char SH[] = "rc"; -char SHPATH[] = "/bin/rc"; -char RX[] = "rx"; -char RXPATH[] = "/bin/rx"; -char SAMSAVECMD[] = "/bin/rc\n/sys/lib/samsave"; - -void -dprint(char *z, ...) -{ - char buf[BLOCKSIZE]; - va_list arg; - - va_start(arg, z); - vseprint(buf, &buf[BLOCKSIZE], z, arg); - va_end(arg); - termwrite(buf); -} - -void -print_ss(char *s, String *a, String *b) -{ - dprint("?warning: %s: `%.*S' and `%.*S'\n", s, a->n, a->s, b->n, b->s); -} - -void -print_s(char *s, String *a) -{ - dprint("?warning: %s `%.*S'\n", s, a->n, a->s); -} - -char* -getuser(void) -{ - static char user[64]; - int fd; - - if(user[0] == 0){ - fd = open("/dev/user", 0); - if(fd<0 || read(fd, user, sizeof user-1)<=0) - strcpy(user, "none"); - close(fd); - } - return user; -} - -int -statfile(char *name, ulong *dev, uvlong *id, long *time, long *length, long *appendonly) -{ - Dir *dirb; - - dirb = dirstat(name); - if(dirb == nil) - return -1; - if(dev) - *dev = dirb->type|(dirb->dev<<16); - if(id) - *id = dirb->qid.path; - if(time) - *time = dirb->mtime; - if(length) - *length = dirb->length; - if(appendonly) - *appendonly = dirb->mode & DMAPPEND; - free(dirb); - return 1; -} - -int -statfd(int fd, ulong *dev, uvlong *id, long *time, long *length, long *appendonly) -{ - Dir *dirb; - - dirb = dirfstat(fd); - if(dirb == nil) - return -1; - if(dev) - *dev = dirb->type|(dirb->dev<<16); - if(id) - *id = dirb->qid.path; - if(time) - *time = dirb->mtime; - if(length) - *length = dirb->length; - if(appendonly) - *appendonly = dirb->mode & DMAPPEND; - free(dirb); - return 1; -} - -void -notifyf(void *a, char *s) -{ - USED(a); - if(bpipeok && strcmp(s, "sys: write on closed pipe") == 0) - noted(NCONT); - if(strcmp(s, "interrupt") == 0) - noted(NCONT); - panicking = 1; - rescue(); - noted(NDFLT); -} - -int -newtmp(int num) -{ - int i, fd; - static char tempnam[30]; - - i = getpid(); - do - snprint(tempnam, sizeof tempnam, "%s/%d%.4s%dsam", TMPDIR, num, getuser(), i++); - while(access(tempnam, 0) == 0); - fd = create(tempnam, ORDWR|OCEXEC|ORCLOSE, 0000); - if(fd < 0){ - remove(tempnam); - fd = create(tempnam, ORDWR|OCEXEC|ORCLOSE, 0000); - } - return fd; -} - -int -waitfor(int pid) -{ - int msg; - Waitmsg *w; - - while((w = wait()) != nil){ - if(w->pid != pid){ - free(w); - continue; - } - msg = (w->msg[0] != '\0'); - free(w); - return msg; - } - return -1; -} - -void -samerr(char *buf) -{ - sprint(buf, "%s/sam.err", TMPDIR); -} - -void* -emalloc(ulong n) -{ - void *p; - - p = malloc(n); - if(p == 0) - panic("malloc fails"); - memset(p, 0, n); - return p; -} - -void* -erealloc(void *p, ulong n) -{ - p = realloc(p, n); - if(p == 0) - panic("realloc fails"); - return p; -} diff --git a/src/cmd/sam/rasp.c b/src/cmd/sam/rasp.c index c96101df..55d16cfb 100644 --- a/src/cmd/sam/rasp.c +++ b/src/cmd/sam/rasp.c @@ -283,8 +283,8 @@ rterm(List *r, Posn p1) for(p = 0,i = 0; inused && p+L(i)<=p1; p+=L(i++)) ; - if(i==r->nused && (i==0 || !T(i-1))) - return 0; + if(i==r->nused) + return i > 0 && T(i-1); return T(i); } diff --git a/src/cmd/sam/regexp.c b/src/cmd/sam/regexp.c index 2e369fe1..57c639d9 100644 --- a/src/cmd/sam/regexp.c +++ b/src/cmd/sam/regexp.c @@ -700,11 +700,11 @@ bexecute(File *f, Posn startp) break; case 1: /* expired; wrap to end */ if(sel.p[0].p1>=0) - case 3: goto Return; list[0][0].inst = list[1][0].inst = 0; p = f->b.nc; goto doloop; + case 3: default: goto Return; } diff --git a/src/cmd/sam/sam.h b/src/cmd/sam/sam.h index c11163ef..6e018156 100644 --- a/src/cmd/sam/sam.h +++ b/src/cmd/sam/sam.h @@ -9,6 +9,9 @@ #undef warn #define warn samwarn +#undef class +#define class samclass + /* * BLOCKSIZE is relatively small to keep memory consumption down. */ @@ -34,7 +37,6 @@ typedef struct Address Address; typedef struct Block Block; typedef struct Buffer Buffer; typedef struct Disk Disk; -typedef struct Discdesc Discdesc; typedef struct File File; typedef struct List List; typedef struct Range Range; @@ -339,7 +341,6 @@ void warn_S(Warn, String*); int whichmenu(File*); void writef(File*); Posn writeio(File*); -Discdesc *Dstart(void); extern Rune samname[]; /* compiler dependent */ extern Rune *left[]; diff --git a/src/cmd/sam/shell.c b/src/cmd/sam/shell.c index c6efdd57..92bd5277 100644 --- a/src/cmd/sam/shell.c +++ b/src/cmd/sam/shell.c @@ -90,7 +90,7 @@ plan9(File *f, int type, String *s, int nest) free(c); } } - exits(retcode? "error" : 0); + exits(0); } if(pid==-1){ fprint(2, "Can't fork?!\n"); diff --git a/src/cmd/samterm/flayer.c b/src/cmd/samterm/flayer.c index e9fde31c..a8e70d0c 100644 --- a/src/cmd/samterm/flayer.c +++ b/src/cmd/samterm/flayer.c @@ -169,8 +169,8 @@ newvisibilities(int redraw) break; case V(Some, Some): - if(l->f.b==0 && redraw) case V(None, Some): + if(ov == None || (l->f.b==0 && redraw)) flprepare(l); if(l->f.b && redraw){ flrefresh(l, l->entire, 0); diff --git a/src/cmd/smugfs/main.c b/src/cmd/smugfs/main.c index e1c2745f..31c9a752 100644 --- a/src/cmd/smugfs/main.c +++ b/src/cmd/smugfs/main.c @@ -51,6 +51,12 @@ smuglogin(void) printerrors = 0; } +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char **argv) { diff --git a/src/cmd/time.c b/src/cmd/time.c index 3b52216b..16379a89 100644 --- a/src/cmd/time.c +++ b/src/cmd/time.c @@ -47,11 +47,11 @@ main(int argc, char *argv[]) error("wait"); } l = w->time[0]; - add("%ld.%.2ldu", l/1000, (l%1000)/10); + add("%ld.%.3ldu", l/1000, l%1000); l = w->time[1]; - add("%ld.%.2lds", l/1000, (l%1000)/10); + add("%ld.%.3lds", l/1000, l%1000); l = (t1-t0)/1000000; - add("%ld.%.2ldr", l/1000, (l%1000)/10); + add("%ld.%.3ldr", l/1000, l%1000); add("\t"); for(i=1; i. - diff --git a/src/lib9/postnote.c b/src/lib9/postnote.c index 68e6d2f6..d750c69d 100644 --- a/src/lib9/postnote.c +++ b/src/lib9/postnote.c @@ -18,6 +18,11 @@ postnote(int who, int pid, char *msg) return -1; } + if(pid <= 0){ + werrstr("bad pid in postnote"); + return -1; + } + switch(who){ default: werrstr("bad who in postnote"); diff --git a/src/lib9/utf/NOTICE b/src/lib9/utf/NOTICE deleted file mode 100644 index ad76cd52..00000000 --- a/src/lib9/utf/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -/* - * The authors of this software are Rob Pike and Ken Thompson. - * Copyright (c) 1998-2002 by Lucent Technologies. - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - */ diff --git a/src/lib9/zoneinfo.c b/src/lib9/zoneinfo.c index f8ae442d..36b4b6ef 100644 --- a/src/lib9/zoneinfo.c +++ b/src/lib9/zoneinfo.c @@ -6,7 +6,7 @@ * Formats 0 and 2 are supported, and 4-byte timestamps * * Copyright © 2008 M. Teichgräber - * Contributed under the terms of the Lucent Public License 1.02. + * Contributed under the MIT license used in the rest of the distribution. */ #include "zoneinfo.h" diff --git a/src/lib9p/_post.c b/src/lib9p/_post.c deleted file mode 100644 index 56f614fe..00000000 --- a/src/lib9p/_post.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include -#include -#include <9p.h> -#include "post.h" - -Postcrud* -_post1(Srv *s, char *name, char *mtpt, int flag) -{ - Postcrud *p; - - p = emalloc9p(sizeof *p); - if(!s->nopipe){ - if(pipe(p->fd) < 0) - sysfatal("pipe: %r"); - s->infd = s->outfd = p->fd[1]; - s->srvfd = p->fd[0]; - } - if(name) - if(postfd(name, s->srvfd) < 0) - sysfatal("postfd %s: %r", name); - p->s = s; - p->mtpt = mtpt; - p->flag = flag; - return p; -} - -void -_post2(void *v) -{ - Srv *s; - - s = v; - if(!s->leavefdsopen){ - rfork(RFNOTEG); - rendezvous((ulong)s, 0); - close(s->srvfd); - } - srv(s); -} - -void -_post3(Postcrud *p) -{ - /* - * Normally the server is posting as the last thing it does - * before exiting, so the correct thing to do is drop into - * a different fd space and close the 9P server half of the - * pipe before trying to mount the kernel half. This way, - * if the file server dies, we don't have a ref to the 9P server - * half of the pipe. Then killing the other procs will drop - * all the refs on the 9P server half, and the mount will fail. - * Otherwise the mount hangs forever. - * - * Libthread in general and acme win in particular make - * it hard to make this fd bookkeeping work out properly, - * so leaveinfdopen is a flag that win sets to opt out of this - * safety net. - */ - if(!p->s->leavefdsopen){ - rfork(RFFDG); - rendezvous((ulong)p->s, 0); - close(p->s->infd); - if(p->s->infd != p->s->outfd) - close(p->s->outfd); - } - -#if 0 - if(p->mtpt){ - if(amount(p->s->srvfd, p->mtpt, p->flag, "") == -1) - sysfatal("mount %s: %r", p->mtpt); - }else -#endif - close(p->s->srvfd); - free(p); -} diff --git a/src/lib9p/mkfile b/src/lib9p/mkfile index 3c6225f6..3d7fa033 100644 --- a/src/lib9p/mkfile +++ b/src/lib9p/mkfile @@ -2,7 +2,6 @@ LIB=lib9p.a OFILES=\ - _post.$O\ dirread.$O\ fid.$O\ file.$O\ diff --git a/src/lib9p/post.c b/src/lib9p/post.c deleted file mode 100644 index 4ee99bc8..00000000 --- a/src/lib9p/post.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include -#include -#include <9p.h> -#include "post.h" - -void -postmountsrv(Srv *s, char *name, char *mtpt, int flag) -{ - Postcrud *p; - - p = _post1(s, name, mtpt, flag); - switch(rfork(RFPROC|RFNOTEG|RFNAMEG|RFMEM)){ - case -1: - sysfatal("rfork: %r"); - case 0: - _post2(s); - exits(nil); - default: - _post3(p); - } -} diff --git a/src/lib9p/post.h b/src/lib9p/post.h deleted file mode 100644 index 069a7ce7..00000000 --- a/src/lib9p/post.h +++ /dev/null @@ -1,13 +0,0 @@ -typedef struct Postcrud Postcrud; -struct Postcrud -{ - int fd[2]; - Srv *s; - char *name; - char *mtpt; - int flag; -}; - -Postcrud *_post1(Srv*, char*, char*, int); -void _post2(void*); -void _post3(Postcrud*); diff --git a/src/lib9p/ramfs.c b/src/lib9p/ramfs.c index b7a07c7d..7cf6489d 100644 --- a/src/lib9p/ramfs.c +++ b/src/lib9p/ramfs.c @@ -125,6 +125,12 @@ usage(void) threadexitsall("usage"); } +int +threadmaybackground(void) +{ + return 1; +} + void threadmain(int argc, char **argv) { diff --git a/src/lib9pclient/read.c b/src/lib9pclient/read.c index ea94e9aa..aaf84326 100644 --- a/src/lib9pclient/read.c +++ b/src/lib9pclient/read.c @@ -13,6 +13,7 @@ fspread(CFid *fid, void *buf, long n, vlong offset) Fcall tx, rx; void *freep; uint msize; + long nr; msize = fid->fs->msize - IOHDRSZ; if(n > msize) @@ -34,17 +35,21 @@ fspread(CFid *fid, void *buf, long n, vlong offset) free(freep); return -1; } - if(rx.count){ - memmove(buf, rx.data, rx.count); + nr = rx.count; + if(nr > n) + nr = n; + + if(nr){ + memmove(buf, rx.data, nr); if(offset == -1){ qlock(&fid->lk); - fid->offset += rx.count; + fid->offset += nr; qunlock(&fid->lk); } } free(freep); - return rx.count; + return nr; } long diff --git a/src/libdiskfs/hfs.h b/src/libdiskfs/hfs.h index bf5ebc9f..dc30aeed 100644 --- a/src/libdiskfs/hfs.h +++ b/src/libdiskfs/hfs.h @@ -75,6 +75,39 @@ enum /* catalog record types */ Folder = 1, File, FolderThread, FileThread, + /* some systems have these defined */ + #undef IEXEC + #undef IWRITE + #undef IREAD + #undef ISVTX + #undef ISGID + #undef ISUID + #undef IFMT + #undef IFIFO + #undef IFCHR + #undef IFDIR + #undef IFBLK + #undef IFREG + #undef IFLNK + #undef IFSOCK + #undef IFWHT + + #define IEXEC HFS_IEXEC + #define IWRITE HFS_IWRITE + #define IREAD HFS_IREAD + #define ISVTX HFS_ISVTX + #define ISGID HFS_ISGID + #define ISUID HFS_ISUID + #define IFMT HFS_IFMT + #define IFIFO HFS_IFIFO + #define IFCHR HFS_IFCHR + #define IFDIR HFS_IFDIR + #define IFBLK HFS_IFBLK + #define IFREG HFS_IFREG + #define IFLNK HFS_IFLNK + #define IFSOCK HFS_IFSOCK + #define IFWHT HFS_IFWHT + /* permissions in Inode.mode */ IEXEC = 00100, IWRITE = 0200, diff --git a/src/libdraw/drawclient.c b/src/libdraw/drawclient.c index c38f4801..2ac1b232 100644 --- a/src/libdraw/drawclient.c +++ b/src/libdraw/drawclient.c @@ -23,7 +23,7 @@ int _displayconnect(Display *d) { int pid, p[2], fd, nbuf, n; - char *wsysid, *addr, *id; + char *wsysid, *ns, *addr, *id; uchar *buf; Wsysmsg w; @@ -40,7 +40,10 @@ _displayconnect(Display *d) return -1; } *id++ = '\0'; - addr = smprint("unix!%s/%s", getns(), wsysid); + if((ns = getns()) == nil) + return -1; + addr = smprint("unix!%s/%s", ns, wsysid); + free(ns); if(addr == nil) return -1; fd = dial(addr, 0, 0, 0); diff --git a/src/libdraw/string.c b/src/libdraw/string.c index 5ba5016a..4f08b1b8 100644 --- a/src/libdraw/string.c +++ b/src/libdraw/string.c @@ -81,7 +81,11 @@ _string(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s, Rune *r, i }else rptr = &r; sf = nil; +#if defined(__AIX__) + while((*s || *rptr) && len){ +#else while((*s || *r) && len){ +#endif max = Max; if(len < max) max = len; diff --git a/src/libhtml/lex.c b/src/libhtml/lex.c index 49c5f502..82324ba5 100644 --- a/src/libhtml/lex.c +++ b/src/libhtml/lex.c @@ -586,7 +586,7 @@ getplaindata(TokenSource* ts, Token* a, int* pai) } if(c != 0){ buf[j++] = c; - if(j == sizeof(buf)-1){ + if(j == BIGBUFSIZE-1){ s = buftostr(s, buf, j); j = 0; } diff --git a/src/libmp/386/mkfile b/src/libmp/386/mkfile deleted file mode 100644 index c63daf42..00000000 --- a/src/libmp/386/mkfile +++ /dev/null @@ -1,15 +0,0 @@ -<$PLAN9/src/mkhdr - -LIB=libmp.a -UNAME=`uname` -A=`[ $UNAME = Darwin ] && echo -Darwin` -OFILES=\ - mpdigdiv$A.$O\ - mpvecadd$A.$O\ - mpvecdigmuladd$A.$O\ - mpvecdigmulsub$A.$O\ - mpvecsub$A.$O\ - -HFILES=$PLAN9/include/mp.h ../port/dat.h - -<$PLAN9/src/mksyslib diff --git a/src/libmp/386/mpdigdiv-Darwin.s b/src/libmp/386/mpdigdiv-Darwin.s deleted file mode 100644 index 038214bf..00000000 --- a/src/libmp/386/mpdigdiv-Darwin.s +++ /dev/null @@ -1,33 +0,0 @@ -.text - -.globl _mpdigdiv -_mpdigdiv: - /* Prelude */ - pushl %ebp /* save on stack */ - pushl %ebx - - leal 12(%esp), %ebp /* %ebp = FP for now */ - movl 0(%ebp), %ebx /* dividend */ - movl 0(%ebx), %eax - movl 4(%ebx), %edx - movl 4(%ebp), %ebx /* divisor */ - movl 8(%ebp), %ebp /* quotient */ - - xorl %ecx, %ecx - cmpl %ebx, %edx /* dividend >= 2^32 * divisor */ - jae 2f - cmpl %ecx, %ebx /* divisor == 1 */ - je 2f - divl %ebx /* AX = DX:AX/BX */ - movl %eax, (%ebp) -1: - /* Postlude */ - popl %ebx - popl %ebp - ret - - /* return all 1's */ -2: - notl %ecx - movl %ecx, (%ebp) - jmp 1b diff --git a/src/libmp/386/mpdigdiv.s b/src/libmp/386/mpdigdiv.s deleted file mode 100644 index 48d37c0d..00000000 --- a/src/libmp/386/mpdigdiv.s +++ /dev/null @@ -1,33 +0,0 @@ -.text -.p2align 2,0x90 -.globl mpdigdiv -mpdigdiv: - /* Prelude */ - pushl %ebp /* save on stack */ - pushl %ebx - - leal 12(%esp), %ebp /* %ebp = FP for now */ - movl 0(%ebp), %ebx /* dividend */ - movl 0(%ebx), %eax - movl 4(%ebx), %edx - movl 4(%ebp), %ebx /* divisor */ - movl 8(%ebp), %ebp /* quotient */ - - xorl %ecx, %ecx - cmpl %ebx, %edx /* dividend >= 2^32 * divisor */ - jae divovfl - cmpl %ecx, %ebx /* divisor == 1 */ - je divovfl - divl %ebx /* AX = DX:AX/BX */ - movl %eax, (%ebp) -done: - /* Postlude */ - popl %ebx - popl %ebp - ret - - /* return all 1's */ -divovfl: - notl %ecx - movl %ecx, (%ebp) - jmp done diff --git a/src/libmp/386/mpvecadd-Darwin.s b/src/libmp/386/mpvecadd-Darwin.s deleted file mode 100644 index 2f68dbda..00000000 --- a/src/libmp/386/mpvecadd-Darwin.s +++ /dev/null @@ -1,70 +0,0 @@ -/* mpvecadd(mpdigit *a, int alen, mpdigit *b, int blen, mpdigit *sum) */ -/* sum[0:alen] = a[0:alen-1] + b[0:blen-1] */ -/* prereq: alen >= blen, sum has room for alen+1 digits */ -/* (very old gnu assembler doesn't allow multiline comments) */ - -.text - -.p2align 2,0x90 -.globl _mpvecadd -_mpvecadd: - /* Prelude */ - pushl %ebp /* save on stack */ - pushl %ebx - pushl %esi - pushl %edi - - leal 20(%esp), %ebp /* %ebp = FP for now */ - - movl 4(%ebp), %edx /* alen */ - movl 12(%ebp), %ecx /* blen */ - movl 0(%ebp), %esi /* a */ - movl 8(%ebp), %ebx /* b */ - subl %ecx, %edx - movl 16(%ebp), %edi /* sum */ - xorl %ebp, %ebp /* this also sets carry to 0 */ - - /* skip addition if b is zero */ - testl %ecx,%ecx - je 2f - - /* sum[0:blen-1],carry = a[0:blen-1] + b[0:blen-1] */ -1: - movl (%esi, %ebp, 4), %eax - adcl (%ebx, %ebp, 4), %eax - movl %eax, (%edi, %ebp, 4) - incl %ebp - loop 1b - -2: - /* jump if alen > blen */ - incl %edx - movl %edx, %ecx - loop 5f - - /* sum[alen] = carry */ -3: - jb 4f - movl $0, (%edi, %ebp, 4) - jmp 6f - -4: - movl $1, (%edi, %ebp, 4) - jmp 6f - - /* sum[blen:alen-1],carry = a[blen:alen-1] + 0 */ -5: - movl (%esi, %ebp, 4),%eax - adcl $0, %eax - movl %eax, (%edi, %ebp, 4) - incl %ebp - loop 5b - jmp 3b - -6: - /* Postlude */ - popl %edi - popl %esi - popl %ebx - popl %ebp - ret diff --git a/src/libmp/386/mpvecadd.s b/src/libmp/386/mpvecadd.s deleted file mode 100644 index 41d83c3f..00000000 --- a/src/libmp/386/mpvecadd.s +++ /dev/null @@ -1,70 +0,0 @@ -/* mpvecadd(mpdigit *a, int alen, mpdigit *b, int blen, mpdigit *sum) */ -/* sum[0:alen] = a[0:alen-1] + b[0:blen-1] */ -/* prereq: alen >= blen, sum has room for alen+1 digits */ -/* (very old gnu assembler doesn't allow multiline comments) */ - -.text - -.p2align 2,0x90 -.globl mpvecadd -mpvecadd: - /* Prelude */ - pushl %ebp /* save on stack */ - pushl %ebx - pushl %esi - pushl %edi - - leal 20(%esp), %ebp /* %ebp = FP for now */ - - movl 4(%ebp), %edx /* alen */ - movl 12(%ebp), %ecx /* blen */ - movl 0(%ebp), %esi /* a */ - movl 8(%ebp), %ebx /* b */ - subl %ecx, %edx - movl 16(%ebp), %edi /* sum */ - xorl %ebp, %ebp /* this also sets carry to 0 */ - - /* skip addition if b is zero */ - testl %ecx,%ecx - je _add1 - - /* sum[0:blen-1],carry = a[0:blen-1] + b[0:blen-1] */ -_addloop1: - movl (%esi, %ebp, 4), %eax - adcl (%ebx, %ebp, 4), %eax - movl %eax, (%edi, %ebp, 4) - incl %ebp - loop _addloop1 - -_add1: - /* jump if alen > blen */ - incl %edx - movl %edx, %ecx - loop _addloop2 - - /* sum[alen] = carry */ -_addend: - jb _addcarry - movl $0, (%edi, %ebp, 4) - jmp done - -_addcarry: - movl $1, (%edi, %ebp, 4) - jmp done - - /* sum[blen:alen-1],carry = a[blen:alen-1] + 0 */ -_addloop2: - movl (%esi, %ebp, 4),%eax - adcl $0, %eax - movl %eax, (%edi, %ebp, 4) - incl %ebp - loop _addloop2 - jmp _addend - -done: - /* Postlude */ - popl %edi - popl %esi - popl %ebx - popl %ebp - ret diff --git a/src/libmp/386/mpvecdigmuladd-Darwin.s b/src/libmp/386/mpvecdigmuladd-Darwin.s deleted file mode 100644 index f6d28ac3..00000000 --- a/src/libmp/386/mpvecdigmuladd-Darwin.s +++ /dev/null @@ -1,68 +0,0 @@ -/* - * mpvecdigmul(mpdigit *b, int n, mpdigit m, mpdigit *p) - * - * p += b*m - * - * each step look like: - * hi,lo = m*b[i] - * lo += oldhi + carry - * hi += carry - * p[i] += lo - * oldhi = hi - * - * the registers are: - * hi = DX - constrained by hardware - * lo = AX - constrained by hardware - * b+n = SI - can't be BP - * p+n = DI - can't be BP - * i-n = BP - * m = BX - * oldhi = CX - * - */ -.text - -.globl _mpvecdigmuladd -_mpvecdigmuladd: - /* Prelude */ - pushl %ebp /* save on stack */ - pushl %ebx - pushl %esi - pushl %edi - - leal 20(%esp), %ebp /* %ebp = FP for now */ - movl 0(%ebp), %esi /* b */ - movl 4(%ebp), %ecx /* n */ - movl 8(%ebp), %ebx /* m */ - movl 12(%ebp), %edi /* p */ - movl %ecx, %ebp - negl %ebp /* BP = -n */ - shll $2, %ecx - addl %ecx, %esi /* SI = b + n */ - addl %ecx, %edi /* DI = p + n */ - xorl %ecx, %ecx -1: - movl (%esi, %ebp, 4), %eax /* lo = b[i] */ - mull %ebx /* hi, lo = b[i] * m */ - addl %ecx,%eax /* lo += oldhi */ - jae 2f - incl %edx /* hi += carry */ -2: - addl %eax, (%edi, %ebp, 4) /* p[i] += lo */ - jae 3f - incl %edx /* hi += carry */ -3: - movl %edx, %ecx /* oldhi = hi */ - incl %ebp /* i++ */ - jnz 1b - xorl %eax, %eax - addl %ecx, (%edi, %ebp, 4) /* p[n] + oldhi */ - adcl %eax, %eax /* return carry out of p[n] */ - - /* Postlude */ - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - diff --git a/src/libmp/386/mpvecdigmuladd.s b/src/libmp/386/mpvecdigmuladd.s deleted file mode 100644 index 8c92f61f..00000000 --- a/src/libmp/386/mpvecdigmuladd.s +++ /dev/null @@ -1,69 +0,0 @@ -# -# mpvecdigmul(mpdigit *b, int n, mpdigit m, mpdigit *p) -# -# p += b*m -# -# each step look like: -# hi,lo = m*b[i] -# lo += oldhi + carry -# hi += carry -# p[i] += lo -# oldhi = hi -# -# the registers are: -# hi = DX - constrained by hardware -# lo = AX - constrained by hardware -# b+n = SI - can't be BP -# p+n = DI - can't be BP -# i-n = BP -# m = BX -# oldhi = CX -# - -.text - -.p2align 2,0x90 -.globl mpvecdigmuladd -mpvecdigmuladd: - # Prelude - pushl %ebp # save on stack - pushl %ebx - pushl %esi - pushl %edi - - leal 20(%esp), %ebp # %ebp = FP for now - movl 0(%ebp), %esi # b - movl 4(%ebp), %ecx # n - movl 8(%ebp), %ebx # m - movl 12(%ebp), %edi # p - movl %ecx, %ebp - negl %ebp # BP = -n - shll $2, %ecx - addl %ecx, %esi # SI = b + n - addl %ecx, %edi # DI = p + n - xorl %ecx, %ecx -_muladdloop: - movl (%esi, %ebp, 4), %eax # lo = b[i] - mull %ebx # hi, lo = b[i] * m - addl %ecx,%eax # lo += oldhi - jae _muladdnocarry1 - incl %edx # hi += carry -_muladdnocarry1: - addl %eax, (%edi, %ebp, 4) # p[i] += lo - jae _muladdnocarry2 - incl %edx # hi += carry -_muladdnocarry2: - movl %edx, %ecx # oldhi = hi - incl %ebp # i++ - jnz _muladdloop - xorl %eax, %eax - addl %ecx, (%edi, %ebp, 4) # p[n] + oldhi - adcl %eax, %eax # return carry out of p[n] - - # Postlude - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - diff --git a/src/libmp/386/mpvecdigmulsub-Darwin.s b/src/libmp/386/mpvecdigmulsub-Darwin.s deleted file mode 100644 index 8f7f4d68..00000000 --- a/src/libmp/386/mpvecdigmulsub-Darwin.s +++ /dev/null @@ -1,69 +0,0 @@ -/* - * mpvecdigmulsub(mpdigit *b, int n, mpdigit m, mpdigit *p) - * - * p -= b*m - * - * each step look like: - * hi,lo = m*b[i] - * lo += oldhi + carry - * hi += carry - * p[i] += lo - * oldhi = hi - * - * the registers are: - * hi = DX - constrained by hardware - * lo = AX - constrained by hardware - * b = SI - can't be BP - * p = DI - can't be BP - * i = BP - * n = CX - constrained by LOOP instr - * m = BX - * oldhi = EX - * - */ -.text - -.globl _mpvecdigmulsub -_mpvecdigmulsub: - /* Prelude */ - pushl %ebp /* save on stack */ - pushl %ebx - pushl %esi - pushl %edi - - leal 20(%esp), %ebp /* %ebp = FP for now */ - movl 0(%ebp), %esi /* b */ - movl 4(%ebp), %ecx /* n */ - movl 8(%ebp), %ebx /* m */ - movl 12(%ebp), %edi /* p */ - xorl %ebp, %ebp - pushl %ebp -1: - movl (%esi, %ebp, 4),%eax /* lo = b[i] */ - mull %ebx /* hi, lo = b[i] * m */ - addl 0(%esp), %eax /* lo += oldhi */ - jae 2f - incl %edx /* hi += carry */ -2: - subl %eax, (%edi, %ebp, 4) - jae 3f - incl %edx /* hi += carry */ -3: - movl %edx, 0(%esp) - incl %ebp - loop 1b - popl %eax - subl %eax, (%edi, %ebp, 4) - jae 4f - movl $-1, %eax - jmp 5f -4: - movl $1, %eax -5: - /* Postlude */ - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - diff --git a/src/libmp/386/mpvecdigmulsub.s b/src/libmp/386/mpvecdigmulsub.s deleted file mode 100644 index 017e86c9..00000000 --- a/src/libmp/386/mpvecdigmulsub.s +++ /dev/null @@ -1,70 +0,0 @@ -# -# mpvecdigmulsub(mpdigit *b, int n, mpdigit m, mpdigit *p) -# -# p -= b*m -# -# each step look like: -# hi,lo = m*b[i] -# lo += oldhi + carry -# hi += carry -# p[i] += lo -# oldhi = hi -# -# the registers are: -# hi = DX - constrained by hardware -# lo = AX - constrained by hardware -# b = SI - can't be BP -# p = DI - can't be BP -# i = BP -# n = CX - constrained by LOOP instr -# m = BX -# oldhi = EX -# - -.text - -.p2align 2,0x90 -.globl mpvecdigmulsub -mpvecdigmulsub: - # Prelude - pushl %ebp # save on stack - pushl %ebx - pushl %esi - pushl %edi - - leal 20(%esp), %ebp # %ebp = FP for now - movl 0(%ebp), %esi # b - movl 4(%ebp), %ecx # n - movl 8(%ebp), %ebx # m - movl 12(%ebp), %edi # p - xorl %ebp, %ebp - pushl %ebp -_mulsubloop: - movl (%esi, %ebp, 4),%eax # lo = b[i] - mull %ebx # hi, lo = b[i] * m - addl 0(%esp), %eax # lo += oldhi - jae _mulsubnocarry1 - incl %edx # hi += carry -_mulsubnocarry1: - subl %eax, (%edi, %ebp, 4) - jae _mulsubnocarry2 - incl %edx # hi += carry -_mulsubnocarry2: - movl %edx, 0(%esp) - incl %ebp - loop _mulsubloop - popl %eax - subl %eax, (%edi, %ebp, 4) - jae _mulsubnocarry3 - movl $-1, %eax - jmp done -_mulsubnocarry3: - movl $1, %eax -done: - # Postlude - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - diff --git a/src/libmp/386/mpvecsub-Darwin.s b/src/libmp/386/mpvecsub-Darwin.s deleted file mode 100644 index 0155e3ec..00000000 --- a/src/libmp/386/mpvecsub-Darwin.s +++ /dev/null @@ -1,60 +0,0 @@ -/* mpvecsub(mpdigit *a, int alen, mpdigit *b, int blen, mpdigit *diff) */ -/* diff[0:alen-1] = a[0:alen-1] - b[0:blen-1] */ -/* prereq: alen >= blen, diff has room for alen digits */ -/* (very old gnu assembler doesn't allow multiline comments) */ - -.text - -.p2align 2,0x90 -.globl _mpvecsub -_mpvecsub: - /* Prelude */ - pushl %ebp /* save on stack */ - pushl %ebx - pushl %esi - pushl %edi - - leal 20(%esp), %ebp /* %ebp = FP for now */ - movl 0(%ebp), %esi /* a */ - movl 8(%ebp), %ebx /* b */ - movl 4(%ebp), %edx /* alen */ - movl 12(%ebp), %ecx /* blen */ - movl 16(%ebp), %edi /* diff */ - - subl %ecx,%edx - xorl %ebp,%ebp /* this also sets carry to 0 */ - - /* skip subraction if b is zero */ - testl %ecx,%ecx - jz 2f - - /* diff[0:blen-1],borrow = a[0:blen-1] - b[0:blen-1] */ -1: - movl (%esi, %ebp, 4), %eax - sbbl (%ebx, %ebp, 4), %eax - movl %eax, (%edi, %ebp, 4) - incl %ebp - loop 1b - -2: - incl %edx - movl %edx,%ecx - loop 3f - jmp 4f - - /* diff[blen:alen-1] = a[blen:alen-1] - 0 */ -3: - movl (%esi, %ebp, 4), %eax - sbbl $0, %eax - movl %eax, (%edi, %ebp, 4) - incl %ebp - loop 3b - -4: - /* Postlude */ - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - diff --git a/src/libmp/386/mpvecsub.s b/src/libmp/386/mpvecsub.s deleted file mode 100644 index d68424cf..00000000 --- a/src/libmp/386/mpvecsub.s +++ /dev/null @@ -1,60 +0,0 @@ -/* mpvecsub(mpdigit *a, int alen, mpdigit *b, int blen, mpdigit *diff) */ -/* diff[0:alen-1] = a[0:alen-1] - b[0:blen-1] */ -/* prereq: alen >= blen, diff has room for alen digits */ -/* (very old gnu assembler doesn't allow multiline comments) */ - -.text - -.p2align 2,0x90 -.globl mpvecsub -mpvecsub: - /* Prelude */ - pushl %ebp /* save on stack */ - pushl %ebx - pushl %esi - pushl %edi - - leal 20(%esp), %ebp /* %ebp = FP for now */ - movl 0(%ebp), %esi /* a */ - movl 8(%ebp), %ebx /* b */ - movl 4(%ebp), %edx /* alen */ - movl 12(%ebp), %ecx /* blen */ - movl 16(%ebp), %edi /* diff */ - - subl %ecx,%edx - xorl %ebp,%ebp /* this also sets carry to 0 */ - - /* skip subraction if b is zero */ - testl %ecx,%ecx - jz _sub1 - - /* diff[0:blen-1],borrow = a[0:blen-1] - b[0:blen-1] */ -_subloop1: - movl (%esi, %ebp, 4), %eax - sbbl (%ebx, %ebp, 4), %eax - movl %eax, (%edi, %ebp, 4) - incl %ebp - loop _subloop1 - -_sub1: - incl %edx - movl %edx,%ecx - loop _subloop2 - jmp done - - /* diff[blen:alen-1] = a[blen:alen-1] - 0 */ -_subloop2: - movl (%esi, %ebp, 4), %eax - sbbl $0, %eax - movl %eax, (%edi, %ebp, 4) - incl %ebp - loop _subloop2 - -done: - /* Postlude */ - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - diff --git a/src/libmp/PowerMacintosh/mkfile b/src/libmp/PowerMacintosh/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libmp/PowerMacintosh/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libmp/arm/mkfile b/src/libmp/arm/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libmp/arm/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libmp/arm64/mkfile b/src/libmp/arm64/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libmp/arm64/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libmp/mips/mkfile b/src/libmp/mips/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libmp/mips/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libmp/mkfile b/src/libmp/mkfile index e3f1aa69..81f237c4 100644 --- a/src/libmp/mkfile +++ b/src/libmp/mkfile @@ -2,6 +2,6 @@ DIRS=\ port\ - $OBJTYPE\ +# $OBJTYPE\ <$PLAN9/src/mkdirs diff --git a/src/libmp/port/mkfile b/src/libmp/port/mkfile index b0cf77cd..15612aa7 100644 --- a/src/libmp/port/mkfile +++ b/src/libmp/port/mkfile @@ -34,8 +34,9 @@ FILES=\ mptouv\ ALLOFILES=${FILES:%=%.$O} -# cull things in the per-machine directories from this list -OFILES= `{sh ./reduce $O $OBJTYPE $ALLOFILES} +# # cull things in the per-machine directories from this list +# OFILES= `{sh ./reduce $O $ALLOFILES} +OFILES=$ALLOFILES HFILES=\ $PLAN9/include/lib9.h\ diff --git a/src/libmp/power/mkfile b/src/libmp/power/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libmp/power/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libmp/sparc64/mkfile b/src/libmp/sparc64/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libmp/sparc64/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libmp/sun4u/mkfile b/src/libmp/sun4u/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libmp/sun4u/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libmp/x86_64/mkfile b/src/libmp/x86_64/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libmp/x86_64/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libsec/386/md5block.spp b/src/libsec/386/md5block.spp deleted file mode 100644 index feebf615..00000000 --- a/src/libsec/386/md5block.spp +++ /dev/null @@ -1,248 +0,0 @@ -/* - * rfc1321 requires that I include this. The code is new. The constants - * all come from the rfc (hence the copyright). We trade a table for the - * macros in rfc. The total size is a lot less. -- presotto - * - * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All - * rights reserved. - * - * License to copy and use this software is granted provided that it - * is identified as the "RSA Data Security, Inc. MD5 Message-Digest - * Algorithm" in all material mentioning or referencing this software - * or this function. - * - * License is also granted to make and use derivative works provided - * that such works are identified as "derived from the RSA Data - * Security, Inc. MD5 Message-Digest Algorithm" in all material - * mentioning or referencing the derived work. - * - * RSA Data Security, Inc. makes no representations concerning either - * the merchantability of this software or the suitability of this - * software forany particular purpose. It is provided "as is" - * without express or implied warranty of any kind. - * These notices must be retained in any copies of any part of this - * documentation and/or software. - */ -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 - -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 - -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 - -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - -#define PAYME(x) $##x - -/* - * SI is data - * a += FN(B,C,D); - * a += x[sh] + t[sh]; - * a = (a << S11) | (a >> (32 - S11)); - * a += b; - */ - -#define BODY1(off,V,FN,SH,A,B,C,D)\ - FN(B,C,D)\ - leal V(A, %edi, 1), A;\ - addl off(%ebp), A;\ - roll PAYME(SH), A;\ - addl B, A;\ - -#define BODY(off,V,FN,SH,A,B,C,D)\ - FN(B,C,D)\ - leal V(A, %edi, 1), A;\ - addl (off)(%ebp), A;\ - roll PAYME(SH), A;\ - addl B,A;\ - -/* - * fn1 = ((c ^ d) & b) ^ d - */ -#define FN1(B,C,D)\ - movl C, %edi;\ - xorl D, %edi;\ - andl B, %edi;\ - xorl D, %edi;\ - -/* - * fn2 = ((b ^ c) & d) ^ c; - */ -#define FN2(B,C,D)\ - movl B, %edi;\ - xorl C, %edi;\ - andl D, %edi;\ - xorl C, %edi;\ - -/* - * fn3 = b ^ c ^ d; - */ -#define FN3(B,C,D)\ - movl B, %edi;\ - xorl C, %edi;\ - xorl D, %edi;\ - -/* - * fn4 = c ^ (b | ~d); - */ -#define FN4(B,C,D)\ - movl D, %edi;\ - xorl $-1, %edi;\ - orl B, %edi;\ - xorl C, %edi;\ - -#define STACKSIZE 20 - -#define DATA (STACKSIZE+8) -#define LEN (STACKSIZE+12) -#define STATE (STACKSIZE+16) - -#define EDATA (STACKSIZE-4) -#define OLDEBX (STACKSIZE-8) -#define OLDESI (STACKSIZE-12) -#define OLDEDI (STACKSIZE-16) - - .text - - .p2align 2,0x90 -#ifdef __Darwin__ - .globl __md5block - __md5block: -#else - .globl _md5block - _md5block: -#endif - - /* Prelude */ - pushl %ebp - subl $(STACKSIZE), %esp - movl %ebx, OLDEBX(%esp) - movl %esi, OLDESI(%esp) - movl %edi, OLDEDI(%esp) - - movl DATA(%esp), %eax - addl LEN(%esp), %eax - movl %eax, EDATA(%esp) - - movl DATA(%esp), %ebp - -0: - movl STATE(%esp), %esi - movl (%esi), %eax - movl 4(%esi), %ebx - movl 8(%esi), %ecx - movl 12(%esi), %edx - - BODY1( 0*4,0xd76aa478,FN1,S11,%eax,%ebx,%ecx,%edx) - BODY1( 1*4,0xe8c7b756,FN1,S12,%edx,%eax,%ebx,%ecx) - BODY1( 2*4,0x242070db,FN1,S13,%ecx,%edx,%eax,%ebx) - BODY1( 3*4,0xc1bdceee,FN1,S14,%ebx,%ecx,%edx,%eax) - - BODY1( 4*4,0xf57c0faf,FN1,S11,%eax,%ebx,%ecx,%edx) - BODY1( 5*4,0x4787c62a,FN1,S12,%edx,%eax,%ebx,%ecx) - BODY1( 6*4,0xa8304613,FN1,S13,%ecx,%edx,%eax,%ebx) - BODY1( 7*4,0xfd469501,FN1,S14,%ebx,%ecx,%edx,%eax) - - BODY1( 8*4,0x698098d8,FN1,S11,%eax,%ebx,%ecx,%edx) - BODY1( 9*4,0x8b44f7af,FN1,S12,%edx,%eax,%ebx,%ecx) - BODY1(10*4,0xffff5bb1,FN1,S13,%ecx,%edx,%eax,%ebx) - BODY1(11*4,0x895cd7be,FN1,S14,%ebx,%ecx,%edx,%eax) - - BODY1(12*4,0x6b901122,FN1,S11,%eax,%ebx,%ecx,%edx) - BODY1(13*4,0xfd987193,FN1,S12,%edx,%eax,%ebx,%ecx) - BODY1(14*4,0xa679438e,FN1,S13,%ecx,%edx,%eax,%ebx) - BODY1(15*4,0x49b40821,FN1,S14,%ebx,%ecx,%edx,%eax) - - - BODY( 1*4,0xf61e2562,FN2,S21,%eax,%ebx,%ecx,%edx) - BODY( 6*4,0xc040b340,FN2,S22,%edx,%eax,%ebx,%ecx) - BODY(11*4,0x265e5a51,FN2,S23,%ecx,%edx,%eax,%ebx) - BODY( 0*4,0xe9b6c7aa,FN2,S24,%ebx,%ecx,%edx,%eax) - - BODY( 5*4,0xd62f105d,FN2,S21,%eax,%ebx,%ecx,%edx) - BODY(10*4,0x02441453,FN2,S22,%edx,%eax,%ebx,%ecx) - BODY(15*4,0xd8a1e681,FN2,S23,%ecx,%edx,%eax,%ebx) - BODY( 4*4,0xe7d3fbc8,FN2,S24,%ebx,%ecx,%edx,%eax) - - BODY( 9*4,0x21e1cde6,FN2,S21,%eax,%ebx,%ecx,%edx) - BODY(14*4,0xc33707d6,FN2,S22,%edx,%eax,%ebx,%ecx) - BODY( 3*4,0xf4d50d87,FN2,S23,%ecx,%edx,%eax,%ebx) - BODY( 8*4,0x455a14ed,FN2,S24,%ebx,%ecx,%edx,%eax) - - BODY(13*4,0xa9e3e905,FN2,S21,%eax,%ebx,%ecx,%edx) - BODY( 2*4,0xfcefa3f8,FN2,S22,%edx,%eax,%ebx,%ecx) - BODY( 7*4,0x676f02d9,FN2,S23,%ecx,%edx,%eax,%ebx) - BODY(12*4,0x8d2a4c8a,FN2,S24,%ebx,%ecx,%edx,%eax) - - - BODY( 5*4,0xfffa3942,FN3,S31,%eax,%ebx,%ecx,%edx) - BODY( 8*4,0x8771f681,FN3,S32,%edx,%eax,%ebx,%ecx) - BODY(11*4,0x6d9d6122,FN3,S33,%ecx,%edx,%eax,%ebx) - BODY(14*4,0xfde5380c,FN3,S34,%ebx,%ecx,%edx,%eax) - - BODY( 1*4,0xa4beea44,FN3,S31,%eax,%ebx,%ecx,%edx) - BODY( 4*4,0x4bdecfa9,FN3,S32,%edx,%eax,%ebx,%ecx) - BODY( 7*4,0xf6bb4b60,FN3,S33,%ecx,%edx,%eax,%ebx) - BODY(10*4,0xbebfbc70,FN3,S34,%ebx,%ecx,%edx,%eax) - - BODY(13*4,0x289b7ec6,FN3,S31,%eax,%ebx,%ecx,%edx) - BODY( 0*4,0xeaa127fa,FN3,S32,%edx,%eax,%ebx,%ecx) - BODY( 3*4,0xd4ef3085,FN3,S33,%ecx,%edx,%eax,%ebx) - BODY( 6*4,0x04881d05,FN3,S34,%ebx,%ecx,%edx,%eax) - - BODY( 9*4,0xd9d4d039,FN3,S31,%eax,%ebx,%ecx,%edx) - BODY(12*4,0xe6db99e5,FN3,S32,%edx,%eax,%ebx,%ecx) - BODY(15*4,0x1fa27cf8,FN3,S33,%ecx,%edx,%eax,%ebx) - BODY( 2*4,0xc4ac5665,FN3,S34,%ebx,%ecx,%edx,%eax) - - - BODY( 0*4,0xf4292244,FN4,S41,%eax,%ebx,%ecx,%edx) - BODY( 7*4,0x432aff97,FN4,S42,%edx,%eax,%ebx,%ecx) - BODY(14*4,0xab9423a7,FN4,S43,%ecx,%edx,%eax,%ebx) - BODY( 5*4,0xfc93a039,FN4,S44,%ebx,%ecx,%edx,%eax) - - BODY(12*4,0x655b59c3,FN4,S41,%eax,%ebx,%ecx,%edx) - BODY( 3*4,0x8f0ccc92,FN4,S42,%edx,%eax,%ebx,%ecx) - BODY(10*4,0xffeff47d,FN4,S43,%ecx,%edx,%eax,%ebx) - BODY( 1*4,0x85845dd1,FN4,S44,%ebx,%ecx,%edx,%eax) - - BODY( 8*4,0x6fa87e4f,FN4,S41,%eax,%ebx,%ecx,%edx) - BODY(15*4,0xfe2ce6e0,FN4,S42,%edx,%eax,%ebx,%ecx) - BODY( 6*4,0xa3014314,FN4,S43,%ecx,%edx,%eax,%ebx) - BODY(13*4,0x4e0811a1,FN4,S44,%ebx,%ecx,%edx,%eax) - - BODY( 4*4,0xf7537e82,FN4,S41,%eax,%ebx,%ecx,%edx) - BODY(11*4,0xbd3af235,FN4,S42,%edx,%eax,%ebx,%ecx) - BODY( 2*4,0x2ad7d2bb,FN4,S43,%ecx,%edx,%eax,%ebx) - BODY( 9*4,0xeb86d391,FN4,S44,%ebx,%ecx,%edx,%eax) - - addl $(16*4), %ebp - movl STATE(%esp), %edi - addl %eax,0(%edi) - addl %ebx,4(%edi) - addl %ecx,8(%edi) - addl %edx,12(%edi) - - movl EDATA(%esp), %edi - cmpl %edi, %ebp - jb 0b - - /* Postlude */ - movl OLDEBX(%esp), %ebx - movl OLDESI(%esp), %esi - movl OLDEDI(%esp), %edi - addl $(STACKSIZE), %esp - popl %ebp - ret - diff --git a/src/libsec/386/mkfile b/src/libsec/386/mkfile deleted file mode 100644 index 6f970600..00000000 --- a/src/libsec/386/mkfile +++ /dev/null @@ -1,26 +0,0 @@ -<$PLAN9/src/mkhdr - -LIB=libsec.a -SFILES=\ - md5block.s\ - sha1block.s\ - -HFILES=$PLAN9/include/libsec.h - -OFILES=${SFILES:%.s=%.$O} - -UPDATE=mkfile\ - $HFILES\ - $SFILES\ - -<$PLAN9/src/mksyslib - -%.s: %.spp - if [ `uname` = OpenBSD ] || [ `uname` = Darwin ] - then - gcc -xc -D__`uname`__ -E $stem.spp >$stem.s - else - cpp $stem.spp >$stem.s - fi - -CLEANFILES=md5block.s sha1block.s diff --git a/src/libsec/386/sha1block.spp b/src/libsec/386/sha1block.spp deleted file mode 100644 index 386b2e6c..00000000 --- a/src/libsec/386/sha1block.spp +++ /dev/null @@ -1,221 +0,0 @@ -.text - -.p2align 2,0x90 -#ifdef __Darwin__ -.globl __sha1block -__sha1block: -#else -.globl _sha1block -_sha1block: -#endif - -/* x = (wp[off-f] ^ wp[off-8] ^ wp[off-14] ^ wp[off-16]) <<< 1; - * wp[off] = x; - * x += A <<< 5; - * E += 0xca62c1d6 + x; - * x = FN(B,C,D); - * E += x; - * B >>> 2 - */ -#define BSWAPDI BYTE $0x0f; BYTE $0xcf; - -#define BODY(off,FN,V,A,B,C,D,E)\ - movl (off-64)(%ebp), %edi;\ - xorl (off-56)(%ebp), %edi;\ - xorl (off-32)(%ebp), %edi;\ - xorl (off-12)(%ebp), %edi;\ - roll $1, %edi;\ - movl %edi, off(%ebp);\ - leal V(%edi, E, 1), E;\ - movl A, %edi;\ - roll $5, %edi;\ - addl %edi, E;\ - FN(B,C,D)\ - addl %edi, E;\ - rorl $2, B;\ - -#define BODY0(off,FN,V,A,B,C,D,E)\ - movl off(%ebx), %edi;\ - bswap %edi;\ - movl %edi, off(%ebp);\ - leal V(%edi,E,1), E;\ - movl A, %edi;\ - roll $5,%edi;\ - addl %edi,E;\ - FN(B,C,D)\ - addl %edi,E;\ - rorl $2,B;\ - -/* - * fn1 = (((C^D)&B)^D); - */ -#define FN1(B,C,D)\ - movl C, %edi;\ - xorl D, %edi;\ - andl B, %edi;\ - xorl D, %edi;\ - -/* - * fn24 = B ^ C ^ D - */ -#define FN24(B,C,D)\ - movl B, %edi;\ - xorl C, %edi;\ - xorl D, %edi;\ - -/* - * fn3 = ((B ^ C) & (D ^= B)) ^ B - * D ^= B to restore D - */ -#define FN3(B,C,D)\ - movl B, %edi;\ - xorl C, %edi;\ - xorl B, D;\ - andl D, %edi;\ - xorl B, %edi;\ - xorl B, D;\ - -/* - * stack offsets - * void sha1block(uchar *DATA, int LEN, ulong *STATE) - */ -#define STACKSIZE (48+80*4) -#define DATA (STACKSIZE+8) -#define LEN (STACKSIZE+12) -#define STATE (STACKSIZE+16) - -/* - * stack offsets for locals - * ulong w[80]; - * uchar *edata; - * ulong *w15, *w40, *w60, *w80; - * register local - * ulong *wp = %ebp - * ulong a = eax, b = ebx, c = ecx, d = edx, e = esi - * ulong tmp = edi - */ -#define WARRAY (STACKSIZE-4-(80*4)) -#define TMP1 (STACKSIZE-8-(80*4)) -#define TMP2 (STACKSIZE-12-(80*4)) -#define W15 (STACKSIZE-16-(80*4)) -#define W40 (STACKSIZE-20-(80*4)) -#define W60 (STACKSIZE-24-(80*4)) -#define W80 (STACKSIZE-28-(80*4)) -#define EDATA (STACKSIZE-32-(80*4)) -#define OLDEBX (STACKSIZE-36-(80*4)) -#define OLDESI (STACKSIZE-40-(80*4)) -#define OLDEDI (STACKSIZE-44-(80*4)) - - /* Prelude */ - pushl %ebp - subl $(STACKSIZE), %esp - - mov %ebx, OLDEBX(%esp) - mov %esi, OLDESI(%esp) - mov %edi, OLDEDI(%esp) - - movl DATA(%esp), %eax - addl LEN(%esp), %eax - movl %eax, EDATA(%esp) - - leal (WARRAY+15*4)(%esp), %edi /* aw15 */ - movl %edi, W15(%esp) - leal (WARRAY+40*4)(%esp), %edx /* aw40 */ - movl %edx, W40(%esp) - leal (WARRAY+60*4)(%esp), %ecx /* aw60 */ - movl %ecx, W60(%esp) - leal (WARRAY+80*4)(%esp), %edi /* aw80 */ - movl %edi, W80(%esp) - -0: - leal WARRAY(%esp), %ebp /* warray */ - - movl STATE(%esp), %edi /* state */ - movl (%edi),%eax - movl 4(%edi),%ebx - movl %ebx, TMP1(%esp) /* tmp1 */ - movl 8(%edi), %ecx - movl 12(%edi), %edx - movl 16(%edi), %esi - - movl DATA(%esp), %ebx /* data */ - -1: - BODY0(0,FN1,0x5a827999,%eax,TMP1(%esp),%ecx,%edx,%esi) - movl %esi,TMP2(%esp) - BODY0(4,FN1,0x5a827999,%esi,%eax,TMP1(%esp),%ecx,%edx) - movl TMP1(%esp),%esi - BODY0(8,FN1,0x5a827999,%edx,TMP2(%esp),%eax,%esi,%ecx) - BODY0(12,FN1,0x5a827999,%ecx,%edx,TMP2(%esp),%eax,%esi) - movl %esi,TMP1(%esp) - BODY0(16,FN1,0x5a827999,%esi,%ecx,%edx,TMP2(%esp),%eax) - movl TMP2(%esp),%esi - - addl $20, %ebx - addl $20, %ebp - cmpl W15(%esp), %ebp /* w15 */ - jb 1b - - BODY0(0,FN1,0x5a827999,%eax,TMP1(%esp),%ecx,%edx,%esi) - addl $4, %ebx - movl %ebx, DATA(%esp) /* data */ - movl TMP1(%esp),%ebx - - BODY(4,FN1,0x5a827999,%esi,%eax,%ebx,%ecx,%edx) - BODY(8,FN1,0x5a827999,%edx,%esi,%eax,%ebx,%ecx) - BODY(12,FN1,0x5a827999,%ecx,%edx,%esi,%eax,%ebx) - BODY(16,FN1,0x5a827999,%ebx,%ecx,%edx,%esi,%eax) - - addl $20, %ebp - -2: - BODY(0,FN24,0x6ed9eba1,%eax,%ebx,%ecx,%edx,%esi) - BODY(4,FN24,0x6ed9eba1,%esi,%eax,%ebx,%ecx,%edx) - BODY(8,FN24,0x6ed9eba1,%edx,%esi,%eax,%ebx,%ecx) - BODY(12,FN24,0x6ed9eba1,%ecx,%edx,%esi,%eax,%ebx) - BODY(16,FN24,0x6ed9eba1,%ebx,%ecx,%edx,%esi,%eax) - - addl $20,%ebp - cmpl W40(%esp), %ebp - jb 2b - -3: - BODY(0,FN3,0x8f1bbcdc,%eax,%ebx,%ecx,%edx,%esi) - BODY(4,FN3,0x8f1bbcdc,%esi,%eax,%ebx,%ecx,%edx) - BODY(8,FN3,0x8f1bbcdc,%edx,%esi,%eax,%ebx,%ecx) - BODY(12,FN3,0x8f1bbcdc,%ecx,%edx,%esi,%eax,%ebx) - BODY(16,FN3,0x8f1bbcdc,%ebx,%ecx,%edx,%esi,%eax) - - addl $20, %ebp - cmpl W60(%esp), %ebp /* w60 */ - jb 3b - -4: - BODY(0,FN24,0xca62c1d6,%eax,%ebx,%ecx,%edx,%esi) - BODY(4,FN24,0xca62c1d6,%esi,%eax,%ebx,%ecx,%edx) - BODY(8,FN24,0xca62c1d6,%edx,%esi,%eax,%ebx,%ecx) - BODY(12,FN24,0xca62c1d6,%ecx,%edx,%esi,%eax,%ebx) - BODY(16,FN24,0xca62c1d6,%ebx,%ecx,%edx,%esi,%eax) - - addl $20, %ebp - cmpl W80(%esp), %ebp /* w80 */ - jb 4b - - movl STATE(%esp), %edi /* state */ - addl %eax, 0(%edi) - addl %ebx, 4(%edi) - addl %ecx, 8(%edi) - addl %edx, 12(%edi) - addl %esi, 16(%edi) - - movl EDATA(%esp), %edi /* edata */ - cmpl %edi, DATA(%esp) /* data */ - jb 0b - - /* Postlude */ - mov OLDEBX(%esp), %ebx - mov OLDESI(%esp), %esi - mov OLDEDI(%esp), %edi - addl $(STACKSIZE), %esp - popl %ebp - ret diff --git a/src/libsec/PowerMacintosh/mkfile b/src/libsec/PowerMacintosh/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libsec/PowerMacintosh/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libsec/arm/mkfile b/src/libsec/arm/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libsec/arm/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libsec/arm64/mkfile b/src/libsec/arm64/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libsec/arm64/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libsec/mips/mkfile b/src/libsec/mips/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libsec/mips/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libsec/mkfile b/src/libsec/mkfile index e3f1aa69..81f237c4 100644 --- a/src/libsec/mkfile +++ b/src/libsec/mkfile @@ -2,6 +2,6 @@ DIRS=\ port\ - $OBJTYPE\ +# $OBJTYPE\ <$PLAN9/src/mkdirs diff --git a/src/libsec/port/mkfile b/src/libsec/port/mkfile index 60baf2a3..7db34a97 100644 --- a/src/libsec/port/mkfile +++ b/src/libsec/port/mkfile @@ -54,7 +54,8 @@ ALLOFILES=\ tlshand.$O\ x509.$O\ -OFILES=`{sh ./reduce $O $OBJTYPE $ALLOFILES} +# OFILES=`{sh ./reduce $O $OBJTYPE $ALLOFILES} +OFILES=$ALLOFILES HFILES=$PLAN9/include/libsec.h <$PLAN9/src/mksyslib diff --git a/src/libsec/power/mkfile b/src/libsec/power/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libsec/power/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libsec/sparc64/mkfile b/src/libsec/sparc64/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libsec/sparc64/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libsec/sun4u/mkfile b/src/libsec/sun4u/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libsec/sun4u/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libsec/x86_64/mkfile b/src/libsec/x86_64/mkfile deleted file mode 100644 index 43a4662b..00000000 --- a/src/libsec/x86_64/mkfile +++ /dev/null @@ -1,4 +0,0 @@ -all: - -%:V: - # nothing to see here diff --git a/src/libthread/386-ucontext.c b/src/libthread/386-ucontext.c deleted file mode 100644 index 3afa9513..00000000 --- a/src/libthread/386-ucontext.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "threadimpl.h" - -void -makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) -{ - int *sp; - - sp = USPALIGN(ucp, 4); - sp -= argc; - memmove(sp, &argc+1, argc*sizeof(int)); - *--sp = 0; /* return address */ - ucp->uc_mcontext.mc_eip = (long)func; - ucp->uc_mcontext.mc_esp = (int)sp; -} - -int -swapcontext(ucontext_t *oucp, ucontext_t *ucp) -{ - if(getcontext(oucp) == 0) - setcontext(ucp); - return 0; -} diff --git a/src/libthread/386-ucontext.h b/src/libthread/386-ucontext.h deleted file mode 100644 index b1ee81b3..00000000 --- a/src/libthread/386-ucontext.h +++ /dev/null @@ -1,119 +0,0 @@ -#define setcontext(u) setmcontext(&(u)->uc_mcontext) -#define getcontext(u) getmcontext(&(u)->uc_mcontext) -typedef struct mcontext mcontext_t; -typedef struct ucontext ucontext_t; - -extern int swapcontext(ucontext_t*, ucontext_t*); -extern void makecontext(ucontext_t*, void(*)(), int, ...); -extern int getmcontext(mcontext_t*); -extern void setmcontext(mcontext_t*); - -/*- - * Copyright (c) 1999 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/sys/ucontext.h,v 1.4 1999/10/11 20:33:17 luoqi Exp $ - */ - -/* #include */ - -/*- - * Copyright (c) 1999 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/include/ucontext.h,v 1.4 1999/10/11 20:33:09 luoqi Exp $ - */ - -struct mcontext { - /* - * The first 20 fields must match the definition of - * sigcontext. So that we can support sigcontext - * and ucontext_t at the same time. - */ - int mc_onstack; /* XXX - sigcontext compat. */ - int mc_gs; - int mc_fs; - int mc_es; - int mc_ds; - int mc_edi; - int mc_esi; - int mc_ebp; - int mc_isp; - int mc_ebx; - int mc_edx; - int mc_ecx; - int mc_eax; - int mc_trapno; - int mc_err; - int mc_eip; - int mc_cs; - int mc_eflags; - int mc_esp; /* machine state */ - int mc_ss; - - int mc_fpregs[28]; /* env87 + fpacc87 + u_long */ - int __spare__[17]; -}; - -struct ucontext { - /* - * Keep the order of the first two fields. Also, - * keep them the first two fields in the structure. - * This way we can have a union with struct - * sigcontext and ucontext_t. This allows us to - * support them both at the same time. - * note: the union is not defined, though. - */ - sigset_t uc_sigmask; - mcontext_t uc_mcontext; - - struct __ucontext *uc_link; - stack_t uc_stack; - int __spare__[8]; -}; diff --git a/src/libthread/COPYING.SPARC64-CONTEXT b/src/libthread/COPYING.SPARC64-CONTEXT deleted file mode 100644 index 3b204400..00000000 --- a/src/libthread/COPYING.SPARC64-CONTEXT +++ /dev/null @@ -1,458 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/src/libthread/COPYRIGHT b/src/libthread/COPYRIGHT index d0820965..212b96bc 100644 --- a/src/libthread/COPYRIGHT +++ b/src/libthread/COPYRIGHT @@ -42,12 +42,3 @@ Contains parts of an earlier library that has: * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. */ - -=== - -The above notices do *NOT* apply to Linux-sparc64-context.S -or to sparc64-ucontext.c. Those are functions from -the GNU C library and are provided for systems that use the GNU C -library but somehow are missing those functions. They are -distributed under the Lesser GPL; see COPYING.SPARC64-CONTEXT. - diff --git a/src/libthread/Darwin-x86_64-asm.s b/src/libthread/Darwin-x86_64-asm.s deleted file mode 100644 index d50d3b6d..00000000 --- a/src/libthread/Darwin-x86_64-asm.s +++ /dev/null @@ -1,44 +0,0 @@ -.text -.align 8 - -.globl _libthread_getmcontext -_libthread_getmcontext: - movq $1, 0*8(%rdi) // rax - movq %rbx, 1*8(%rdi) - movq %rcx, 2*8(%rdi) - movq %rdx, 3*8(%rdi) - movq %rsi, 4*8(%rdi) - movq %rdi, 5*8(%rdi) - movq %rbp, 6*8(%rdi) - movq %rsp, 7*8(%rdi) - movq %r8, 8*8(%rdi) - movq %r9, 9*8(%rdi) - movq %r10, 10*8(%rdi) - movq %r11, 11*8(%rdi) - movq %r12, 12*8(%rdi) - movq %r13, 13*8(%rdi) - movq %r14, 14*8(%rdi) - movq %r15, 15*8(%rdi) - movq $0, %rax - ret - -.globl _libthread_setmcontext -_libthread_setmcontext: - movq 0*8(%rdi), %rax - movq 1*8(%rdi), %rbx - movq 2*8(%rdi), %rcx - movq 3*8(%rdi), %rdx - movq 4*8(%rdi), %rsi - // %rdi later - movq 6*8(%rdi), %rbp - movq 7*8(%rdi), %rsp - movq 8*8(%rdi), %r8 - movq 9*8(%rdi), %r9 - movq 10*8(%rdi), %r10 - movq 11*8(%rdi), %r11 - movq 12*8(%rdi), %r12 - movq 13*8(%rdi), %r13 - movq 14*8(%rdi), %r14 - movq 15*8(%rdi), %r15 - movq 5*8(%rdi), %rdi - ret diff --git a/src/libthread/Linux-arm-asm.s b/src/libthread/Linux-arm-asm.s deleted file mode 100644 index 9bd54f8a..00000000 --- a/src/libthread/Linux-arm-asm.s +++ /dev/null @@ -1,41 +0,0 @@ -.globl mygetmcontext -mygetmcontext: - str r1, [r0,#4] - str r2, [r0,#8] - str r3, [r0,#12] - str r4, [r0,#16] - str r5, [r0,#20] - str r6, [r0,#24] - str r7, [r0,#28] - str r8, [r0,#32] - str r9, [r0,#36] - str r10, [r0,#40] - str r11, [r0,#44] - str r12, [r0,#48] - str r13, [r0,#52] - str r14, [r0,#56] - /* store 1 as r0-to-restore */ - mov r1, #1 - str r1, [r0] - /* return 0 */ - mov r0, #0 - mov pc, lr - -.globl mysetmcontext -mysetmcontext: - ldr r1, [r0,#4] - ldr r2, [r0,#8] - ldr r3, [r0,#12] - ldr r4, [r0,#16] - ldr r5, [r0,#20] - ldr r6, [r0,#24] - ldr r7, [r0,#28] - ldr r8, [r0,#32] - ldr r9, [r0,#36] - ldr r10, [r0,#40] - ldr r11, [r0,#44] - ldr r12, [r0,#48] - ldr r13, [r0,#52] - ldr r14, [r0,#56] - ldr r0, [r0] - mov pc, lr diff --git a/src/libthread/Linux-sparc64-context.S b/src/libthread/Linux-sparc64-context.S deleted file mode 100644 index 1cc38391..00000000 --- a/src/libthread/Linux-sparc64-context.S +++ /dev/null @@ -1,135 +0,0 @@ -/* Copyright (C) 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek . - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* Constants shared between setcontext() and getcontext(). Don't - install this header file. */ - - -#define UC_LINK 0 -#define __UC_SIGMASK 16 -#define UC_M_PC 40 -#define UC_M_NPC 48 -#define UC_SIGMASK 536 -#define SIGMASK_WORDS 16 - -/* Copyright (C) 1997, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Richard Henderson (rth@tamu.edu). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#define ENTRY(x) x: -#define END(x) - -/*#include "ucontext_i.h" (up above) */ - -/* int getcontext(ucontext_t *); */ - -ENTRY(getcontext) - - ldx [%o0 + UC_LINK], %o1 /* Preserve uc_link field, the - trap clears it. */ - ta 0x6e -1: - ldx [%o0 + UC_M_PC], %o2 - ldx [%o0 + UC_M_NPC], %o3 - ldx [%o0 + __UC_SIGMASK], %o4 - stx %o1, [%o0 + UC_LINK] - add %o2, 2f - 1b, %o2 - stx %o2, [%o0 + UC_M_PC] - add %o3, 2f - 1b, %o3 - stx %o3, [%o0 + UC_M_NPC] -#if SIGMASK_WORDS == 16 - stx %o4, [%o0 + UC_SIGMASK] - stx %g0, [%o0 + UC_SIGMASK + 8] - stx %g0, [%o0 + UC_SIGMASK + 16] - stx %g0, [%o0 + UC_SIGMASK + 24] - stx %g0, [%o0 + UC_SIGMASK + 32] - stx %g0, [%o0 + UC_SIGMASK + 40] - stx %g0, [%o0 + UC_SIGMASK + 48] - stx %g0, [%o0 + UC_SIGMASK + 56] - stx %g0, [%o0 + UC_SIGMASK + 64] - stx %g0, [%o0 + UC_SIGMASK + 72] - stx %g0, [%o0 + UC_SIGMASK + 80] - stx %g0, [%o0 + UC_SIGMASK + 88] - stx %g0, [%o0 + UC_SIGMASK + 96] - stx %g0, [%o0 + UC_SIGMASK + 104] - stx %g0, [%o0 + UC_SIGMASK + 112] - stx %g0, [%o0 + UC_SIGMASK + 120] -#else -# error Adjust getcontext -#endif -2: - retl - clr %o0 - -END(getcontext) - -/* Copyright (C) 1997, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Richard Henderson (rth@tamu.edu). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* -#include -#include "ucontext_i.h" -*/ - -/* int setcontext(ucontext_t *ctx); */ -.weak setcontext -ENTRY(setcontext) - - mov 1, %o1 - -/* int __setcontext(ucontext_t *ctx, int restoremask); */ -ENTRY(__setcontext) - - ldx [%o0 + UC_SIGMASK], %o2 - stx %o2, [%o0 + __UC_SIGMASK] - ta 0x6f - -END(__setcontext) - diff --git a/src/libthread/NetBSD-386-asm.s b/src/libthread/NetBSD-386-asm.s deleted file mode 100644 index 197f12b5..00000000 --- a/src/libthread/NetBSD-386-asm.s +++ /dev/null @@ -1,7 +0,0 @@ -.globl _tas -_tas: - movl $0xCAFEBABE, %eax - movl 4(%esp), %ecx - xchgl %eax, 0(%ecx) - ret - diff --git a/src/libthread/NetBSD-power-asm.s b/src/libthread/NetBSD-power-asm.s deleted file mode 100644 index d6e21c15..00000000 --- a/src/libthread/NetBSD-power-asm.s +++ /dev/null @@ -1,16 +0,0 @@ - .globl _tas -_tas: - li %r0, 0 - mr %r4, %r3 - lis %r5, 0xcafe - ori %r5, %r5, 0xbabe -1: - lwarx %r3, %r0, %r4 - cmpwi %r3, 0 - bne 2f - stwcx. %r5, %r0, %r4 - bne- 1b -2: - sync - blr - diff --git a/src/libthread/NetBSD.c b/src/libthread/NetBSD.c deleted file mode 100644 index 2b14146b..00000000 --- a/src/libthread/NetBSD.c +++ /dev/null @@ -1,437 +0,0 @@ -#include "threadimpl.h" - -#undef exits -#undef _exits - -static int -timefmt(Fmt *fmt) -{ - static char *mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; - vlong ns; - Tm tm; - ns = nsec(); - tm = *localtime(time(0)); - return fmtprint(fmt, "%s %2d %02d:%02d:%02d.%03d", - mon[tm.mon], tm.mday, tm.hour, tm.min, tm.sec, - (int)(ns%1000000000)/1000000); -} - -/* - * spin locks - */ -extern int _tas(int*); - -void -_threadunlock(Lock *l, ulong pc) -{ - USED(pc); - - l->held = 0; -} - -int -_threadlock(Lock *l, int block, ulong pc) -{ - int i; -static int first=1; -if(first) {first=0; fmtinstall('\001', timefmt);} - - USED(pc); - - /* once fast */ - if(!_tas(&l->held)) - return 1; - if(!block) - return 0; - - /* a thousand times pretty fast */ - for(i=0; i<1000; i++){ - if(!_tas(&l->held)) - return 1; - sched_yield(); - } - /* now increasingly slow */ - for(i=0; i<10; i++){ - if(!_tas(&l->held)) - return 1; - usleep(1); - } -fprint(2, "%\001 %s: lock loop1 %p from %lux\n", argv0, l, pc); - for(i=0; i<10; i++){ - if(!_tas(&l->held)) - return 1; - usleep(10); - } -fprint(2, "%\001 %s: lock loop2 %p from %lux\n", argv0, l, pc); - for(i=0; i<10; i++){ - if(!_tas(&l->held)) - return 1; - usleep(100); - } -fprint(2, "%\001 %s: lock loop3 %p from %lux\n", argv0, l, pc); - for(i=0; i<10; i++){ - if(!_tas(&l->held)) - return 1; - usleep(1000); - } -fprint(2, "%\001 %s: lock loop4 %p from %lux\n", argv0, l, pc); - for(i=0; i<10; i++){ - if(!_tas(&l->held)) - return 1; - usleep(10*1000); - } -fprint(2, "%\001 %s: lock loop5 %p from %lux\n", argv0, l, pc); - for(i=0; i<1000; i++){ - if(!_tas(&l->held)) - return 1; - usleep(100*1000); - } -fprint(2, "%\001 %s: lock loop6 %p from %lux\n", argv0, l, pc); - /* take your time */ - while(_tas(&l->held)) - usleep(1000*1000); - return 1; -} - -/* - * sleep and wakeup - */ -static void -ign(int x) -{ - USED(x); -} - -static void /*__attribute__((constructor))*/ -ignusr1(int restart) -{ - struct sigaction sa; - - memset(&sa, 0, sizeof sa); - sa.sa_handler = ign; - sigemptyset(&sa.sa_mask); - sigaddset(&sa.sa_mask, SIGUSR1); - if(restart) - sa.sa_flags = SA_RESTART; - sigaction(SIGUSR1, &sa, nil); -} - -void -_procsleep(_Procrendez *r) -{ - sigset_t mask; - - /* - * Go to sleep. - * - * Block USR1, set the handler to interrupt system calls, - * unlock the vouslock so our waker can wake us, - * and then suspend. - */ -again: - r->asleep = 1; - r->pid = getpid(); - - sigprocmask(SIG_SETMASK, nil, &mask); - sigaddset(&mask, SIGUSR1); - sigprocmask(SIG_SETMASK, &mask, nil); - ignusr1(0); - unlock(r->l); - sigdelset(&mask, SIGUSR1); - sigsuspend(&mask); - - /* - * We're awake. Make USR1 not interrupt system calls. - */ - lock(r->l); - ignusr1(1); - if(r->asleep && r->pid == getpid()){ - /* Didn't really wake up - signal from something else */ - goto again; - } -} - -void -_procwakeupandunlock(_Procrendez *r) -{ - int pid; - - pid = 0; - if(r->asleep){ - r->asleep = 0; - assert(r->pid >= 1); - pid = r->pid; - } - assert(r->l); - unlock(r->l); - if(pid) - kill(pid, SIGUSR1); -} - -/* - * process creation and exit - */ -typedef struct Stackfree Stackfree; -struct Stackfree -{ - Stackfree *next; - int pid; - int pid1; -}; -static Lock stacklock; -static Stackfree *stackfree; - -static void -delayfreestack(uchar *stk, int pid, int pid1) -{ - Stackfree *sf; - - sf = (Stackfree*)stk; - sf->pid = pid; - sf->pid1 = pid1; - lock(&stacklock); - sf->next = stackfree; - stackfree = sf; - unlock(&stacklock); -} - -static void -dofreestacks(void) -{ - Stackfree *sf, *last, *next; - - if(stackfree==nil || !canlock(&stacklock)) - return; - - for(last=nil,sf=stackfree; sf; last=sf,sf=next){ - next = sf->next; - if(sf->pid >= 1 && kill(sf->pid, 0) < 0 && errno == ESRCH) - if(sf->pid1 >= 1 && kill(sf->pid1, 0) < 0 && errno == ESRCH){ - free(sf); - if(last) - last->next = next; - else - stackfree = next; - sf = last; - } - } - unlock(&stacklock); -} - -static int -startprocfn(void *v) -{ - void **a; - uchar *stk; - void (*fn)(void*); - Proc *p; - int pid0, pid1; - - a = (void**)v; - fn = a[0]; - p = a[1]; - stk = a[2]; - pid0 = (int)a[4]; - pid1 = getpid(); - free(a); - p->osprocid = pid1; - - (*fn)(p); - - delayfreestack(stk, pid0, pid1); - _exit(0); - return 0; -} - -/* - * indirect through here so that parent need not wait for child zombie - * - * slight race - if child exits and then another process starts before we - * manage to exit, we'll be running on a freed stack. - */ -static int -trampnowait(void *v) -{ - void **a; - int *kidpid; - - a = (void*)v; - kidpid = a[3]; - a[4] = (void*)getpid(); - *kidpid = clone(startprocfn, a[2]+65536-512, CLONE_VM|CLONE_FILES, a); - _exit(0); - return 0; -} - -void -_procstart(Proc *p, void (*fn)(Proc*)) -{ - void **a; - uchar *stk; - int pid, kidpid, status; - - dofreestacks(); - a = malloc(5*sizeof a[0]); - if(a == nil) - sysfatal("_procstart malloc: %r"); - stk = malloc(65536); - if(stk == nil) - sysfatal("_procstart malloc stack: %r"); - - a[0] = fn; - a[1] = p; - a[2] = stk; - a[3] = &kidpid; - kidpid = -1; - - pid = clone(trampnowait, stk+65536-16, CLONE_VM|CLONE_FILES, a); - if(pid > 0) - if(wait4(pid, &status, __WALL, 0) < 0) - fprint(2, "ffork wait4: %r\n"); - if(pid < 0 || kidpid < 0){ - fprint(2, "_procstart clone: %r\n"); - abort(); - } -} - -static char *threadexitsmsg; -void -sigusr2handler(int s) -{ -/* fprint(2, "%d usr2 %d\n", time(0), getpid()); */ - if(threadexitsmsg) - _exits(threadexitsmsg); -} - -void -threadexitsall(char *msg) -{ - static int pid[1024]; - int i, npid, mypid; - Proc *p; - - if(msg == nil) - msg = ""; - - /* - * Only one guy, ever, gets to run this. - * If two guys do it, inevitably they end up - * tripping over each other in the underlying - * C library exit() implementation, which is - * trying to run the atexit handlers and apparently - * not thread safe. This has been observed on - * both Linux and OpenBSD. Sigh. - */ - { - static Lock onelock; - if(!canlock(&onelock)) - _exits(threadexitsmsg); - threadexitsmsg = msg; - } - - mypid = getpid(); - lock(&_threadprocslock); - npid = 0; - for(p=_threadprocs; p; p=p->next) - if(p->osprocid != mypid && p->osprocid >= 1) - pid[npid++] = p->osprocid; - for(i=0; ipid == pid) - return p; - if(p->pid == 0){ - print("found 0 at %d (h=%d)\n", (i+h)%nelem(perproc), h); - break; - } - } - fprint(2, "myperproc %d (%s): cannot find self\n", pid, argv0); - abort(); - return nil; -} - -static Perproc* -newperproc(void) -{ - int i, pid, h; - Perproc *p; - - lock(&perlock); - pid = getpid(); - h = pid%nelem(perproc); - for(i=0; ipid == pid || p->pid == -1 || p->pid == 0){ - p->pid = pid; - unlock(&perlock); - return p; - } - } - fprint(2, "newperproc %d: out of procs\n", pid); - abort(); - return nil; -} - -Proc* -_threadproc(void) -{ - return myperproc()->proc; -} - -void -_threadsetproc(Proc *p) -{ - Perproc *pp; - - if(p) - p->osprocid = getpid(); - pp = newperproc(); - pp->proc = p; - if(p == nil) - pp->pid = -1; -} - -void -_pthreadinit(void) -{ - signal(SIGUSR2, sigusr2handler); -} - -void -_threadpexit(void) -{ - _exit(0); -} diff --git a/src/libthread/OpenBSD-386-asm.s b/src/libthread/OpenBSD-386-asm.s deleted file mode 100644 index ed18d2f0..00000000 --- a/src/libthread/OpenBSD-386-asm.s +++ /dev/null @@ -1,45 +0,0 @@ -.globl getmcontext -getmcontext: - movl 4(%esp), %eax - - movl %fs, 8(%eax) - movl %es, 12(%eax) - movl %ds, 16(%eax) - movl %ss, 76(%eax) - movl %edi, 20(%eax) - movl %esi, 24(%eax) - movl %ebp, 28(%eax) - movl %ebx, 36(%eax) - movl %edx, 40(%eax) - movl %ecx, 44(%eax) - - movl $1, 48(%eax) /* %eax */ - movl (%esp), %ecx /* %eip */ - movl %ecx, 60(%eax) - leal 4(%esp), %ecx /* %esp */ - movl %ecx, 72(%eax) - - movl 44(%eax), %ecx /* restore %ecx */ - movl $0, %eax - ret - -.globl setmcontext -setmcontext: - movl 4(%esp), %eax - - movl 8(%eax), %fs - movl 12(%eax), %es - movl 16(%eax), %ds - movl 76(%eax), %ss - movl 20(%eax), %edi - movl 24(%eax), %esi - movl 28(%eax), %ebp - movl 36(%eax), %ebx - movl 40(%eax), %edx - movl 44(%eax), %ecx - - movl 72(%eax), %esp - pushl 60(%eax) /* new %eip */ - movl 48(%eax), %eax - ret - diff --git a/src/libthread/OpenBSD-power-asm.S b/src/libthread/OpenBSD-power-asm.S deleted file mode 100644 index 36035eb5..00000000 --- a/src/libthread/OpenBSD-power-asm.S +++ /dev/null @@ -1,73 +0,0 @@ -ENTRY(_getmcontext) /* xxx: instruction scheduling */ - mflr %r0 - mfcr %r5 - mfctr %r6 - mfxer %r7 - stw %r0, 0*4(%r3) - stw %r5, 1*4(%r3) - stw %r6, 2*4(%r3) - stw %r7, 3*4(%r3) - - stw %r1, 4*4(%r3) - stw %r2, 5*4(%r3) - li %r5, 1 /* return value for setmcontext */ - stw %r5, 6*4(%r3) - - stw %r13, (0+7)*4(%r3) /* callee-save GPRs */ - stw %r14, (1+7)*4(%r3) /* xxx: block move */ - stw %r15, (2+7)*4(%r3) - stw %r16, (3+7)*4(%r3) - stw %r17, (4+7)*4(%r3) - stw %r18, (5+7)*4(%r3) - stw %r19, (6+7)*4(%r3) - stw %r20, (7+7)*4(%r3) - stw %r21, (8+7)*4(%r3) - stw %r22, (9+7)*4(%r3) - stw %r23, (10+7)*4(%r3) - stw %r24, (11+7)*4(%r3) - stw %r25, (12+7)*4(%r3) - stw %r26, (13+7)*4(%r3) - stw %r27, (14+7)*4(%r3) - stw %r28, (15+7)*4(%r3) - stw %r29, (16+7)*4(%r3) - stw %r30, (17+7)*4(%r3) - stw %r31, (18+7)*4(%r3) - - li %r3, 0 /* return */ - blr - -ENTRY(_setmcontext) - lwz %r13, (0+7)*4(%r3) /* callee-save GPRs */ - lwz %r14, (1+7)*4(%r3) /* xxx: block move */ - lwz %r15, (2+7)*4(%r3) - lwz %r16, (3+7)*4(%r3) - lwz %r17, (4+7)*4(%r3) - lwz %r18, (5+7)*4(%r3) - lwz %r19, (6+7)*4(%r3) - lwz %r20, (7+7)*4(%r3) - lwz %r21, (8+7)*4(%r3) - lwz %r22, (9+7)*4(%r3) - lwz %r23, (10+7)*4(%r3) - lwz %r24, (11+7)*4(%r3) - lwz %r25, (12+7)*4(%r3) - lwz %r26, (13+7)*4(%r3) - lwz %r27, (14+7)*4(%r3) - lwz %r28, (15+7)*4(%r3) - lwz %r29, (16+7)*4(%r3) - lwz %r30, (17+7)*4(%r3) - lwz %r31, (18+7)*4(%r3) - - lwz %r1, 4*4(%r3) - lwz %r2, 5*4(%r3) - - lwz %r0, 0*4(%r3) - mtlr %r0 - lwz %r0, 1*4(%r3) - mtcr %r0 /* mtcrf 0xFF, %r0 */ - lwz %r0, 2*4(%r3) - mtctr %r0 - lwz %r0, 3*4(%r3) - mtxer %r0 - - lwz %r3, 6*4(%r3) - blr diff --git a/src/libthread/OpenBSD-x86_64-asm.S b/src/libthread/OpenBSD-x86_64-asm.S deleted file mode 100644 index e982cdef..00000000 --- a/src/libthread/OpenBSD-x86_64-asm.S +++ /dev/null @@ -1,44 +0,0 @@ -.text -.align 8 - -.globl libthread_getmcontext -libthread_getmcontext: - movq $1, 0*8(%rdi) // rax - movq %rbx, 1*8(%rdi) - movq %rcx, 2*8(%rdi) - movq %rdx, 3*8(%rdi) - movq %rsi, 4*8(%rdi) - movq %rdi, 5*8(%rdi) - movq %rbp, 6*8(%rdi) - movq %rsp, 7*8(%rdi) - movq %r8, 8*8(%rdi) - movq %r9, 9*8(%rdi) - movq %r10, 10*8(%rdi) - movq %r11, 11*8(%rdi) - movq %r12, 12*8(%rdi) - movq %r13, 13*8(%rdi) - movq %r14, 14*8(%rdi) - movq %r15, 15*8(%rdi) - movq $0, %rax - ret - -.globl libthread_setmcontext -libthread_setmcontext: - movq 0*8(%rdi), %rax - movq 1*8(%rdi), %rbx - movq 2*8(%rdi), %rcx - movq 3*8(%rdi), %rdx - movq 4*8(%rdi), %rsi - // %rdi later - movq 6*8(%rdi), %rbp - movq 7*8(%rdi), %rsp - movq 8*8(%rdi), %r8 - movq 9*8(%rdi), %r9 - movq 10*8(%rdi), %r10 - movq 11*8(%rdi), %r11 - movq 12*8(%rdi), %r12 - movq 13*8(%rdi), %r13 - movq 14*8(%rdi), %r14 - movq 15*8(%rdi), %r15 - movq 5*8(%rdi), %rdi - ret diff --git a/src/libthread/arm-ucontext.c b/src/libthread/arm-ucontext.c deleted file mode 100644 index 512ca973..00000000 --- a/src/libthread/arm-ucontext.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "threadimpl.h" - -void -makecontext(ucontext_t *uc, void (*fn)(void), int argc, ...) -{ - int i, *sp; - va_list arg; - - sp = USPALIGN(uc, 4); - va_start(arg, argc); - for(i=0; i<4 && iuc_mcontext.arm_r0)[i] = va_arg(arg, uint); - va_end(arg); - uc->uc_mcontext.arm_sp = (uint)sp; - uc->uc_mcontext.arm_lr = (uint)fn; -} - -int -swapcontext(ucontext_t *oucp, const ucontext_t *ucp) -{ - if(getcontext(oucp) == 0) - setcontext(ucp); - return 0; -} diff --git a/src/libthread/bg.c b/src/libthread/bg.c new file mode 100644 index 00000000..2edbc0e4 --- /dev/null +++ b/src/libthread/bg.c @@ -0,0 +1,7 @@ +#include "threadimpl.h" + +int +threadmaybackground(void) +{ + return 0; +} diff --git a/src/libthread/daemonize.c b/src/libthread/daemonize.c index 387d1527..89efaf5d 100644 --- a/src/libthread/daemonize.c +++ b/src/libthread/daemonize.c @@ -8,7 +8,7 @@ #undef wait static int sigpid; -static int threadpassfd; +static int threadpassfd = -1; static int gotsigchld; static void @@ -101,6 +101,13 @@ _threadsetupdaemonize(void) sigpid = 1; + /* + * We've been told this program is likely to background itself. + * Put it in its own process group so that we don't get a SIGHUP + * when the parent exits. + */ + setpgid(0, 0); + if(pipe(p) < 0) sysfatal("passer pipe: %r"); @@ -163,9 +170,9 @@ _threadsetupdaemonize(void) void _threaddaemonize(void) { - if(threadpassfd >= 0){ - write(threadpassfd, "0", 1); - close(threadpassfd); - threadpassfd = -1; - } + if(threadpassfd < 0) + sysfatal("threads in main proc exited w/o threadmaybackground"); + write(threadpassfd, "0", 1); + close(threadpassfd); + threadpassfd = -1; } diff --git a/src/libthread/mkfile b/src/libthread/mkfile index 8a77a316..40941f43 100644 --- a/src/libthread/mkfile +++ b/src/libthread/mkfile @@ -1,14 +1,14 @@ <$PLAN9/src/mkhdr -SYSOFILES=`{sh ./sysofiles.sh} LIB=libthread.a OFILES=\ - $SYSOFILES\ + bg.$O\ channel.$O\ daemonize.$O\ exec.$O\ ioproc.$O\ iorw.$O\ + pthread.$O\ ref.$O\ thread.$O\ wait.$O\ diff --git a/src/libthread/power-ucontext.c b/src/libthread/power-ucontext.c deleted file mode 100644 index 32a8e931..00000000 --- a/src/libthread/power-ucontext.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "threadimpl.h" - -void -makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) -{ - ulong *sp, *tos; - va_list arg; - - if(argc != 2) - sysfatal("libthread: makecontext misused"); - sp = USPALIGN(ucp, 16); - ucp->mc.pc = (long)func; - ucp->mc.sp = (long)sp; - va_start(arg, argc); - ucp->mc.r3 = va_arg(arg, long); - ucp->mc.r4 = va_arg(arg, long); - va_end(arg); -} - -int -swapcontext(ucontext_t *oucp, ucontext_t *ucp) -{ - if(getcontext(oucp) == 0) - setcontext(ucp); - return 0; -} diff --git a/src/libthread/power-ucontext.h b/src/libthread/power-ucontext.h deleted file mode 100644 index 1985d98d..00000000 --- a/src/libthread/power-ucontext.h +++ /dev/null @@ -1,36 +0,0 @@ -#define setcontext(u) _setmcontext(&(u)->mc) -#define getcontext(u) _getmcontext(&(u)->mc) -typedef struct mcontext mcontext_t; -typedef struct ucontext ucontext_t; -struct mcontext -{ - ulong pc; /* lr */ - ulong cr; /* mfcr */ - ulong ctr; /* mfcr */ - ulong xer; /* mfcr */ - ulong sp; /* callee saved: r1 */ - ulong toc; /* callee saved: r2 */ - ulong r3; /* first arg to function, return register: r3 */ - ulong gpr[19]; /* callee saved: r13-r31 */ -/* -// XXX: currently do not save vector registers or floating-point state -// ulong pad; -// uvlong fpr[18]; / * callee saved: f14-f31 * / -// ulong vr[4*12]; / * callee saved: v20-v31, 256-bits each * / -*/ -}; - -struct ucontext -{ - struct { - void *ss_sp; - uint ss_size; - } uc_stack; - sigset_t uc_sigmask; - mcontext_t mc; -}; - -void makecontext(ucontext_t*, void(*)(void), int, ...); -int swapcontext(ucontext_t*, ucontext_t*); -int _getmcontext(mcontext_t*); -void _setmcontext(mcontext_t*); diff --git a/src/libthread/sparc64-ucontext.c b/src/libthread/sparc64-ucontext.c deleted file mode 100644 index e4800c19..00000000 --- a/src/libthread/sparc64-ucontext.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (C) 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jakub Jelinek . - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include - -#define UC_M_PC 40 -#define UC_M_NPC 48 - -extern int __getcontext (ucontext_t *ucp); -extern int __setcontext (const ucontext_t *ucp, int restoremask); - -int -swapcontext (ucontext_t *oucp, const ucontext_t *ucp) -{ - extern void __swapcontext_ret (void); - /* Save the current machine context to oucp. */ - __getcontext (oucp); - /* Modify oucp to skip the __setcontext call on reactivation. */ - *(long*)((char*)oucp+UC_M_PC) = (long)__swapcontext_ret; - *(long*)((char*)oucp+UC_M_NPC) = (long)__swapcontext_ret + 4; - /* Restore the machine context in ucp. */ - __setcontext (ucp, 1); - return 0; -} - -asm (" \n\ - .text \n\ - .type __swapcontext_ret, #function \n\ -__swapcontext_ret: \n\ - return %i7 + 8 \n\ - clr %o0 \n\ - .size __swapcontext_ret, .-__swapcontext_ret \n\ - "); diff --git a/src/libthread/stkmalloc.c b/src/libthread/stkmalloc.c deleted file mode 100644 index 083aea1b..00000000 --- a/src/libthread/stkmalloc.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "threadimpl.h" - -void* -_threadstkalloc(int n) -{ - return malloc(n); -} - -void -_threadstkfree(void *v, int n) -{ - free(v); -} diff --git a/src/libthread/stkmmap.c b/src/libthread/stkmmap.c deleted file mode 100644 index f4a24630..00000000 --- a/src/libthread/stkmmap.c +++ /dev/null @@ -1,25 +0,0 @@ -#include -#include -#include "threadimpl.h" - -#ifndef MAP_STACK -#define MAP_STACK 0 -#endif - -void* -_threadstkalloc(int n) -{ - void *p; - - p = mmap(nil, n, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON|MAP_STACK, -1, 0); - if(p == (void*)-1) - return nil; - return p; -} - -void -_threadstkfree(void *v, int n) -{ - if(n > 0) - munmap(v, n); -} diff --git a/src/libthread/sysofiles.sh b/src/libthread/sysofiles.sh deleted file mode 100644 index 20811cdf..00000000 --- a/src/libthread/sysofiles.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -test -f $PLAN9/config && . $PLAN9/config - -case "$SYSNAME" in -NetBSD) - echo ${SYSNAME}-${OBJTYPE}-asm.o $SYSNAME.o stkmalloc.o - ;; -OpenBSD) - echo pthread.o stkmmap.o - ;; -*) - echo pthread.o stkmalloc.o -esac - -# Various libc don't supply swapcontext, makecontext, so we do. -case "$SYSNAME-$OBJTYPE" in -Darwin-x86_64 | Linux-arm | Linux-sparc64 | NetBSD-arm | OpenBSD-386 | OpenBSD-power | OpenBSD-x86_64) - echo $OBJTYPE-ucontext.o - ;; -esac - -# A few libc don't supply setcontext, getcontext, so we do. -case "$SYSNAME-$OBJTYPE" in -Darwin-x86_64 | Linux-arm | Linux-sparc64 | OpenBSD-386 | OpenBSD-power | OpenBSD-x86_64) - echo $SYSNAME-$OBJTYPE-asm.o - ;; -esac diff --git a/src/libthread/thread.c b/src/libthread/thread.c index 902942d9..79e0ec71 100644 --- a/src/libthread/thread.c +++ b/src/libthread/thread.c @@ -1,13 +1,12 @@ #include "threadimpl.h" -int _threaddebuglevel; +int _threaddebuglevel = 0; static uint threadnproc; static uint threadnsysproc; static Lock threadnproclock; static Ref threadidref; static Proc *threadmainproc; -static int pthreadperthread; static void addproc(Proc*); static void delproc(Proc*); @@ -16,17 +15,18 @@ static void delthread(_Threadlist*, _Thread*); static int onlist(_Threadlist*, _Thread*); static void addthreadinproc(Proc*, _Thread*); static void delthreadinproc(Proc*, _Thread*); -static void contextswitch(Context *from, Context *to); static void procmain(Proc*); -static void procscheduler(Proc*); static int threadinfo(void*, char*); +static void pthreadscheduler(Proc *p); +static void pthreadsleepschedlocked(Proc *p, _Thread *t); +static void pthreadwakeupschedlocked(Proc *p, _Thread *self, _Thread *t); +static _Thread* procnext(Proc*, _Thread*); static void -_threaddebug(char *fmt, ...) +_threaddebug(_Thread *t, char *fmt, ...) { va_list arg; char buf[128]; - _Thread *t; char *p; static int fd = -1; @@ -52,7 +52,8 @@ _threaddebug(char *fmt, ...) va_start(arg, fmt); vsnprint(buf, sizeof buf, fmt, arg); va_end(arg); - t = proc()->thread; + if(t == nil) + t = proc()->thread; if(t) fprint(fd, "%p %d.%d: %s\n", proc(), getpid(), t->id, buf); else @@ -82,109 +83,24 @@ procalloc(void) return p; } -static void -threadstart(uint y, uint x) -{ - _Thread *t; - ulong z; - -//print("threadstart\n"); - z = (ulong)x << 16; /* hide undefined 32-bit shift from 32-bit compilers */ - z <<= 16; - z |= y; - t = (_Thread*)z; - -//print("threadstart sp=%p arg=%p startfn=%p t=%p\n", &t, t, t->startfn, t->startarg); - t->startfn(t->startarg); -/*print("threadexits %p\n", v); */ - threadexits(nil); -/*print("not reacehd\n"); */ -} - -static _Thread* -threadalloc(void (*fn)(void*), void *arg, uint stack) -{ - _Thread *t; - sigset_t zero; - uint x, y; - ulong z; - - /* allocate the task and stack together */ - t = malloc(sizeof *t); - if(t == nil) - sysfatal("threadalloc malloc: %r"); - memset(t, 0, sizeof *t); - t->id = incref(&threadidref); -//print("fn=%p arg=%p\n", fn, arg); - t->startfn = fn; - t->startarg = arg; -//print("makecontext sp=%p t=%p startfn=%p\n", (char*)t->stk+t->stksize, t, t->startfn); - - /* do a reasonable initialization */ - if(stack == 0) - return t; - t->stk = _threadstkalloc(stack); - if(t->stk == nil) - sysfatal("threadalloc malloc stack: %r"); - t->stksize = stack; - memset(&t->context.uc, 0, sizeof t->context.uc); - sigemptyset(&zero); - sigprocmask(SIG_BLOCK, &zero, &t->context.uc.uc_sigmask); -//print("makecontext sp=%p t=%p startfn=%p\n", (char*)t->stk+t->stksize, t, t->startfn); - - /* must initialize with current context */ - if(getcontext(&t->context.uc) < 0) - sysfatal("threadalloc getcontext: %r"); -//print("makecontext sp=%p t=%p startfn=%p\n", (char*)t->stk+t->stksize, t, t->startfn); - - /* - * Call makecontext to do the real work. - * To avoid various mistakes on other system software, - * debuggers, and so on, don't get too close to both - * ends of the stack. Just staying away is much easier - * than debugging everything (outside our control) - * that has off-by-one errors. - */ - t->context.uc.uc_stack.ss_sp = (void*)(t->stk+64); - t->context.uc.uc_stack.ss_size = t->stksize-2*64; -#if defined(__sun__) && !defined(__MAKECONTEXT_V2_SOURCE) /* sigh */ - /* can avoid this with __MAKECONTEXT_V2_SOURCE but only on SunOS 5.9 */ - t->context.uc.uc_stack.ss_sp = - (char*)t->context.uc.uc_stack.ss_sp - +t->context.uc.uc_stack.ss_size; -#endif - /* - * All this magic is because you have to pass makecontext a - * function that takes some number of word-sized variables, - * and on 64-bit machines pointers are bigger than words. - */ -//print("makecontext sp=%p t=%p startfn=%p\n", (char*)t->stk+t->stksize, t, t->startfn); - z = (ulong)t; - y = z; - z >>= 16; /* hide undefined 32-bit shift from 32-bit compilers */ - x = z>>16; - makecontext(&t->context.uc, (void(*)(void))threadstart, 2, y, x); - - return t; -} - _Thread* _threadcreate(Proc *p, void (*fn)(void*), void *arg, uint stack) { _Thread *t; - /* defend against bad C libraries */ - if(stack < (256<<10)) - stack = 256<<10; - - if(p->nthread == 0 || pthreadperthread) - stack = 0; // not using it - t = threadalloc(fn, arg, stack); + USED(stack); + t = malloc(sizeof *t); + if(t == nil) + sysfatal("threadcreate malloc: %r"); + memset(t, 0, sizeof *t); + t->id = incref(&threadidref); + t->startfn = fn; + t->startarg = arg; t->proc = p; - if(p->nthread == 0) - p->thread0 = t; - else if(pthreadperthread) + if(p->nthread != 0) _threadpthreadstart(p, t); + else + t->mainthread = 1; p->nthread++; addthreadinproc(p, t); _threadready(t); @@ -197,6 +113,7 @@ threadcreate(void (*fn)(void*), void *arg, uint stack) _Thread *t; t = _threadcreate(proc(), fn, arg, stack); + _threaddebug(nil, "threadcreate %d", t->id); return t->id; } @@ -210,41 +127,11 @@ proccreate(void (*fn)(void*), void *arg, uint stack) p = procalloc(); t = _threadcreate(p, fn, arg, stack); id = t->id; /* t might be freed after _procstart */ + _threaddebug(t, "proccreate %p", p); _procstart(p, procmain); return id; } -// For pthreadperthread mode, procswitch flips -// between the threads. -static void -procswitch(Proc *p, _Thread *from, _Thread *to) -{ - _threaddebug("procswitch %p %d %d", p, from?from->id:-1, to?to->id:-1); - lock(&p->schedlock); - from->schedrend.l = &p->schedlock; - if(to) { - p->schedthread = to; - to->schedrend.l = &p->schedlock; - _threaddebug("procswitch wakeup %p %d", p, to->id); - _procwakeup(&to->schedrend); - } - if(p->schedthread != from) { - if(from->exiting) { - unlock(&p->schedlock); - _threadpexit(); - _threaddebug("procswitch exit wakeup!!!\n"); - } - while(p->schedthread != from) { - _threaddebug("procswitch sleep %p %d", p, from->id); - _procsleep(&from->schedrend); - _threaddebug("procswitch awake %p %d", p, from->id); - } - if(p->schedthread != from) - sysfatal("_procswitch %p %p oops", p->schedthread, from); - } - unlock(&p->schedlock); -} - void _threadswitch(void) { @@ -252,15 +139,8 @@ _threadswitch(void) needstack(0); p = proc(); - /*print("threadswtch %p\n", p); */ - - if(p->thread == p->thread0) - procscheduler(p); - else if(pthreadperthread) - procswitch(p, p->thread, p->thread0); - else - contextswitch(&p->thread->context, &p->schedcontext); + pthreadscheduler(p); } void @@ -358,15 +238,6 @@ threadsysfatal(char *fmt, va_list arg) threadexitsall(buf); } -static void -contextswitch(Context *from, Context *to) -{ - if(swapcontext(&from->uc, &to->uc) < 0){ - fprint(2, "swapcontext failed: %r\n"); - assert(0); - } -} - static void procmain(Proc *p) { @@ -377,7 +248,6 @@ procmain(Proc *p) /* take out first thread to run on system stack */ t = p->runqueue.head; delthread(&p->runqueue, t); - memset(&t->context.uc, 0, sizeof t->context.uc); /* run it */ p->thread = t; @@ -390,108 +260,131 @@ void _threadpthreadmain(Proc *p, _Thread *t) { _threadsetproc(p); - procswitch(p, t, nil); + lock(&p->lock); + pthreadsleepschedlocked(p, t); + unlock(&p->lock); + _threaddebug(nil, "startfn"); t->startfn(t->startarg); threadexits(nil); } static void -procscheduler(Proc *p) +pthreadsleepschedlocked(Proc *p, _Thread *t) +{ + _threaddebug(t, "pthreadsleepsched %p %d", p, t->id);; + t->schedrend.l = &p->lock; + while(p->schedthread != t) + _procsleep(&t->schedrend); +} + +static void +pthreadwakeupschedlocked(Proc *p, _Thread *self, _Thread *t) +{ + _threaddebug(self, "pthreadwakeupschedlocked %p %d", p, t->id);; + t->schedrend.l = &p->lock; + p->schedthread = t; + _procwakeup(&t->schedrend); +} + +static void +pthreadscheduler(Proc *p) +{ + _Thread *self, *t; + + _threaddebug(nil, "scheduler"); + lock(&p->lock); + self = p->thread; + p->thread = nil; + _threaddebug(self, "pausing"); + + if(self->exiting) { + _threaddebug(self, "exiting"); + delthreadinproc(p, self); + p->nthread--; + } + + t = procnext(p, self); + if(t != nil) { + pthreadwakeupschedlocked(p, self, t); + if(!self->exiting) { + pthreadsleepschedlocked(p, self); + _threaddebug(nil, "resume %d", self->id); + unlock(&p->lock); + return; + } + } + + if(t == nil) { + /* Tear down proc bookkeeping. Wait to free p. */ + delproc(p); + lock(&threadnproclock); + if(p->sysproc) + --threadnsysproc; + if(--threadnproc == threadnsysproc) + threadexitsall(p->msg); + unlock(&threadnproclock); + } + + /* Tear down pthread. */ + if(self->mainthread && p->mainproc) { + _threaddaemonize(); + _threaddebug(self, "sleeper"); + unlock(&p->lock); + /* + * Avoid bugs with main pthread exiting. + * When all procs are gone, threadexitsall above will happen. + */ + for(;;) + sleep(60*60*1000); + } + _threadsetproc(nil); + free(self); + unlock(&p->lock); + if(t == nil) + free(p); + _threadpexit(); +} + +static _Thread* +procnext(Proc *p, _Thread *self) { _Thread *t; - _threaddebug("scheduler enter"); -//print("s %p\n", p); -Top: - lock(&p->lock); - t = p->thread; - p->thread = nil; - if(t->exiting){ - delthreadinproc(p, t); - p->nthread--; -/*print("nthread %d\n", p->nthread); */ - _threadstkfree(t->stk, t->stksize); - free(t); - } - - for(;;){ - if((t = p->pinthread) != nil){ - while(!onlist(&p->runqueue, t)){ - p->runrend.l = &p->lock; - _threaddebug("scheduler sleep (pin)"); - _procsleep(&p->runrend); - _threaddebug("scheduler wake (pin)"); - } - }else - while((t = p->runqueue.head) == nil){ - if(p->nthread == 0) - goto Out; - if((t = p->idlequeue.head) != nil){ - /* - * Run all the idling threads once. - */ - while((t = p->idlequeue.head) != nil){ - delthread(&p->idlequeue, t); - addthread(&p->runqueue, t); - } - continue; - } + if((t = p->pinthread) != nil){ + while(!onlist(&p->runqueue, t)){ p->runrend.l = &p->lock; - _threaddebug("scheduler sleep"); + _threaddebug(self, "scheduler sleep (pin)"); _procsleep(&p->runrend); - _threaddebug("scheduler wake"); + _threaddebug(self, "scheduler wake (pin)"); } - if(p->pinthread && p->pinthread != t) - fprint(2, "p->pinthread %p t %p\n", p->pinthread, t); - assert(p->pinthread == nil || p->pinthread == t); - delthread(&p->runqueue, t); - unlock(&p->lock); - p->thread = t; - p->nswitch++; - _threaddebug("run %d (%s)", t->id, t->name); -//print("run %p %p %p %p\n", t, *(uintptr*)(t->context.uc.mc.sp), t->context.uc.mc.di, t->context.uc.mc.si); - if(t == p->thread0) - return; - if(pthreadperthread) - procswitch(p, p->thread0, t); - else - contextswitch(&p->schedcontext, &t->context); - _threaddebug("back in scheduler"); -/*print("back in scheduler\n"); */ - goto Top; + } else + while((t = p->runqueue.head) == nil){ + if(p->nthread == 0) + return nil; + if((t = p->idlequeue.head) != nil){ + /* + * Run all the idling threads once. + */ + while((t = p->idlequeue.head) != nil){ + delthread(&p->idlequeue, t); + addthread(&p->runqueue, t); + } + continue; + } + p->runrend.l = &p->lock; + _threaddebug(self, "scheduler sleep"); + _procsleep(&p->runrend); + _threaddebug(self, "scheduler wake"); } -Out: - _threaddebug("scheduler exit"); - if(p->mainproc){ - /* - * Stupid bug - on Linux 2.6 and maybe elsewhere, - * if the main thread exits then the others keep running - * but the process shows up as a zombie in ps and is not - * attachable with ptrace. We'll just sit around pretending - * to be a system proc instead of exiting. - */ - _threaddaemonize(); - lock(&threadnproclock); - if(++threadnsysproc == threadnproc) - threadexitsall(p->msg); - p->sysproc = 1; - unlock(&threadnproclock); - for(;;) - sleep(1000); - } + if(p->pinthread && p->pinthread != t) + fprint(2, "p->pinthread %p t %p\n", p->pinthread, t); + assert(p->pinthread == nil || p->pinthread == t); + delthread(&p->runqueue, t); - delproc(p); - lock(&threadnproclock); - if(p->sysproc) - --threadnsysproc; - if(--threadnproc == threadnsysproc) - threadexitsall(p->msg); - unlock(&threadnproclock); - unlock(&p->lock); - _threadsetproc(nil); - free(p); - _threadpexit(); + p->thread = t; + p->nswitch++; + return t; } void @@ -776,14 +669,18 @@ threadrwakeup(Rendez *r, int all, ulong pc) int i; _Thread *t; + _threaddebug(nil, "rwakeup %p %d", r, all); for(i=0;; i++){ if(i==1 && !all) break; if((t = r->waiting.head) == nil) break; + _threaddebug(nil, "rwakeup %p %d -> wake %d", r, all, t->id); delthread(&r->waiting, t); _threadready(t); + _threaddebug(nil, "rwakeup %p %d -> loop", r, all); } + _threaddebug(nil, "rwakeup %p %d -> total %d", r, all, i); return i; } @@ -819,6 +716,7 @@ int main(int argc, char **argv) { Proc *p; + _Thread *t; char *opts; argv0 = argv[0]; @@ -827,16 +725,7 @@ main(int argc, char **argv) if(opts == nil) opts = ""; - pthreadperthread = (strstr(opts, "pthreadperthread") != nil); -#ifdef PLAN9PORT_ASAN - // ASAN can't deal with the coroutine stack switches. - // In theory it has support for informing it about stack switches, - // but even with those calls added it can't deal with things - // like fork or exit from a coroutine stack. - // Easier to just run in pthread-per-thread mode. - pthreadperthread = 1; -#endif - if(strstr(opts, "nodaemon") == nil && getenv("NOLIBTHREADDAEMONIZE") == nil) + if(threadmaybackground() && strstr(opts, "nodaemon") == nil && getenv("NOLIBTHREADDAEMONIZE") == nil) _threadsetupdaemonize(); threadargc = argc; @@ -867,9 +756,10 @@ main(int argc, char **argv) if(mainstacksize == 0) mainstacksize = 256*1024; atnotify(threadinfo, 1); - _threadcreate(p, threadmainstart, nil, mainstacksize); + t = _threadcreate(p, threadmainstart, nil, mainstacksize); + t->mainthread = 1; procmain(p); - sysfatal("procscheduler returned in threadmain!"); + sysfatal("procmain returned in libthread"); /* does not return */ return 0; } diff --git a/src/libthread/threadimpl.h b/src/libthread/threadimpl.h index c7373843..fd40f252 100644 --- a/src/libthread/threadimpl.h +++ b/src/libthread/threadimpl.h @@ -7,63 +7,13 @@ #include #if !defined(__OpenBSD__) # if defined(__APPLE__) -# define _XOPEN_SOURCE /* for Snow Leopard */ +# define _XOPEN_SOURCE /* for Snow Leopard */ # endif -# include #endif #include #include "libc.h" #include "thread.h" -#if defined(__APPLE__) - /* - * OS X before 10.5 (Leopard) does not provide - * swapcontext nor makecontext, so we have to use our own. - * In theory, Leopard does provide them, but when we use - * them, they seg fault. Maybe we're using them wrong. - * So just use our own versions, even on Leopard. - */ -# define mcontext libthread_mcontext -# define mcontext_t libthread_mcontext_t -# define ucontext libthread_ucontext -# define ucontext_t libthread_ucontext_t -# define swapcontext libthread_swapcontext -# define makecontext libthread_makecontext -# if defined(__i386__) -# include "386-ucontext.h" -# elif defined(__x86_64__) -# include "x86_64-ucontext.h" -# elif defined(__ppc__) || defined(__power__) -# include "power-ucontext.h" -# else -# error "unknown architecture" -# endif -#endif - -#if defined(__OpenBSD__) -# define mcontext libthread_mcontext -# define mcontext_t libthread_mcontext_t -# define ucontext libthread_ucontext -# define ucontext_t libthread_ucontext_t -# if defined __i386__ -# include "386-ucontext.h" -# elif defined __amd64__ -# include "x86_64-ucontext.h" -# else -# include "power-ucontext.h" -# endif -extern pid_t rfork_thread(int, void*, int(*)(void*), void*); -#endif - -#if defined(__arm__) -int mygetmcontext(ulong*); -void mysetmcontext(const ulong*); -#define setcontext(u) mysetmcontext(&(u)->uc_mcontext.arm_r0) -#define getcontext(u) mygetmcontext(&(u)->uc_mcontext.arm_r0) -#endif - - -typedef struct Context Context; typedef struct Execjob Execjob; typedef struct Proc Proc; typedef struct _Procrendez _Procrendez; @@ -79,20 +29,6 @@ enum STACK = 8192 }; -struct Context -{ - ucontext_t uc; -#ifdef __APPLE__ - /* - * On Snow Leopard, etc., the context routines exist, - * so we use them, but apparently they write past the - * end of the ucontext_t. Sigh. We put some extra - * scratch space here for them. - */ - uchar buf[1024]; -#endif -}; - struct Execjob { int *fd; @@ -106,11 +42,7 @@ struct _Procrendez { Lock *l; int asleep; -#ifdef PLAN9PORT_USING_PTHREADS pthread_cond_t cond; -#else - int pid; -#endif }; struct _Thread @@ -119,18 +51,14 @@ struct _Thread _Thread *prev; _Thread *allnext; _Thread *allprev; - Context context; void (*startfn)(void*); void *startarg; uint id; -#ifdef PLAN9PORT_USING_PTHREADS pthread_t osprocid; -#else - int osprocid; -#endif uchar *stk; uint stksize; int exiting; + int mainthread; Proc *proc; char name[256]; char state[256]; @@ -148,11 +76,7 @@ struct Proc Proc *next; Proc *prev; char msg[128]; -#ifdef PLAN9PORT_USING_PTHREADS pthread_t osprocid; -#else - int osprocid; -#endif Lock lock; int nswitch; _Thread *thread0; @@ -164,9 +88,7 @@ struct Proc uint nthread; uint sysproc; _Procrendez runrend; - Lock schedlock; _Thread *schedthread; - Context schedcontext; void *udata; Jmp sigjmp; int mainproc; diff --git a/src/libthread/x86_64-ucontext.c b/src/libthread/x86_64-ucontext.c deleted file mode 100644 index 5d1aaefc..00000000 --- a/src/libthread/x86_64-ucontext.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "threadimpl.h" - -void -makecontext(ucontext_t *uc, void (*fn)(void), int argc, ...) -{ - uintptr *sp; - va_list arg; - - if(argc != 2) - sysfatal("libthread: makecontext misused"); - va_start(arg, argc); - uc->mc.di = va_arg(arg, uint); - uc->mc.si = va_arg(arg, uint); - va_end(arg); - - sp = USPALIGN(uc, 16); - *--sp = 0; // fn's return address - *--sp = (uintptr)fn; // return address of setcontext - uc->mc.sp = (uintptr)sp; -} - -int -swapcontext(ucontext_t *oucp, ucontext_t *ucp) -{ - if(getcontext(oucp) == 0) - setcontext(ucp); - return 0; -} diff --git a/src/libthread/x86_64-ucontext.h b/src/libthread/x86_64-ucontext.h deleted file mode 100644 index e0640761..00000000 --- a/src/libthread/x86_64-ucontext.h +++ /dev/null @@ -1,42 +0,0 @@ -#define setcontext(u) libthread_setmcontext(&(u)->mc) -#define getcontext(u) libthread_getmcontext(&(u)->mc) -typedef struct mcontext mcontext_t; -typedef struct ucontext ucontext_t; - -struct mcontext -{ - uintptr ax; - uintptr bx; - uintptr cx; - uintptr dx; - uintptr si; - uintptr di; - uintptr bp; - uintptr sp; - uintptr r8; - uintptr r9; - uintptr r10; - uintptr r11; - uintptr r12; - uintptr r13; - uintptr r14; - uintptr r15; -/* -// XXX: currently do not save vector registers or floating-point state -*/ -}; - -struct ucontext -{ - struct { - void *ss_sp; - uint ss_size; - } uc_stack; - sigset_t uc_sigmask; - mcontext_t mc; -}; - -void makecontext(ucontext_t*, void(*)(void), int, ...); -int swapcontext(ucontext_t*, ucontext_t*); -int libthread_getmcontext(mcontext_t*); -void libthread_setmcontext(mcontext_t*); diff --git a/src/mkenv b/src/mkenv index 6c89f141..5feca483 100644 --- a/src/mkenv +++ b/src/mkenv @@ -2,22 +2,22 @@ # and also valid shell input for ../dist/buildmk SYSNAME=`uname` -OBJTYPE=`(uname -m -p 2>/dev/null || uname -m) | sed ' - s;.*i[3-6]86.*;386;; - s;.*i86pc.*;386;; - s;.*amd64.*;x86_64;; - s;.*x86_64.*;x86_64;; - s;.*armv.*;arm;g; - s;.*powerpc.*;power;g; - s;.*PowerMacintosh.*;power;g; - s;.*Power.Macintosh.*;power;g; - s;.*macppc.*;power;g; - s;.*mips.*;mips;g; - s;.*ppc64.*;power;g; - s;.*ppc.*;power;g; - s;.*alpha.*;alpha;g; - s;.*sun4u.*;sun4u;g; - s;.*aarch64.*;arm64; - s;.*arm64.*;arm64; -'` +# OBJTYPE=`(uname -m -p 2>/dev/null || uname -m) | sed ' +# s;.*i[3-6]86.*;386;; +# s;.*i86pc.*;386;; +# s;.*amd64.*;x86_64;; +# s;.*x86_64.*;x86_64;; +# s;.*armv.*;arm;g; +# s;.*powerpc.*;power;g; +# s;.*PowerMacintosh.*;power;g; +# s;.*Power.Macintosh.*;power;g; +# s;.*macppc.*;power;g; +# s;.*mips.*;mips;g; +# s;.*ppc64.*;power;g; +# s;.*ppc.*;power;g; +# s;.*alpha.*;alpha;g; +# s;.*sun4u.*;sun4u;g; +# s;.*aarch64.*;arm64; +# s;.*arm64.*;arm64; +# '` INSTALL=`[ $(uname) = AIX ] && echo installbsd || echo install` diff --git a/src/mkfile b/src/mkfile index 4740780d..d17ca6b6 100644 --- a/src/mkfile +++ b/src/mkfile @@ -37,9 +37,7 @@ mkmk.sh:VD: ) | sed ' s/'$INSTALL'/$INSTALL/g s/'$SYSNAME'/$SYSNAME/g - s/'$OBJTYPE'/$OBJTYPE/g s;'$PLAN9';$PLAN9;g - s/^9[ac] *tas-.*/9a tas-$OBJTYPE.s || 9c tas-$OBJTYPE.c/ ' >$target testmkmk:V: diff --git a/src/mkhdr b/src/mkhdr index 35a2ccc5..77cf8559 100644 --- a/src/mkhdr +++ b/src/mkhdr @@ -9,7 +9,7 @@ OS=$O CC=9c #CC=9r LD=9l -AS=9a +AS=no-9a AR=9ar CFLAGS= LDFLAGS= diff --git a/tmac/tmac.an b/tmac/tmac.an index 6d2e9c59..02b31bbf 100644 --- a/tmac/tmac.an +++ b/tmac/tmac.an @@ -205,7 +205,15 @@ .. .de IR .nh -.}S 2 1 \& "\Xhtml manref start \\$1 \\$2\\$1" "\\$2\Xhtml manref end \\$1 \\$2" "\\$3" "\\$4" "\\$5" "\\$6" +.}S 2 1 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" +.HY +.}f +.. +.\" MR - manual reference, as in .MR cat (1) , +.\" $3 is the punctuation after the reference ends, if any. +.de MR +.nh +.}S 2 1 \& "\Xhtml manref start \\$1 \\$2\\$1" "\\$2\Xhtml manref end \\$1 \\$2\\$3" .HY .}f .. diff --git a/unix/NOTICE.bio b/unix/NOTICE.bio index 24bef790..3e5dcdba 100644 --- a/unix/NOTICE.bio +++ b/unix/NOTICE.bio @@ -1,13 +1,8 @@ -This copyright NOTICE applies to all files in this directory and -subdirectories, unless another copyright notice appears in a given -file or subdirectory. If you take substantial code from this software to use in -other programs, you must somehow include with it an appropriate -copyright notice that includes the copyright notice and the other -notices below. It is fine (and often tidier) to do that in a separate -file such as NOTICE, LICENCE or COPYING. +This is a Unix port of the Plan 9 buffered I/O library. +Please send comments about the packaging to Russ Cox . - Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. - Revisions Copyright © 2000-2005 Vita Nuova Holdings Limited (www.vitanuova.com). All rights reserved. +Copyright © 2021 Plan 9 Foundation +Revisions Copyright © 2000-2005 Vita Nuova Holdings Limited (www.vitanuova.com). All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -26,9 +21,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ----- - -This software is also made available under the Lucent Public License -version 1.02; see http://9p.io/plan9/license.html - diff --git a/unix/NOTICE.fmt b/unix/NOTICE.fmt index e4024070..3c66bac3 100644 --- a/unix/NOTICE.fmt +++ b/unix/NOTICE.fmt @@ -1,25 +1,22 @@ -/* - * The authors of this software are Rob Pike and Ken Thompson. - * Copyright (c) 2002 by Lucent Technologies. - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. -*/ +This is a Unix port of the Plan 9 formatted I/O library, by Rob Pike and Ken Thompson. +Please send comments about the packaging to Russ Cox . -This is a Unix port of the Plan 9 formatted I/O package. +Copyright © 2021 Plan 9 Foundation -Please send comments about the packaging -to Russ Cox . +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. ----- - -This software is also made available under the Lucent Public License -version 1.02; see http://9p.io/plan9/license.html - +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/unix/NOTICE.mk b/unix/NOTICE.mk index 4fb98fb7..9b7350ef 100644 --- a/unix/NOTICE.mk +++ b/unix/NOTICE.mk @@ -1,13 +1,9 @@ -This copyright NOTICE applies to all files in this directory and -subdirectories, unless another copyright notice appears in a given -file or subdirectory. If you take substantial code from this software to use in -other programs, you must somehow include with it an appropriate -copyright notice that includes the copyright notice and the other -notices below. It is fine (and often tidier) to do that in a separate -file such as NOTICE, LICENCE or COPYING. +This is a Unix port of the Plan 9 build tool mk, by Andrew Hume. +Please send comments about the packaging to Russ Cox . - Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. - Revisions Copyright © 2000-2003 Vita Nuova Holdings Limited (www.vitanuova.com). All rights reserved. +Copyright © 2021 Plan 9 Foundation +Portions Copyright © 1997-1999 Vita Nuova Limited +Portions Copyright © 2000-2015 Vita Nuova Holdings Limited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -26,9 +22,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ----- - -This software is also made available under the Lucent Public License -version 1.02; see http://9p.io/plan9/license.html - diff --git a/unix/NOTICE.regexp b/unix/NOTICE.regexp index 686891c1..076a901b 100644 --- a/unix/NOTICE.regexp +++ b/unix/NOTICE.regexp @@ -1,25 +1,22 @@ -/* - * The authors of this software is Rob Pike. - * Copyright (c) 2002 by Lucent Technologies. - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. -*/ +This is a Unix port of the Plan 9 regular expression library, by Rob Pike. +Please send comments about the packaging to Russ Cox . -This is a Unix port of the Plan 9 regular expression library. +Copyright © 2021 Plan 9 Foundation -Please send comments about the packaging -to Russ Cox . +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. ----- - -This software is also made available under the Lucent Public License -version 1.02; see http://9p.io/plan9/license.html - +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/unix/NOTICE.utf b/unix/NOTICE.utf index e4024070..b39ee1ec 100644 --- a/unix/NOTICE.utf +++ b/unix/NOTICE.utf @@ -1,25 +1,22 @@ -/* - * The authors of this software are Rob Pike and Ken Thompson. - * Copyright (c) 2002 by Lucent Technologies. - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. -*/ +This is a Unix port of the Plan 9 UTF-8 library, by Rob Pike and Ken Thompson. +Please send comments about the packaging to Russ Cox . -This is a Unix port of the Plan 9 formatted I/O package. +Copyright © 2021 Plan 9 Foundation -Please send comments about the packaging -to Russ Cox . +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. ----- - -This software is also made available under the Lucent Public License -version 1.02; see http://9p.io/plan9/license.html - +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/unix/README.dot b/unix/README.dot index 9479bbb5..819d7569 100644 --- a/unix/README.dot +++ b/unix/README.dot @@ -13,6 +13,9 @@ mk new-utf new-fmt new-bio new-regexp new-mk mk test-utf test-fmt test-bio test-regexp test-mk create the directory, populate it, and run a test build +mk test + run the above tests and then clean up + mk libutf.tgz libfmt.tgz libbio.tgz libregexp9.tgz mk.tgz create the directory, populate it, and build a tar file diff --git a/unix/make/Make.Darwin-386 b/unix/make/Make.Darwin similarity index 100% rename from unix/make/Make.Darwin-386 rename to unix/make/Make.Darwin diff --git a/unix/make/Make.Darwin-PowerMacintosh b/unix/make/Make.Darwin-PowerMacintosh deleted file mode 100644 index 21ede6f2..00000000 --- a/unix/make/Make.Darwin-PowerMacintosh +++ /dev/null @@ -1,7 +0,0 @@ -CC=gcc -CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I${PREFIX}/include -O=o -AR=ar -ARFLAGS=rvc -NAN=nan64.$O -RANLIB=ranlib diff --git a/unix/make/Make.FreeBSD-386 b/unix/make/Make.FreeBSD similarity index 100% rename from unix/make/Make.FreeBSD-386 rename to unix/make/Make.FreeBSD diff --git a/unix/make/Make.HP-UX-9000 b/unix/make/Make.HP-UX similarity index 100% rename from unix/make/Make.HP-UX-9000 rename to unix/make/Make.HP-UX diff --git a/unix/make/Make.Linux-x86_64 b/unix/make/Make.Linux similarity index 100% rename from unix/make/Make.Linux-x86_64 rename to unix/make/Make.Linux diff --git a/unix/make/Make.Linux-386 b/unix/make/Make.Linux-386 deleted file mode 100644 index c1dc4109..00000000 --- a/unix/make/Make.Linux-386 +++ /dev/null @@ -1,6 +0,0 @@ -CC=gcc -CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -O=o -AR=ar -ARFLAGS=rvc -NAN=nan64.$O diff --git a/unix/make/Make.Linux-power b/unix/make/Make.Linux-power deleted file mode 100644 index c1dc4109..00000000 --- a/unix/make/Make.Linux-power +++ /dev/null @@ -1,6 +0,0 @@ -CC=gcc -CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -O=o -AR=ar -ARFLAGS=rvc -NAN=nan64.$O diff --git a/unix/make/Make.NetBSD-386 b/unix/make/Make.NetBSD similarity index 100% rename from unix/make/Make.NetBSD-386 rename to unix/make/Make.NetBSD diff --git a/unix/make/Make.OSF1-alpha b/unix/make/Make.OSF1 similarity index 100% rename from unix/make/Make.OSF1-alpha rename to unix/make/Make.OSF1 diff --git a/unix/make/Make.OpenBSD-386 b/unix/make/Make.OpenBSD similarity index 100% rename from unix/make/Make.OpenBSD-386 rename to unix/make/Make.OpenBSD diff --git a/unix/make/Make.SunOS b/unix/make/Make.SunOS new file mode 100644 index 00000000..a306597b --- /dev/null +++ b/unix/make/Make.SunOS @@ -0,0 +1,2 @@ +include Make.SunOS-$(CC) +NAN=nan64.$O diff --git a/unix/make/Make.SunOS-sun4u-cc b/unix/make/Make.SunOS-cc similarity index 100% rename from unix/make/Make.SunOS-sun4u-cc rename to unix/make/Make.SunOS-cc diff --git a/unix/make/Make.SunOS-sun4u-gcc b/unix/make/Make.SunOS-gcc similarity index 100% rename from unix/make/Make.SunOS-sun4u-gcc rename to unix/make/Make.SunOS-gcc diff --git a/unix/make/Make.SunOS-sun4u b/unix/make/Make.SunOS-sun4u deleted file mode 100644 index c5fe67b8..00000000 --- a/unix/make/Make.SunOS-sun4u +++ /dev/null @@ -1,2 +0,0 @@ -include Make.SunOS-sun4u-$(CC) -NAN=nan64.$O diff --git a/unix/make/Makefile.TOP b/unix/make/Makefile.TOP index 516937e0..5feb1d47 100644 --- a/unix/make/Makefile.TOP +++ b/unix/make/Makefile.TOP @@ -1,18 +1,16 @@ # this works in gnu make SYSNAME:=${shell uname} -OBJTYPE:=${shell uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'} # this works in bsd make SYSNAME!=uname -OBJTYPE!=uname -m | sed 's;i.86;386;; s;amd64;x864_64;; s;/.*;;; s; ;;g' # the gnu rules will mess up bsd but not vice versa, # hence the gnu rules come first. RANLIB=true -include Make.$(SYSNAME)-$(OBJTYPE) +include Make.$(SYSNAME) PREFIX=/usr/local diff --git a/unix/mkfile b/unix/mkfile index 1c4319c6..ba641bc6 100644 --- a/unix/mkfile +++ b/unix/mkfile @@ -34,7 +34,12 @@ test-%:V: if(! test -f `{echo $i | sed 's/.c$/.o/'}) echo XXX not building $i cd .. - rm -r $td + +test:V: test-utf test-fmt test-bio test-regexp test-mk + mk test-clean + +test-clean:V: + rm -rf libutf libfmt libbio libregexp mk lib%.tgz:V: mk new-$stem @@ -49,7 +54,7 @@ mk.tgz:V: tar cf /dev/stdout mk | gzip > $target mk-with-libs.tgz:V: - mk new-utf + mk new-utf mk new-fmt mk new-bio mk new-regexp @@ -64,9 +69,6 @@ mk-with-libs.tgz:V: tgz:V: libutf.tgz libfmt.tgz libregexp9.tgz libbio.tgz mk.tgz mk-with-libs.tgz +# run from 'mk push' in ../dist, which sets 9fansweb push:V: - rm -f *.sha1 *.md5 *.sha256 - for (i in *.tgz) - sha1sum $i >$i.sha1 cp *.tgz $9fansweb/plan9port/unix - cp *.tgz.sha1 $9fansweb/plan9port/unix