home *** CD-ROM | disk | FTP | other *** search
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: part02
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 75 6e 69 78 0a 46 72 |.sources|.unix.Fr|
|00000020| 6f 6d 3a 20 70 68 69 6c | 40 65 65 63 73 2e 6e 77 |om: phil|@eecs.nw|
|00000030| 75 2e 65 64 75 20 28 57 | 69 6c 6c 69 61 6d 20 4c |u.edu (W|illiam L|
|00000040| 65 46 65 62 76 72 65 29 | 0a 53 75 62 6a 65 63 74 |eFebvre)|.Subject|
|00000050| 3a 20 76 32 37 69 30 30 | 32 3a 20 74 6f 70 20 2d |: v27i00|2: top -|
|00000060| 20 61 20 74 6f 70 20 70 | 72 6f 63 65 73 73 20 64 | a top p|rocess d|
|00000070| 69 73 70 6c 61 79 2c 20 | 76 65 72 73 69 6f 6e 20 |isplay, |version |
|00000080| 33 2e 32 2c 20 50 61 72 | 74 30 32 2f 31 33 0a 52 |3.2, Par|t02/13.R|
|00000090| 65 66 65 72 65 6e 63 65 | 73 3a 20 3c 31 2e 37 34 |eference|s: <1.74|
|000000a0| 34 38 34 33 31 33 36 2e | 34 37 34 34 40 67 77 2e |4843136.|4744@gw.|
|000000b0| 68 6f 6d 65 2e 76 69 78 | 2e 63 6f 6d 3e 0a 53 65 |home.vix|.com>.Se|
|000000c0| 6e 64 65 72 3a 20 75 6e | 69 78 2d 73 6f 75 72 63 |nder: un|ix-sourc|
|000000d0| 65 73 2d 6d 6f 64 65 72 | 61 74 6f 72 40 67 77 2e |es-moder|ator@gw.|
|000000e0| 68 6f 6d 65 2e 76 69 78 | 2e 63 6f 6d 0a 41 70 70 |home.vix|.com.App|
|000000f0| 72 6f 76 65 64 3a 20 76 | 69 78 69 65 40 67 77 2e |roved: v|ixie@gw.|
|00000100| 68 6f 6d 65 2e 76 69 78 | 2e 63 6f 6d 0a 0a 53 75 |home.vix|.com..Su|
|00000110| 62 6d 69 74 74 65 64 2d | 42 79 3a 20 70 68 69 6c |bmitted-|By: phil|
|00000120| 40 65 65 63 73 2e 6e 77 | 75 2e 65 64 75 20 28 57 |@eecs.nw|u.edu (W|
|00000130| 69 6c 6c 69 61 6d 20 4c | 65 46 65 62 76 72 65 29 |illiam L|eFebvre)|
|00000140| 0a 50 6f 73 74 69 6e 67 | 2d 4e 75 6d 62 65 72 3a |.Posting|-Number:|
|00000150| 20 56 6f 6c 75 6d 65 20 | 32 37 2c 20 49 73 73 75 | Volume |27, Issu|
|00000160| 65 20 32 0a 41 72 63 68 | 69 76 65 2d 4e 61 6d 65 |e 2.Arch|ive-Name|
|00000170| 3a 20 74 6f 70 2d 33 2e | 32 2f 70 61 72 74 30 32 |: top-3.|2/part02|
|00000180| 0a 0a 23 21 20 2f 62 69 | 6e 2f 73 68 0a 23 20 54 |..#! /bi|n/sh.# T|
|00000190| 68 69 73 20 69 73 20 61 | 20 73 68 65 6c 6c 20 61 |his is a| shell a|
|000001a0| 72 63 68 69 76 65 2e 20 | 20 52 65 6d 6f 76 65 20 |rchive. | Remove |
|000001b0| 61 6e 79 74 68 69 6e 67 | 20 62 65 66 6f 72 65 20 |anything| before |
|000001c0| 74 68 69 73 20 6c 69 6e | 65 2c 20 74 68 65 6e 20 |this lin|e, then |
|000001d0| 75 6e 70 61 63 6b 0a 23 | 20 69 74 20 62 79 20 73 |unpack.#| it by s|
|000001e0| 61 76 69 6e 67 20 69 74 | 20 69 6e 74 6f 20 61 20 |aving it| into a |
|000001f0| 66 69 6c 65 20 61 6e 64 | 20 74 79 70 69 6e 67 20 |file and| typing |
|00000200| 22 73 68 20 66 69 6c 65 | 22 2e 20 20 54 6f 20 6f |"sh file|". To o|
|00000210| 76 65 72 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |verwrite| existin|
|00000220| 67 0a 23 20 66 69 6c 65 | 73 2c 20 74 79 70 65 20 |g.# file|s, type |
|00000230| 22 73 68 20 66 69 6c 65 | 20 2d 63 22 2e 20 20 59 |"sh file| -c". Y|
|00000240| 6f 75 20 63 61 6e 20 61 | 6c 73 6f 20 66 65 65 64 |ou can a|lso feed|
|00000250| 20 74 68 69 73 20 61 73 | 20 73 74 61 6e 64 61 72 | this as| standar|
|00000260| 64 20 69 6e 70 75 74 20 | 76 69 61 0a 23 20 75 6e |d input |via.# un|
|00000270| 73 68 61 72 2c 20 6f 72 | 20 62 79 20 74 79 70 69 |shar, or| by typi|
|00000280| 6e 67 20 22 73 68 20 3c | 66 69 6c 65 22 2c 20 65 |ng "sh <|file", e|
|00000290| 2e 67 2e 2e 20 20 49 66 | 20 74 68 69 73 20 61 72 |.g.. If| this ar|
|000002a0| 63 68 69 76 65 20 69 73 | 20 63 6f 6d 70 6c 65 74 |chive is| complet|
|000002b0| 65 2c 20 79 6f 75 0a 23 | 20 77 69 6c 6c 20 73 65 |e, you.#| will se|
|000002c0| 65 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |e the fo|llowing |
|000002d0| 6d 65 73 73 61 67 65 20 | 61 74 20 74 68 65 20 65 |message |at the e|
|000002e0| 6e 64 3a 0a 23 09 09 22 | 45 6e 64 20 6f 66 20 61 |nd:.#.."|End of a|
|000002f0| 72 63 68 69 76 65 20 32 | 20 28 6f 66 20 31 33 29 |rchive 2| (of 13)|
|00000300| 2e 22 0a 23 20 43 6f 6e | 74 65 6e 74 73 3a 20 20 |.".# Con|tents: |
|00000310| 49 4e 53 54 41 4c 4c 20 | 50 6f 72 74 69 6e 67 20 |INSTALL |Porting |
|00000320| 63 6f 6d 6d 61 6e 64 73 | 2e 63 20 73 63 72 65 65 |commands|.c scree|
|00000330| 6e 2e 63 20 74 6f 70 2e | 58 20 75 74 69 6c 73 2e |n.c top.|X utils.|
|00000340| 63 0a 23 20 57 72 61 70 | 70 65 64 20 62 79 20 70 |c.# Wrap|ped by p|
|00000350| 68 69 6c 40 70 65 78 20 | 6f 6e 20 57 65 64 20 41 |hil@pex |on Wed A|
|00000360| 75 67 20 20 34 20 31 34 | 3a 32 32 3a 34 30 20 31 |ug 4 14|:22:40 1|
|00000370| 39 39 33 0a 50 41 54 48 | 3d 2f 62 69 6e 3a 2f 75 |993.PATH|=/bin:/u|
|00000380| 73 72 2f 62 69 6e 3a 2f | 75 73 72 2f 75 63 62 20 |sr/bin:/|usr/ucb |
|00000390| 3b 20 65 78 70 6f 72 74 | 20 50 41 54 48 0a 69 66 |; export| PATH.if|
|000003a0| 20 74 65 73 74 20 2d 66 | 20 27 49 4e 53 54 41 4c | test -f| 'INSTAL|
|000003b0| 4c 27 20 2d 61 20 22 24 | 7b 31 7d 22 20 21 3d 20 |L' -a "$|{1}" != |
|000003c0| 22 2d 63 22 20 3b 20 74 | 68 65 6e 20 0a 20 20 65 |"-c" ; t|hen . e|
|000003d0| 63 68 6f 20 73 68 61 72 | 3a 20 57 69 6c 6c 20 6e |cho shar|: Will n|
|000003e0| 6f 74 20 63 6c 6f 62 62 | 65 72 20 65 78 69 73 74 |ot clobb|er exist|
|000003f0| 69 6e 67 20 66 69 6c 65 | 20 5c 22 27 49 4e 53 54 |ing file| \"'INST|
|00000400| 41 4c 4c 27 5c 22 0a 65 | 6c 73 65 0a 65 63 68 6f |ALL'\".e|lse.echo|
|00000410| 20 73 68 61 72 3a 20 45 | 78 74 72 61 63 74 69 6e | shar: E|xtractin|
|00000420| 67 20 5c 22 27 49 4e 53 | 54 41 4c 4c 27 5c 22 20 |g \"'INS|TALL'\" |
|00000430| 5c 28 36 33 38 33 20 63 | 68 61 72 61 63 74 65 72 |\(6383 c|haracter|
|00000440| 73 5c 29 0a 73 65 64 20 | 22 73 2f 5e 58 2f 2f 22 |s\).sed |"s/^X//"|
|00000450| 20 3e 27 49 4e 53 54 41 | 4c 4c 27 20 3c 3c 27 45 | >'INSTA|LL' <<'E|
|00000460| 4e 44 5f 4f 46 5f 46 49 | 4c 45 27 0a 58 20 20 20 |ND_OF_FI|LE'.X |
|00000470| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000480| 20 20 20 20 20 20 20 20 | 20 20 54 4f 50 0a 58 20 | | TOP.X |
|00000490| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000004a0| 20 20 20 20 20 20 20 20 | 56 65 72 73 69 6f 6e 20 | |Version |
|000004b0| 33 2e 32 0a 58 0a 58 20 | 20 20 20 20 20 20 20 20 |3.2.X.X | |
|000004c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 57 69 | | Wi|
|000004d0| 6c 6c 69 61 6d 20 4c 65 | 46 65 62 76 72 65 0a 58 |lliam Le|Febvre.X|
|000004e0| 09 09 20 20 20 20 20 61 | 6e 64 20 61 20 63 61 73 |.. a|nd a cas|
|000004f0| 74 20 6f 66 20 64 6f 7a | 65 6e 73 0a 58 0a 58 49 |t of doz|ens.X.XI|
|00000500| 4e 53 54 41 4c 4c 41 54 | 49 4f 4e 0a 58 0a 58 43 |NSTALLAT|ION.X.XC|
|00000510| 6f 6e 66 69 67 75 72 61 | 74 69 6f 6e 20 61 6e 64 |onfigura|tion and|
|00000520| 20 69 6e 73 74 61 6c 6c | 61 74 69 6f 6e 20 6f 66 | install|ation of|
|00000530| 20 74 6f 70 20 69 73 20 | 76 65 72 79 20 73 74 72 | top is |very str|
|00000540| 61 69 67 68 74 66 6f 72 | 77 61 72 64 2e 20 20 41 |aightfor|ward. A|
|00000550| 66 74 65 72 0a 58 75 6e | 70 61 63 6b 69 6e 67 20 |fter.Xun|packing |
|00000560| 74 68 65 20 73 6f 75 72 | 63 65 73 2c 20 72 75 6e |the sour|ces, run|
|00000570| 20 74 68 65 20 73 63 72 | 69 70 74 20 22 43 6f 6e | the scr|ipt "Con|
|00000580| 66 69 67 75 72 65 22 2e | 20 20 49 74 20 77 69 6c |figure".| It wil|
|00000590| 6c 20 70 72 65 73 65 6e | 74 20 79 6f 75 0a 58 77 |l presen|t you.Xw|
|000005a0| 69 74 68 20 61 20 73 65 | 72 69 65 73 20 6f 66 20 |ith a se|ries of |
|000005b0| 71 75 65 73 74 69 6f 6e | 73 2c 20 61 6c 6c 20 6f |question|s, all o|
|000005c0| 66 20 77 68 69 63 68 20 | 73 68 6f 75 6c 64 20 62 |f which |should b|
|000005d0| 65 20 65 78 70 6c 61 69 | 6e 65 64 20 69 6e 20 74 |e explai|ned in t|
|000005e0| 68 65 0a 58 70 72 65 73 | 65 6e 74 61 74 69 6f 6e |he.Xpres|entation|
|000005f0| 2e 20 20 41 66 74 65 72 | 20 79 6f 75 20 68 61 76 |. After| you hav|
|00000600| 65 20 61 6e 73 77 65 72 | 65 64 20 61 6c 6c 20 74 |e answer|ed all t|
|00000610| 68 65 20 71 75 65 73 74 | 69 6f 6e 73 2c 20 22 43 |he quest|ions, "C|
|00000620| 6f 6e 66 69 67 75 72 65 | 22 20 77 69 6c 6c 0a 58 |onfigure|" will.X|
|00000630| 70 65 72 66 6f 72 6d 20 | 61 6c 6c 20 74 68 65 20 |perform |all the |
|00000640| 6e 65 63 65 73 73 61 72 | 79 20 63 6f 6e 66 69 67 |necessar|y config|
|00000650| 75 72 61 74 69 6f 6e 2e | 20 20 4f 6e 63 65 20 74 |uration.| Once t|
|00000660| 68 69 73 20 69 73 20 66 | 69 6e 69 73 68 65 64 2c |his is f|inished,|
|00000670| 20 74 79 70 65 0a 58 22 | 6d 61 6b 65 20 69 6e 73 | type.X"|make ins|
|00000680| 74 61 6c 6c 22 2e 20 20 | 4d 61 6b 65 20 77 69 6c |tall". |Make wil|
|00000690| 6c 20 63 6f 6d 70 69 6c | 65 20 74 68 65 20 73 6f |l compil|e the so|
|000006a0| 75 72 63 65 73 20 74 68 | 65 6e 20 69 6e 73 74 61 |urces th|en insta|
|000006b0| 6c 6c 20 74 68 65 20 72 | 65 73 75 6c 74 69 6e 67 |ll the r|esulting|
|000006c0| 0a 58 65 78 65 63 75 74 | 61 62 6c 65 20 61 6e 64 |.Xexecut|able and|
|000006d0| 20 6d 61 6e 75 61 6c 20 | 70 61 67 65 20 69 6e 20 | manual |page in |
|000006e0| 74 68 65 20 61 70 70 72 | 6f 70 72 69 61 74 65 20 |the appr|opriate |
|000006f0| 70 6c 61 63 65 73 2e 0a | 58 0a 58 54 68 65 20 6d |places..|X.XThe m|
|00000700| 6f 73 74 20 64 69 66 66 | 69 63 75 6c 74 20 73 74 |ost diff|icult st|
|00000710| 65 70 20 69 6e 20 74 68 | 65 20 63 6f 6e 66 69 67 |ep in th|e config|
|00000720| 75 72 61 74 69 6f 6e 20 | 69 73 20 74 68 65 20 63 |uration |is the c|
|00000730| 68 6f 69 63 65 20 6f 66 | 20 61 6e 0a 58 61 70 70 |hoice of| an.Xapp|
|00000740| 72 6f 70 72 69 61 74 65 | 20 6d 61 63 68 69 6e 65 |ropriate| machine|
|00000750| 2d 73 70 65 63 69 66 69 | 63 20 6d 6f 64 75 6c 65 |-specifi|c module|
|00000760| 2e 20 20 54 68 65 20 43 | 6f 6e 66 69 67 75 72 65 |. The C|onfigure|
|00000770| 20 73 63 72 69 70 74 20 | 67 69 76 65 73 20 79 6f | script |gives yo|
|00000780| 75 20 61 0a 58 6c 69 73 | 74 20 6f 66 20 63 68 6f |u a.Xlis|t of cho|
|00000790| 69 63 65 73 20 63 6f 6d | 70 6c 65 74 65 20 77 69 |ices com|plete wi|
|000007a0| 74 68 20 62 72 69 65 66 | 20 64 65 73 63 72 69 70 |th brief| descrip|
|000007b0| 74 69 6f 6e 73 20 6f 66 | 20 77 68 65 6e 20 65 61 |tions of| when ea|
|000007c0| 63 68 20 63 68 6f 69 63 | 65 20 69 73 0a 58 61 70 |ch choic|e is.Xap|
|000007d0| 70 72 6f 70 72 69 61 74 | 65 2e 20 20 45 61 63 68 |propriat|e. Each|
|000007e0| 20 6d 6f 64 75 6c 65 20 | 69 73 20 63 6f 6e 74 61 | module |is conta|
|000007f0| 69 6e 65 64 20 69 6e 20 | 61 20 73 65 70 61 72 61 |ined in |a separa|
|00000800| 74 65 20 63 20 66 69 6c | 65 20 69 6e 20 74 68 65 |te c fil|e in the|
|00000810| 0a 58 64 69 72 65 63 74 | 6f 72 79 20 22 6d 61 63 |.Xdirect|ory "mac|
|00000820| 68 69 6e 65 22 2e 20 20 | 54 68 65 20 6d 6f 64 75 |hine". |The modu|
|00000830| 6c 65 20 63 6f 6e 74 61 | 69 6e 73 20 61 6c 6c 20 |le conta|ins all |
|00000840| 6f 66 20 74 68 65 20 6d | 61 63 68 69 6e 65 2d 73 |of the m|achine-s|
|00000850| 70 65 63 69 66 69 63 20 | 63 6f 64 65 0a 58 74 68 |pecific |code.Xth|
|00000860| 61 74 20 6d 61 6b 65 73 | 20 74 6f 70 20 77 6f 72 |at makes| top wor|
|00000870| 6b 20 63 6f 72 72 65 63 | 74 6c 79 20 6f 6e 20 74 |k correc|tly on t|
|00000880| 68 65 20 61 72 63 68 69 | 74 65 63 74 75 72 65 20 |he archi|tecture |
|00000890| 69 6e 20 71 75 65 73 74 | 69 6f 6e 2e 20 20 41 6c |in quest|ion. Al|
|000008a0| 6c 20 6f 66 20 74 68 65 | 0a 58 63 6f 64 65 20 69 |l of the|.Xcode i|
|000008b0| 6e 20 74 68 65 20 74 6f | 70 2d 6c 65 76 65 6c 20 |n the to|p-level |
|000008c0| 64 69 72 65 63 74 6f 72 | 79 20 69 73 20 6d 61 63 |director|y is mac|
|000008d0| 68 69 6e 65 2d 69 6e 64 | 65 70 65 6e 64 65 6e 74 |hine-ind|ependent|
|000008e0| 20 28 6f 72 20 61 74 20 | 6c 65 61 73 74 0a 58 73 | (or at |least.Xs|
|000008f0| 74 72 69 76 65 73 20 74 | 6f 20 62 65 29 2e 20 20 |trives t|o be). |
|00000900| 48 69 6e 74 73 20 66 6f | 72 20 73 6f 6d 65 20 6d |Hints fo|r some m|
|00000910| 6f 64 75 6c 65 20 63 68 | 6f 69 63 65 73 20 74 68 |odule ch|oices th|
|00000920| 61 74 20 61 72 65 20 6e | 6f 74 20 6f 62 76 69 6f |at are n|ot obvio|
|00000930| 75 73 20 61 72 65 0a 58 | 67 69 76 65 6e 20 61 74 |us are.X|given at|
|00000940| 20 74 68 65 20 65 6e 64 | 20 6f 66 20 74 68 69 73 | the end| of this|
|00000950| 20 66 69 6c 65 2e 0a 58 | 0a 58 54 68 65 20 66 69 | file..X|.XThe fi|
|00000960| 72 73 74 20 63 6f 6d 6d | 65 6e 74 20 69 6e 20 65 |rst comm|ent in e|
|00000970| 61 63 68 20 63 20 66 69 | 6c 65 20 69 6e 20 74 68 |ach c fi|le in th|
|00000980| 61 74 20 64 69 72 65 63 | 74 6f 72 79 20 63 6f 6e |at direc|tory con|
|00000990| 74 61 69 6e 73 20 74 68 | 65 20 73 79 6e 6f 70 73 |tains th|e synops|
|000009a0| 69 73 0a 58 41 4e 44 20 | 61 20 64 65 74 61 69 6c |is.XAND |a detail|
|000009b0| 65 64 20 64 65 73 63 72 | 69 70 74 69 6f 6e 20 6f |ed descr|iption o|
|000009c0| 66 20 74 68 65 20 6d 61 | 63 68 69 6e 65 73 20 66 |f the ma|chines f|
|000009d0| 6f 72 20 77 68 69 63 68 | 20 74 68 61 74 20 6d 6f |or which| that mo|
|000009e0| 64 75 6c 65 20 69 73 0a | 58 61 70 70 72 6f 70 72 |dule is.|Xappropr|
|000009f0| 69 61 74 65 2e 20 20 49 | 74 20 61 6c 73 6f 20 63 |iate. I|t also c|
|00000a00| 6f 6e 74 61 69 6e 73 20 | 61 20 6c 69 73 74 20 6f |ontains |a list o|
|00000a10| 66 20 61 75 74 68 6f 72 | 73 20 66 6f 72 20 74 68 |f author|s for th|
|00000a20| 61 74 20 6d 6f 64 75 6c | 65 2e 20 20 49 66 20 79 |at modul|e. If y|
|00000a30| 6f 75 0a 58 61 72 65 20 | 72 65 61 6c 6c 79 20 73 |ou.Xare |really s|
|00000a40| 74 75 6d 70 65 64 20 69 | 6e 20 74 68 69 73 20 63 |tumped i|n this c|
|00000a50| 68 6f 69 63 65 2c 20 75 | 73 65 20 67 72 65 70 20 |hoice, u|se grep |
|00000a60| 74 6f 20 66 69 6e 64 20 | 79 6f 75 72 20 6d 61 63 |to find |your mac|
|00000a70| 68 69 6e 65 0a 58 6d 61 | 6e 75 66 61 63 74 75 72 |hine.Xma|nufactur|
|00000a80| 65 72 27 73 20 6e 61 6d | 65 20 6f 72 20 6f 70 65 |er's nam|e or ope|
|00000a90| 72 61 74 69 6e 67 20 73 | 79 73 74 65 6d 20 6e 61 |rating s|ystem na|
|00000aa0| 6d 65 20 69 6e 20 6d 61 | 63 68 69 6e 65 2f 2a 2e |me in ma|chine/*.|
|00000ab0| 63 2e 20 20 49 66 20 79 | 6f 75 20 73 74 69 6c 6c |c. If y|ou still|
|00000ac0| 0a 58 63 61 6e 27 74 20 | 66 69 6e 64 20 6f 6e 65 |.Xcan't |find one|
|00000ad0| 20 74 68 61 74 20 69 73 | 20 61 70 70 72 6f 70 72 | that is| appropr|
|00000ae0| 69 61 74 65 2c 20 74 68 | 65 6e 20 63 68 61 6e 63 |iate, th|en chanc|
|00000af0| 65 73 20 61 72 65 20 76 | 65 72 79 20 67 6f 6f 64 |es are v|ery good|
|00000b00| 20 74 68 61 74 20 6f 6e | 65 0a 58 68 61 73 6e 27 | that on|e.Xhasn'|
|00000b10| 74 20 62 65 65 6e 20 77 | 72 69 74 74 65 6e 20 79 |t been w|ritten y|
|00000b20| 65 74 2e 20 20 49 66 20 | 74 68 61 74 20 69 73 20 |et. If |that is |
|00000b30| 74 68 65 20 63 61 73 65 | 2c 20 74 68 65 6e 20 79 |the case|, then y|
|00000b40| 6f 75 20 61 72 65 20 6f | 75 74 20 6f 66 20 6c 75 |ou are o|ut of lu|
|00000b50| 63 6b 2e 0a 58 0a 58 48 | 41 4e 44 4c 49 4e 47 20 |ck..X.XH|ANDLING |
|00000b60| 4d 55 4c 54 49 50 4c 45 | 20 41 52 43 48 49 54 45 |MULTIPLE| ARCHITE|
|00000b70| 43 54 55 52 45 53 0a 58 | 0a 58 49 66 20 79 6f 75 |CTURES.X|.XIf you|
|00000b80| 20 6e 65 65 64 20 74 6f | 20 72 65 63 6f 6d 70 69 | need to| recompi|
|00000b90| 6c 65 20 74 6f 70 20 66 | 6f 72 20 61 20 64 69 66 |le top f|or a dif|
|00000ba0| 66 65 72 65 6e 74 20 61 | 72 63 68 69 74 65 63 74 |ferent a|rchitect|
|00000bb0| 75 72 65 20 28 74 68 61 | 74 20 69 73 2c 20 75 73 |ure (tha|t is, us|
|00000bc0| 69 6e 67 0a 58 61 20 64 | 69 66 66 65 72 65 6e 74 |ing.Xa d|ifferent|
|00000bd0| 20 6d 6f 64 75 6c 65 29 | 20 79 6f 75 20 6e 65 65 | module)| you nee|
|00000be0| 64 20 74 6f 20 72 65 63 | 6f 6e 66 69 67 75 72 65 |d to rec|onfigure|
|00000bf0| 20 74 6f 70 2e 20 20 41 | 20 73 68 6f 72 74 20 63 | top. A| short c|
|00000c00| 75 74 20 69 73 20 61 76 | 61 69 6c 61 62 6c 65 0a |ut is av|ailable.|
|00000c10| 58 74 6f 20 6d 61 6b 65 | 20 74 68 69 73 20 61 20 |Xto make| this a |
|00000c20| 6c 69 74 74 6c 65 20 65 | 61 73 69 65 72 2e 20 20 |little e|asier. |
|00000c30| 49 66 20 61 6c 6c 20 6f | 66 20 79 6f 75 72 20 70 |If all o|f your p|
|00000c40| 72 65 76 69 6f 75 73 20 | 61 6e 73 77 65 72 73 20 |revious |answers |
|00000c50| 74 6f 20 74 68 65 0a 58 | 63 6f 6e 66 69 67 75 72 |to the.X|configur|
|00000c60| 61 74 69 6f 6e 20 71 75 | 65 73 74 69 6f 6e 73 20 |ation qu|estions |
|00000c70| 28 65 78 63 65 70 74 20 | 66 6f 72 20 74 68 65 20 |(except |for the |
|00000c80| 6d 6f 64 75 6c 65 20 6e | 61 6d 65 20 6f 66 20 63 |module n|ame of c|
|00000c90| 6f 75 72 73 65 29 20 61 | 72 65 0a 58 61 64 65 71 |ourse) a|re.Xadeq|
|00000ca0| 75 61 74 65 20 66 6f 72 | 20 74 68 65 20 6e 65 77 |uate for| the new|
|00000cb0| 20 61 72 63 68 69 74 65 | 63 74 75 72 65 2c 20 74 | archite|cture, t|
|00000cc0| 68 65 6e 20 79 6f 75 20 | 63 61 6e 20 6a 75 73 74 |hen you |can just|
|00000cd0| 20 75 73 65 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 | use the| command|
|00000ce0| 0a 58 22 43 6f 6e 66 69 | 67 75 72 65 20 3c 6d 6f |.X"Confi|gure <mo|
|00000cf0| 64 75 6c 65 6e 61 6d 65 | 3e 22 2e 20 20 54 68 65 |dulename|>". The|
|00000d00| 20 63 6f 6e 66 69 67 75 | 72 61 74 69 6f 6e 20 73 | configu|ration s|
|00000d10| 63 72 69 70 74 20 77 69 | 6c 6c 20 72 65 63 6f 6e |cript wi|ll recon|
|00000d20| 66 69 67 75 72 65 20 74 | 6f 70 0a 58 75 73 69 6e |figure t|op.Xusin|
|00000d30| 67 20 74 68 65 20 6e 65 | 77 20 6d 6f 64 75 6c 65 |g the ne|w module|
|00000d40| 20 61 6e 64 20 61 6c 6c | 20 74 68 65 20 61 6e 73 | and all| the ans|
|00000d50| 77 65 72 73 20 79 6f 75 | 20 67 61 76 65 20 6c 61 |wers you| gave la|
|00000d60| 73 74 20 74 69 6d 65 2e | 20 20 49 74 20 77 69 6c |st time.| It wil|
|00000d70| 6c 0a 58 66 69 6e 69 73 | 68 20 77 69 74 68 20 61 |l.Xfinis|h with a|
|00000d80| 20 22 6d 61 6b 65 20 63 | 6c 65 61 6e 22 2e 20 20 | "make c|lean". |
|00000d90| 4f 6e 63 65 20 74 68 61 | 74 20 63 6f 6d 70 6c 65 |Once tha|t comple|
|00000da0| 74 65 73 2c 20 74 79 70 | 65 20 22 6d 61 6b 65 20 |tes, typ|e "make |
|00000db0| 69 6e 73 74 61 6c 6c 22 | 0a 58 61 6e 64 20 6d 61 |install"|.Xand ma|
|00000dc0| 6b 65 20 77 69 6c 6c 20 | 63 6f 6d 70 69 6c 65 20 |ke will |compile |
|00000dd0| 74 68 65 20 73 6f 75 72 | 63 65 73 20 61 6e 64 20 |the sour|ces and |
|00000de0| 64 6f 20 74 68 65 20 69 | 6e 73 74 61 6c 6c 61 74 |do the i|nstallat|
|00000df0| 69 6f 6e 2e 0a 58 0a 58 | 48 41 4e 44 4c 49 4e 47 |ion..X.X|HANDLING|
|00000e00| 20 4d 55 4c 54 49 50 4c | 45 20 4f 53 20 56 45 52 | MULTIPL|E OS VER|
|00000e10| 53 49 4f 4e 53 0a 58 0a | 58 42 79 20 66 61 72 20 |SIONS.X.|XBy far |
|00000e20| 74 68 65 20 6d 6f 73 74 | 20 66 72 65 71 75 65 6e |the most| frequen|
|00000e30| 74 6c 79 20 72 65 63 65 | 69 76 65 64 20 62 75 67 |tly rece|ived bug|
|00000e40| 20 72 65 70 6f 72 74 20 | 66 6f 72 20 74 6f 70 20 | report |for top |
|00000e50| 69 73 20 73 6f 6d 65 74 | 68 69 6e 67 20 6c 69 6b |is somet|hing lik|
|00000e60| 65 0a 58 74 68 69 73 3a | 20 22 57 65 20 6a 75 73 |e.Xthis:| "We jus|
|00000e70| 74 20 75 70 67 72 61 64 | 65 64 20 6f 75 72 20 6f |t upgrad|ed our o|
|00000e80| 70 65 72 61 74 69 6e 67 | 20 73 79 73 74 65 6d 20 |perating| system |
|00000e90| 74 6f 20 76 65 72 73 69 | 6f 6e 20 39 39 2e 39 2e |to versi|on 99.9.|
|00000ea0| 39 2e 39 20 61 6e 64 20 | 74 6f 70 0a 58 62 72 6f |9.9 and |top.Xbro|
|00000eb0| 6b 65 2e 20 20 57 68 61 | 74 20 73 68 6f 75 6c 64 |ke. Wha|t should|
|00000ec0| 20 77 65 20 64 6f 3f 22 | 20 20 54 68 65 20 73 69 | we do?"| The si|
|00000ed0| 6d 70 6c 65 20 61 6e 73 | 77 65 72 20 69 73 20 22 |mple ans|wer is "|
|00000ee0| 72 65 63 6f 6d 70 69 6c | 65 22 2e 0a 58 0a 58 54 |recompil|e"..X.XT|
|00000ef0| 6f 70 20 69 73 20 76 65 | 72 79 20 73 65 6e 73 69 |op is ve|ry sensi|
|00000f00| 74 69 76 65 20 74 6f 20 | 63 68 61 6e 67 65 73 20 |tive to |changes |
|00000f10| 69 6e 20 69 6e 74 65 72 | 6e 61 6c 20 6b 65 72 6e |in inter|nal kern|
|00000f20| 65 6c 20 64 61 74 61 20 | 73 74 72 75 63 74 75 72 |el data |structur|
|00000f30| 65 73 0a 58 28 65 73 70 | 65 63 69 61 6c 6c 79 20 |es.X(esp|ecially |
|00000f40| 74 68 65 20 70 72 6f 63 | 20 61 6e 64 20 75 73 65 |the proc| and use|
|00000f50| 72 20 73 74 72 75 63 74 | 75 72 65 73 29 2e 20 20 |r struct|ures). |
|00000f60| 53 6f 6d 65 20 6f 70 65 | 72 61 74 69 6e 67 20 73 |Some ope|rating s|
|00000f70| 79 73 74 65 6d 73 0a 58 | 28 65 73 70 65 63 69 61 |ystems.X|(especia|
|00000f80| 6c 6c 79 20 53 75 6e 4f | 53 29 20 61 72 65 20 6e |lly SunO|S) are n|
|00000f90| 6f 74 6f 72 69 6f 75 73 | 20 66 6f 72 20 63 68 61 |otorious| for cha|
|00000fa0| 6e 67 69 6e 67 20 74 68 | 65 73 65 20 73 74 72 75 |nging th|ese stru|
|00000fb0| 63 74 75 72 65 20 69 6e | 20 65 76 65 72 79 0a 58 |cture in| every.X|
|00000fc0| 6d 69 6e 6f 72 20 72 65 | 6c 65 61 73 65 20 6f 66 |minor re|lease of|
|00000fd0| 20 74 68 65 20 4f 53 2e | 20 20 54 68 69 73 20 6d | the OS.| This m|
|00000fe0| 65 61 6e 73 20 74 68 61 | 74 20 61 20 74 6f 70 20 |eans tha|t a top |
|00000ff0| 65 78 65 63 75 74 61 62 | 6c 65 20 6d 61 64 65 20 |executab|le made |
|00001000| 75 6e 64 65 72 20 6f 6e | 65 0a 58 76 65 72 73 69 |under on|e.Xversi|
|00001010| 6f 6e 20 6f 66 20 74 68 | 65 20 4f 53 20 77 69 6c |on of th|e OS wil|
|00001020| 6c 20 6e 6f 74 20 61 6c | 77 61 79 73 20 77 6f 72 |l not al|ways wor|
|00001030| 6b 20 63 6f 72 72 65 63 | 74 6c 79 20 28 69 66 20 |k correc|tly (if |
|00001040| 65 76 65 6e 20 61 74 20 | 61 6c 6c 29 20 75 6e 64 |even at |all) und|
|00001050| 65 72 0a 58 61 6e 6f 74 | 68 65 72 20 76 65 72 73 |er.Xanot|her vers|
|00001060| 69 6f 6e 2e 20 20 54 68 | 69 73 20 69 73 20 6a 75 |ion. Th|is is ju|
|00001070| 73 74 20 6f 6e 65 20 6f | 66 20 74 68 6f 73 65 20 |st one o|f those |
|00001080| 74 6f 75 67 68 20 66 61 | 63 74 73 20 6f 66 20 6c |tough fa|cts of l|
|00001090| 69 66 65 2e 20 20 54 68 | 65 72 65 20 69 73 0a 58 |ife. Th|ere is.X|
|000010a0| 72 65 61 6c 6c 79 20 6e | 6f 20 77 61 79 20 61 72 |really n|o way ar|
|000010b0| 6f 75 6e 64 20 69 74 2e | 0a 58 0a 58 54 6f 20 6d |ound it.|.X.XTo m|
|000010c0| 61 6b 65 20 6c 69 66 65 | 20 65 76 65 6e 20 77 6f |ake life| even wo|
|000010d0| 72 73 65 2c 20 73 6f 6d | 65 20 6f 70 65 72 61 74 |rse, som|e operat|
|000010e0| 69 6e 67 20 73 79 73 74 | 65 6d 73 20 28 53 75 6e |ing syst|ems (Sun|
|000010f0| 4f 53 20 61 67 61 69 6e | 29 20 77 69 6c 6c 20 75 |OS again|) will u|
|00001100| 73 65 0a 58 73 6c 69 67 | 68 74 6c 79 20 64 69 66 |se.Xslig|htly dif|
|00001110| 66 65 72 65 6e 74 20 70 | 72 6f 63 20 61 6e 64 20 |ferent p|roc and |
|00001120| 75 73 65 72 20 73 74 72 | 75 63 74 75 72 65 73 20 |user str|uctures |
|00001130| 6f 6e 20 64 69 66 66 65 | 72 65 6e 74 20 6d 6f 64 |on diffe|rent mod|
|00001140| 65 6c 73 2e 20 20 46 6f | 72 0a 58 65 78 61 6d 70 |els. Fo|r.Xexamp|
|00001150| 6c 65 2c 20 22 74 6f 70 | 22 20 62 75 69 6c 74 20 |le, "top|" built |
|00001160| 6f 6e 20 61 20 53 70 61 | 72 63 53 74 61 74 69 6f |on a Spa|rcStatio|
|00001170| 6e 20 32 20 77 69 6c 6c | 20 6e 6f 74 20 72 75 6e |n 2 will| not run|
|00001180| 20 63 6f 72 72 65 63 74 | 6c 79 20 6f 6e 20 61 0a | correct|ly on a.|
|00001190| 58 53 70 61 72 63 53 74 | 61 74 69 6f 6e 20 31 30 |XSparcSt|ation 10|
|000011a0| 2c 20 65 76 65 6e 20 69 | 66 20 74 68 65 79 20 61 |, even i|f they a|
|000011b0| 72 65 20 62 6f 74 68 20 | 72 75 6e 6e 69 6e 67 20 |re both |running |
|000011c0| 53 75 6e 4f 53 20 34 2e | 31 2e 33 2e 20 20 54 68 |SunOS 4.|1.3. Th|
|000011d0| 65 73 65 0a 58 75 6e 66 | 6f 72 74 75 6e 61 74 65 |ese.Xunf|ortunate|
|000011e0| 20 63 69 72 63 75 6d 73 | 74 61 6e 63 65 73 20 6d | circums|tances m|
|000011f0| 61 6b 65 73 20 6d 61 69 | 6e 74 61 69 6e 69 6e 67 |akes mai|ntaining|
|00001200| 20 74 6f 70 20 76 65 72 | 79 20 64 69 66 66 69 63 | top ver|y diffic|
|00001210| 75 6c 74 2c 20 65 73 70 | 65 63 69 61 6c 6c 79 0a |ult, esp|ecially.|
|00001220| 58 69 6e 20 61 6e 20 65 | 6e 76 69 72 6f 6e 6d 65 |Xin an e|nvironme|
|00001230| 6e 74 20 74 68 61 74 20 | 72 75 6e 73 20 73 65 76 |nt that |runs sev|
|00001240| 65 72 61 6c 20 64 69 66 | 66 65 72 65 6e 74 20 76 |eral dif|ferent v|
|00001250| 65 72 73 69 6f 6e 73 20 | 6f 66 20 74 68 65 20 73 |ersions |of the s|
|00001260| 61 6d 65 0a 58 6f 70 65 | 72 61 74 69 6e 67 20 73 |ame.Xope|rating s|
|00001270| 79 73 74 65 6d 2e 0a 58 | 0a 58 42 75 74 20 74 68 |ystem..X|.XBut th|
|00001280| 65 72 65 20 69 73 20 68 | 6f 70 65 2e 20 20 49 66 |ere is h|ope. If|
|00001290| 20 79 6f 75 72 20 6f 70 | 65 72 61 74 69 6e 67 20 | your op|erating |
|000012a0| 73 79 73 74 65 6d 20 68 | 61 73 20 61 20 70 72 6f |system h|as a pro|
|000012b0| 70 65 72 6c 79 20 66 75 | 6e 63 74 69 6f 6e 69 6e |perly fu|nctionin|
|000012c0| 67 0a 58 22 75 6e 61 6d | 65 22 20 63 6f 6d 6d 61 |g.X"unam|e" comma|
|000012d0| 6e 64 20 74 68 65 6e 20 | 79 6f 75 20 63 61 6e 20 |nd then |you can |
|000012e0| 68 61 6e 64 6c 65 20 74 | 68 69 73 20 70 72 6f 62 |handle t|his prob|
|000012f0| 6c 65 6d 20 72 61 74 68 | 65 72 20 67 72 61 63 65 |lem rath|er grace|
|00001300| 66 75 6c 6c 79 2e 0a 58 | 49 6e 63 6c 75 64 65 64 |fully..X|Included|
|00001310| 20 69 6e 20 74 68 65 20 | 64 69 73 74 72 69 62 75 | in the |distribu|
|00001320| 74 69 6f 6e 20 69 73 20 | 61 20 73 68 65 6c 6c 20 |tion is |a shell |
|00001330| 66 69 6c 65 20 63 61 6c | 6c 65 64 20 22 6d 65 74 |file cal|led "met|
|00001340| 61 74 6f 70 22 2e 20 20 | 41 6c 6c 20 74 68 69 73 |atop". |All this|
|00001350| 0a 58 73 68 65 6c 6c 20 | 66 69 6c 65 20 64 6f 65 |.Xshell |file doe|
|00001360| 73 20 69 73 3a 0a 58 0a | 58 09 65 78 65 63 20 74 |s is:.X.|X.exec t|
|00001370| 6f 70 2d 60 75 6e 61 6d | 65 20 2d 6d 60 2d 60 75 |op-`unam|e -m`-`u|
|00001380| 6e 61 6d 65 20 2d 72 60 | 20 22 24 40 22 0a 58 0a |name -r`| "$@".X.|
|00001390| 58 53 6f 20 77 68 65 6e | 20 79 6f 75 20 72 75 6e |XSo when| you run|
|000013a0| 20 74 68 69 73 20 73 63 | 72 69 70 74 2c 20 69 74 | this sc|ript, it|
|000013b0| 20 65 78 65 63 73 20 61 | 20 66 69 6c 65 6e 61 6d | execs a| filenam|
|000013c0| 65 20 74 68 61 74 20 69 | 73 20 75 6e 69 71 75 65 |e that i|s unique|
|000013d0| 20 74 6f 20 79 6f 75 72 | 0a 58 73 70 65 63 69 66 | to your|.Xspecif|
|000013e0| 69 63 20 6d 61 63 68 69 | 6e 65 20 61 72 63 68 69 |ic machi|ne archi|
|000013f0| 74 65 63 74 75 72 65 20 | 61 6e 64 20 79 6f 75 72 |tecture |and your|
|00001400| 20 4f 53 20 72 65 76 69 | 73 69 6f 6e 20 6e 75 6d | OS revi|sion num|
|00001410| 62 65 72 2e 0a 58 0a 58 | 54 6f 20 75 73 65 20 22 |ber..X.X|To use "|
|00001420| 6d 65 74 61 74 6f 70 22 | 2c 20 64 6f 20 74 68 65 |metatop"|, do the|
|00001430| 20 66 6f 6c 6c 6f 77 69 | 6e 67 3a 0a 58 0a 58 09 | followi|ng:.X.X.|
|00001440| 2e 20 6f 6e 20 61 6e 79 | 20 6d 61 63 68 69 6e 65 |. on any| machine|
|00001450| 2c 20 72 75 6e 20 43 6f | 6e 66 69 67 75 72 65 20 |, run Co|nfigure |
|00001460| 61 6e 64 20 63 68 6f 6f | 73 65 20 74 68 65 20 6d |and choo|se the m|
|00001470| 6f 64 75 6c 65 20 74 68 | 61 74 20 69 73 0a 58 09 |odule th|at is.X.|
|00001480| 20 20 61 70 70 72 6f 70 | 72 69 61 74 65 20 66 6f | approp|riate fo|
|00001490| 72 20 74 68 65 20 6d 61 | 63 68 69 6e 65 0a 58 09 |r the ma|chine.X.|
|000014a0| 2e 20 66 6f 72 20 61 6c | 6c 20 6d 61 63 68 69 6e |. for al|l machin|
|000014b0| 65 73 20 77 68 69 63 68 | 20 75 73 65 20 74 68 65 |es which| use the|
|000014c0| 20 73 61 6d 65 20 6d 6f | 64 75 6c 65 3a 0a 58 09 | same mo|dule:.X.|
|000014d0| 20 20 20 20 2e 20 67 72 | 6f 75 70 20 6d 61 63 68 | . gr|oup mach|
|000014e0| 69 6e 65 73 20 61 63 63 | 6f 72 64 69 6e 67 20 74 |ines acc|ording t|
|000014f0| 6f 20 6d 61 63 68 69 6e | 65 20 61 72 63 68 69 74 |o machin|e archit|
|00001500| 65 63 74 75 72 65 20 41 | 4e 44 20 4f 53 0a 58 09 |ecture A|ND OS.X.|
|00001510| 20 20 20 20 20 20 72 65 | 76 69 73 69 6f 6e 20 6e | re|vision n|
|00001520| 75 6d 62 65 72 20 28 69 | 2e 65 2e 3a 20 73 75 6e |umber (i|.e.: sun|
|00001530| 34 2d 34 2e 31 2e 31 2c | 20 73 75 6e 34 63 2d 34 |4-4.1.1,| sun4c-4|
|00001540| 2e 31 2e 31 2c 20 73 75 | 6e 34 63 2d 34 2e 31 2e |.1.1, su|n4c-4.1.|
|00001550| 32 2c 0a 58 09 20 20 20 | 20 20 20 73 75 6e 34 2d |2,.X. | sun4-|
|00001560| 34 2e 31 2e 33 2c 20 73 | 75 6e 34 63 2d 34 2e 31 |4.1.3, s|un4c-4.1|
|00001570| 2e 33 2c 20 73 75 6e 34 | 6d 2d 34 2e 31 2e 33 2c |.3, sun4|m-4.1.3,|
|00001580| 20 2e 2e 2e 29 0a 58 09 | 20 20 20 20 2e 20 66 6f | ...).X.| . fo|
|00001590| 72 20 65 61 63 68 20 67 | 72 6f 75 70 2c 20 63 68 |r each g|roup, ch|
|000015a0| 6f 6f 73 65 20 6f 6e 65 | 20 6d 61 63 68 69 6e 65 |oose one| machine|
|000015b0| 20 66 72 6f 6d 20 74 68 | 61 74 20 67 72 6f 75 70 | from th|at group|
|000015c0| 20 61 6e 64 20 6f 6e 20 | 69 74 0a 58 09 20 20 20 | and on |it.X. |
|000015d0| 20 20 20 72 75 6e 20 22 | 6d 61 6b 65 20 63 6c 65 | run "|make cle|
|000015e0| 61 6e 3b 20 6d 61 6b 65 | 20 69 6e 73 74 61 6c 6c |an; make| install|
|000015f0| 6d 65 74 61 22 2e 0a 58 | 0a 58 0a 58 54 68 65 20 |meta"..X|.X.XThe |
|00001600| 22 69 6e 73 74 61 6c 6c | 6d 65 74 61 22 20 72 75 |"install|meta" ru|
|00001610| 6c 65 20 69 6e 20 74 68 | 65 20 6d 61 6b 65 66 69 |le in th|e makefi|
|00001620| 6c 65 20 77 69 6c 6c 20 | 69 6e 73 75 72 65 20 74 |le will |insure t|
|00001630| 68 61 74 20 74 6f 70 20 | 69 73 20 63 6f 6d 70 69 |hat top |is compi|
|00001640| 6c 65 64 2c 0a 58 69 6e | 73 74 61 6c 6c 20 74 68 |led,.Xin|stall th|
|00001650| 65 20 73 68 65 6c 6c 20 | 66 69 6c 65 20 22 6d 65 |e shell |file "me|
|00001660| 74 61 74 6f 70 22 20 61 | 73 20 22 74 6f 70 22 2c |tatop" a|s "top",|
|00001670| 20 74 68 65 6e 20 69 6e | 73 74 61 6c 6c 20 74 68 | then in|stall th|
|00001680| 65 20 65 78 65 63 75 74 | 61 62 6c 65 0a 58 22 74 |e execut|able.X"t|
|00001690| 6f 70 22 20 77 69 74 68 | 20 61 20 6e 61 6d 65 20 |op" with| a name |
|000016a0| 61 70 70 72 6f 70 72 69 | 61 74 65 20 74 6f 20 74 |appropri|ate to t|
|000016b0| 68 65 20 6d 61 63 68 69 | 6e 65 20 61 72 63 68 69 |he machi|ne archi|
|000016c0| 74 65 63 74 75 72 65 20 | 61 6e 64 20 4f 53 20 72 |tecture |and OS r|
|000016d0| 65 76 69 73 69 6f 6e 2e | 0a 58 0a 58 0a 58 48 49 |evision.|.X.X.XHI|
|000016e0| 4e 54 53 20 46 4f 52 20 | 43 48 4f 4f 53 49 4e 47 |NTS FOR |CHOOSING|
|000016f0| 20 54 48 45 20 43 4f 52 | 52 45 43 54 20 4d 4f 44 | THE COR|RECT MOD|
|00001700| 55 4c 45 3a 0a 58 0a 58 | 53 55 4e 20 4d 55 4c 54 |ULE:.X.X|SUN MULT|
|00001710| 49 50 52 4f 43 45 53 53 | 4f 52 20 41 52 43 48 49 |IPROCESS|OR ARCHI|
|00001720| 54 45 43 54 55 52 45 53 | 0a 58 0a 58 46 69 72 73 |TECTURES|.X.XFirs|
|00001730| 74 2c 20 77 65 20 6e 65 | 65 64 20 74 6f 20 62 65 |t, we ne|ed to be|
|00001740| 20 73 70 65 61 6b 69 6e | 67 20 74 68 65 20 73 61 | speakin|g the sa|
|00001750| 6d 65 20 6c 61 6e 67 75 | 61 67 65 3a 0a 58 0a 58 |me langu|age:.X.X|
|00001760| 73 75 6e 34 09 61 20 72 | 65 67 75 6c 61 72 20 73 |sun4.a r|egular s|
|00001770| 70 61 72 63 20 73 75 6e | 20 34 20 61 72 63 68 69 |parc sun| 4 archi|
|00001780| 74 65 63 74 75 72 65 20 | 6d 61 63 68 69 6e 65 20 |tecture |machine |
|00001790| 28 73 70 61 72 63 20 73 | 74 61 74 69 6f 6e 20 31 |(sparc s|tation 1|
|000017a0| 2c 0a 58 09 73 70 61 72 | 63 20 73 74 61 74 69 6f |,.X.spar|c statio|
|000017b0| 6e 20 32 2c 20 49 50 43 | 2c 20 53 4c 43 2c 20 65 |n 2, IPC|, SLC, e|
|000017c0| 74 63 2e 29 0a 58 0a 58 | 73 75 6e 34 6d 09 61 20 |tc.).X.X|sun4m.a |
|000017d0| 6d 75 6c 74 69 70 72 6f | 63 65 73 73 6f 72 20 73 |multipro|cessor s|
|000017e0| 70 61 72 63 20 28 53 70 | 61 72 63 20 31 30 2c 20 |parc (Sp|arc 10, |
|000017f0| 34 2f 36 37 30 2c 20 34 | 2f 36 39 30 29 0a 58 0a |4/670, 4|/690).X.|
|00001800| 58 49 20 69 6e 74 65 6e | 64 65 64 20 74 6f 20 77 |XI inten|ded to w|
|00001810| 72 69 74 65 20 74 68 65 | 20 73 75 6e 6f 73 34 20 |rite the| sunos4 |
|00001820| 6d 6f 64 75 6c 65 20 73 | 6f 20 74 68 61 74 20 61 |module s|o that a|
|00001830| 6e 20 65 78 65 63 75 74 | 61 62 6c 65 20 63 6f 6d |n execut|able com|
|00001840| 70 69 6c 65 64 20 6f 6e | 20 61 0a 58 73 75 6e 34 |piled on| a.Xsun4|
|00001850| 6d 20 6d 61 63 68 69 6e | 65 20 77 6f 75 6c 64 20 |m machin|e would |
|00001860| 77 6f 72 6b 20 63 6f 72 | 72 65 63 74 6c 79 20 6f |work cor|rectly o|
|00001870| 6e 20 61 20 73 75 6e 34 | 20 6d 61 63 68 69 6e 65 |n a sun4| machine|
|00001880| 2e 20 20 55 6e 66 6f 72 | 74 75 6e 61 74 65 6c 79 |. Unfor|tunately|
|00001890| 20 6d 79 0a 58 65 78 70 | 65 72 69 6d 65 6e 74 73 | my.Xexp|eriments|
|000018a0| 20 69 6e 64 69 63 61 74 | 65 20 74 68 61 74 20 74 | indicat|e that t|
|000018b0| 68 69 73 20 63 61 6e 6e | 6f 74 20 62 65 20 64 6f |his cann|ot be do|
|000018c0| 6e 65 2e 20 20 49 74 20 | 74 75 72 6e 73 20 6f 75 |ne. It |turns ou|
|000018d0| 74 20 74 68 61 74 20 74 | 68 65 20 75 73 65 72 0a |t that t|he user.|
|000018e0| 58 73 74 72 75 63 74 75 | 72 65 20 69 73 20 73 6f |Xstructu|re is so|
|000018f0| 20 64 69 66 66 65 72 65 | 6e 74 20 62 65 74 77 65 | differe|nt betwe|
|00001900| 65 6e 20 74 68 65 73 65 | 20 74 77 6f 20 61 72 63 |en these| two arc|
|00001910| 68 69 74 65 63 74 75 72 | 65 73 20 74 68 61 74 20 |hitectur|es that |
|00001920| 6e 6f 74 68 69 6e 67 0a | 58 73 68 6f 72 74 20 6f |nothing.|Xshort o|
|00001930| 66 20 61 20 73 65 72 69 | 6f 75 73 20 68 61 63 6b |f a seri|ous hack|
|00001940| 20 77 69 6c 6c 20 6d 61 | 6b 65 20 74 68 65 20 73 | will ma|ke the s|
|00001950| 61 6d 65 20 65 78 65 63 | 75 74 61 62 6c 65 20 77 |ame exec|utable w|
|00001960| 6f 72 6b 20 63 6f 72 72 | 65 63 74 6c 79 20 6f 6e |ork corr|ectly on|
|00001970| 0a 58 62 6f 74 68 20 6d | 61 63 68 69 6e 65 73 2e |.Xboth m|achines.|
|00001980| 20 20 49 20 72 65 63 6f | 6d 6d 65 6e 64 20 74 68 | I reco|mmend th|
|00001990| 61 74 20 79 6f 75 20 75 | 73 65 20 74 68 65 20 73 |at you u|se the s|
|000019a0| 65 70 61 72 61 74 65 20 | 6d 6f 64 75 6c 65 20 22 |eparate |module "|
|000019b0| 73 75 6e 6f 73 34 6d 70 | 22 0a 58 77 68 65 6e 20 |sunos4mp|".Xwhen |
|000019c0| 6d 61 6b 69 6e 67 20 61 | 6e 20 65 78 65 63 75 74 |making a|n execut|
|000019d0| 61 62 6c 65 20 66 6f 72 | 20 61 20 73 75 6e 34 6d |able for| a sun4m|
|000019e0| 20 61 72 63 68 69 74 65 | 63 74 75 72 65 2c 20 61 | archite|cture, a|
|000019f0| 6e 64 20 75 73 65 20 22 | 73 75 6e 6f 73 34 22 20 |nd use "|sunos4" |
|00001a00| 77 68 65 6e 0a 58 6d 61 | 6b 69 6e 67 20 61 6e 20 |when.Xma|king an |
|00001a10| 65 78 65 63 75 74 61 62 | 6c 65 20 66 6f 72 20 73 |executab|le for s|
|00001a20| 75 6e 34 20 6f 72 20 73 | 75 6e 34 63 20 61 72 63 |un4 or s|un4c arc|
|00001a30| 68 69 74 65 63 74 75 72 | 65 73 2e 0a 58 0a 58 54 |hitectur|es..X.XT|
|00001a40| 68 65 72 65 20 69 73 20 | 61 20 62 75 67 20 69 6e |here is |a bug in|
|00001a50| 20 74 68 65 20 73 75 6e | 6f 73 35 20 6d 6f 64 75 | the sun|os5 modu|
|00001a60| 6c 65 20 77 68 69 63 68 | 20 70 72 65 76 65 6e 74 |le which| prevent|
|00001a70| 73 20 69 74 20 66 72 6f | 6d 20 77 6f 72 6b 69 6e |s it fro|m workin|
|00001a80| 67 0a 58 63 6f 72 72 65 | 63 74 6c 79 20 6f 6e 20 |g.Xcorre|ctly on |
|00001a90| 6d 61 63 68 69 6e 65 73 | 20 74 68 61 74 20 63 6f |machines| that co|
|00001aa0| 6e 74 61 69 6e 20 6d 6f | 72 65 20 74 68 61 6e 20 |ntain mo|re than |
|00001ab0| 6f 6e 65 20 70 72 6f 63 | 65 73 73 6f 72 20 28 73 |one proc|essor (s|
|00001ac0| 69 6e 67 6c 65 0a 58 70 | 72 6f 63 65 73 73 6f 72 |ingle.Xp|rocessor|
|00001ad0| 20 73 75 6e 34 6d 20 6d | 61 63 68 69 6e 65 73 20 | sun4m m|achines |
|00001ae0| 73 65 65 6d 20 74 6f 20 | 72 75 6e 20 6a 75 73 74 |seem to |run just|
|00001af0| 20 66 69 6e 65 29 2e 20 | 20 41 20 66 69 78 20 69 | fine). | A fix i|
|00001b00| 73 20 70 65 6e 64 69 6e | 67 2e 0a 58 0a 58 53 4f |s pendin|g..X.XSO|
|00001b10| 4c 42 4f 55 52 4e 45 20 | 4f 50 45 52 41 54 49 4e |LBOURNE |OPERATIN|
|00001b20| 47 20 53 59 53 54 45 4d | 20 28 4f 53 2f 4d 50 29 |G SYSTEM| (OS/MP)|
|00001b30| 0a 58 0a 58 49 66 20 79 | 6f 75 20 61 72 65 20 72 |.X.XIf y|ou are r|
|00001b40| 75 6e 6e 69 6e 67 20 4f | 53 2f 4d 50 20 76 65 72 |unning O|S/MP ver|
|00001b50| 73 69 6f 6e 20 34 2e 31 | 41 2c 20 74 68 65 6e 20 |sion 4.1|A, then |
|00001b60| 75 73 65 20 74 68 65 20 | 6d 6f 64 75 6c 65 20 22 |use the |module "|
|00001b70| 6f 73 6d 70 34 2e 31 61 | 22 2e 0a 58 0a 58 49 66 |osmp4.1a|"..X.XIf|
|00001b80| 20 79 6f 75 20 61 72 65 | 20 72 75 6e 6e 69 6e 67 | you are| running|
|00001b90| 20 61 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 4f 53 | a versi|on of OS|
|00001ba0| 2f 4d 50 20 4f 4c 44 45 | 52 20 74 68 61 6e 20 34 |/MP OLDE|R than 4|
|00001bb0| 2e 31 41 20 28 74 68 61 | 74 20 69 73 2c 20 6f 6e |.1A (tha|t is, on|
|00001bc0| 65 0a 58 6f 66 20 69 74 | 73 20 70 72 65 64 65 63 |e.Xof it|s predec|
|00001bd0| 65 73 73 6f 72 73 29 2c | 20 75 73 65 20 74 68 65 |essors),| use the|
|00001be0| 20 6d 6f 64 75 6c 65 20 | 22 73 75 6e 6f 73 34 22 | module |"sunos4"|
|00001bf0| 2e 0a 58 0a 58 49 66 20 | 79 6f 75 20 61 72 65 20 |..X.XIf |you are |
|00001c00| 72 75 6e 6e 69 6e 67 20 | 4f 53 2f 4d 50 20 34 2e |running |OS/MP 4.|
|00001c10| 31 42 20 6f 72 20 4c 41 | 54 45 52 2c 20 75 73 65 |1B or LA|TER, use|
|00001c20| 20 74 68 65 20 6d 6f 64 | 75 6c 65 20 22 73 75 6e | the mod|ule "sun|
|00001c30| 6f 73 34 6d 70 22 2e 0a | 58 0a 58 48 50 2f 55 58 |os4mp"..|X.XHP/UX|
|00001c40| 20 4f 50 45 52 41 54 49 | 4e 47 20 53 59 53 54 45 | OPERATI|NG SYSTE|
|00001c50| 4d 0a 58 0a 58 54 68 65 | 20 6d 6f 64 75 6c 65 20 |M.X.XThe| module |
|00001c60| 68 70 75 78 38 20 77 6f | 72 6b 73 20 6f 6e 20 61 |hpux8 wo|rks on a|
|00001c70| 6c 6c 20 76 65 72 73 69 | 6f 6e 20 38 20 73 79 73 |ll versi|on 8 sys|
|00001c80| 74 65 6d 73 2e 20 20 53 | 6f 6d 65 20 73 61 79 20 |tems. S|ome say |
|00001c90| 74 68 61 74 20 69 74 20 | 77 6f 72 6b 73 0a 58 77 |that it |works.Xw|
|00001ca0| 69 74 68 20 76 65 72 73 | 69 6f 6e 20 39 20 61 73 |ith vers|ion 9 as|
|00001cb0| 20 77 65 6c 6c 2c 20 62 | 75 74 20 6f 6e 65 20 75 | well, b|ut one u|
|00001cc0| 73 65 72 20 64 69 64 20 | 73 65 6e 64 20 6d 65 20 |ser did |send me |
|00001cd0| 61 20 73 65 70 61 72 61 | 74 65 20 6d 6f 64 75 6c |a separa|te modul|
|00001ce0| 65 20 66 6f 72 0a 58 76 | 65 72 73 69 6f 6e 20 39 |e for.Xv|ersion 9|
|00001cf0| 2e 20 20 54 68 69 73 20 | 6d 6f 64 75 6c 65 20 68 |. This |module h|
|00001d00| 61 73 20 6f 6e 6c 79 20 | 62 65 65 6e 20 74 65 73 |as only |been tes|
|00001d10| 74 65 64 20 6f 6e 20 73 | 65 72 69 65 73 20 38 30 |ted on s|eries 80|
|00001d20| 30 20 6d 61 63 68 69 6e | 65 73 2e 20 20 49 0a 58 |0 machin|es. I.X|
|00001d30| 77 6f 75 6c 64 20 72 65 | 63 6f 6d 6d 65 6e 64 20 |would re|commend |
|00001d40| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 66 6f |the foll|owing fo|
|00001d50| 72 20 74 68 6f 73 65 20 | 72 75 6e 6e 69 6e 67 20 |r those |running |
|00001d60| 76 65 72 73 69 6f 6e 20 | 39 3a 20 74 72 79 20 68 |version |9: try h|
|00001d70| 70 75 78 39 20 61 6e 64 | 0a 58 69 66 20 69 74 20 |pux9 and|.Xif it |
|00001d80| 64 6f 65 73 6e 27 74 20 | 77 6f 72 6b 20 74 68 65 |doesn't |work the|
|00001d90| 6e 20 74 72 79 20 68 70 | 75 78 38 2e 20 20 49 66 |n try hp|ux8. If|
|00001da0| 20 6e 65 69 74 68 65 72 | 20 77 6f 72 6b 2c 20 74 | neither| work, t|
|00001db0| 68 65 6e 20 73 65 6e 64 | 20 6d 61 69 6c 20 74 6f |hen send| mail to|
|00001dc0| 20 6d 65 0a 58 61 6e 64 | 2f 6f 72 20 74 68 65 20 | me.Xand|/or the |
|00001dd0| 6d 6f 64 75 6c 65 73 27 | 20 61 75 74 68 6f 72 73 |modules'| authors|
|00001de0| 2e 0a 58 0a 45 4e 44 5f | 4f 46 5f 46 49 4c 45 0a |..X.END_|OF_FILE.|
|00001df0| 69 66 20 74 65 73 74 20 | 36 33 38 33 20 2d 6e 65 |if test |6383 -ne|
|00001e00| 20 60 77 63 20 2d 63 20 | 3c 27 49 4e 53 54 41 4c | `wc -c |<'INSTAL|
|00001e10| 4c 27 60 3b 20 74 68 65 | 6e 0a 20 20 20 20 65 63 |L'`; the|n. ec|
|00001e20| 68 6f 20 73 68 61 72 3a | 20 5c 22 27 49 4e 53 54 |ho shar:| \"'INST|
|00001e30| 41 4c 4c 27 5c 22 20 75 | 6e 70 61 63 6b 65 64 20 |ALL'\" u|npacked |
|00001e40| 77 69 74 68 20 77 72 6f | 6e 67 20 73 69 7a 65 21 |with wro|ng size!|
|00001e50| 0a 66 69 0a 23 20 65 6e | 64 20 6f 66 20 27 49 4e |.fi.# en|d of 'IN|
|00001e60| 53 54 41 4c 4c 27 0a 66 | 69 0a 69 66 20 74 65 73 |STALL'.f|i.if tes|
|00001e70| 74 20 2d 66 20 27 50 6f | 72 74 69 6e 67 27 20 2d |t -f 'Po|rting' -|
|00001e80| 61 20 22 24 7b 31 7d 22 | 20 21 3d 20 22 2d 63 22 |a "${1}"| != "-c"|
|00001e90| 20 3b 20 74 68 65 6e 20 | 0a 20 20 65 63 68 6f 20 | ; then |. echo |
|00001ea0| 73 68 61 72 3a 20 57 69 | 6c 6c 20 6e 6f 74 20 63 |shar: Wi|ll not c|
|00001eb0| 6c 6f 62 62 65 72 20 65 | 78 69 73 74 69 6e 67 20 |lobber e|xisting |
|00001ec0| 66 69 6c 65 20 5c 22 27 | 50 6f 72 74 69 6e 67 27 |file \"'|Porting'|
|00001ed0| 5c 22 0a 65 6c 73 65 0a | 65 63 68 6f 20 73 68 61 |\".else.|echo sha|
|00001ee0| 72 3a 20 45 78 74 72 61 | 63 74 69 6e 67 20 5c 22 |r: Extra|cting \"|
|00001ef0| 27 50 6f 72 74 69 6e 67 | 27 5c 22 20 5c 28 37 30 |'Porting|'\" \(70|
|00001f00| 35 35 20 63 68 61 72 61 | 63 74 65 72 73 5c 29 0a |55 chara|cters\).|
|00001f10| 73 65 64 20 22 73 2f 5e | 58 2f 2f 22 20 3e 27 50 |sed "s/^|X//" >'P|
|00001f20| 6f 72 74 69 6e 67 27 20 | 3c 3c 27 45 4e 44 5f 4f |orting' |<<'END_O|
|00001f30| 46 5f 46 49 4c 45 27 0a | 58 49 6e 73 74 72 75 63 |F_FILE'.|XInstruc|
|00001f40| 74 69 6f 6e 73 20 66 6f | 72 20 70 6f 72 74 69 6e |tions fo|r portin|
|00001f50| 67 20 74 6f 70 20 74 6f | 20 6f 74 68 65 72 20 61 |g top to| other a|
|00001f60| 72 63 68 69 74 65 63 74 | 75 72 65 73 2e 0a 58 0a |rchitect|ures..X.|
|00001f70| 58 54 68 69 73 20 69 73 | 20 73 74 69 6c 6c 20 61 |XThis is| still a|
|00001f80| 20 70 72 65 6c 69 6d 69 | 6e 61 72 79 20 64 6f 63 | prelimi|nary doc|
|00001f90| 75 6d 65 6e 74 2e 20 20 | 53 75 67 67 65 73 74 69 |ument. |Suggesti|
|00001fa0| 6f 6e 73 20 66 6f 72 20 | 69 6d 70 72 6f 76 65 6d |ons for |improvem|
|00001fb0| 65 6e 74 20 61 72 65 0a | 58 6d 6f 73 74 20 77 65 |ent are.|Xmost we|
|00001fc0| 6c 63 6f 6d 65 2e 0a 58 | 0a 58 4d 79 20 61 64 64 |lcome..X|.XMy add|
|00001fd0| 72 65 73 73 20 69 73 20 | 22 70 68 69 6c 40 65 65 |ress is |"phil@ee|
|00001fe0| 63 73 2e 6e 77 75 2e 65 | 64 75 22 2e 0a 58 0a 58 |cs.nwu.e|du"..X.X|
|00001ff0| 42 65 66 6f 72 65 20 79 | 6f 75 20 65 6d 62 61 72 |Before y|ou embar|
|00002000| 6b 20 6f 6e 20 61 20 70 | 6f 72 74 2c 20 70 6c 65 |k on a p|ort, ple|
|00002010| 61 73 65 20 73 65 6e 64 | 20 6d 65 20 61 20 6d 61 |ase send| me a ma|
|00002020| 69 6c 20 6d 65 73 73 61 | 67 65 20 74 65 6c 6c 69 |il messa|ge telli|
|00002030| 6e 67 20 6d 65 0a 58 77 | 68 61 74 20 70 6c 61 74 |ng me.Xw|hat plat|
|00002040| 66 6f 72 6d 20 79 6f 75 | 20 61 72 65 20 70 6f 72 |form you| are por|
|00002050| 74 69 6e 67 20 74 6f 70 | 20 74 6f 2e 20 20 54 68 |ting top| to. Th|
|00002060| 65 72 65 20 61 72 65 20 | 74 68 72 65 65 20 72 65 |ere are |three re|
|00002070| 61 73 6f 6e 73 20 66 6f | 72 0a 58 74 68 69 73 3a |asons fo|r.Xthis:|
|00002080| 20 28 31 29 20 49 20 6d | 61 79 20 61 6c 72 65 61 | (1) I m|ay alrea|
|00002090| 64 79 20 68 61 76 65 20 | 61 20 70 6f 72 74 2c 20 |dy have |a port, |
|000020a0| 28 32 29 20 6d 6f 64 75 | 6c 65 20 6e 61 6d 69 6e |(2) modu|le namin|
|000020b0| 67 20 6e 65 65 64 73 20 | 74 6f 20 62 65 0a 58 63 |g needs |to be.Xc|
|000020c0| 65 6e 74 72 61 6c 69 7a | 65 64 2c 20 28 33 29 20 |entraliz|ed, (3) |
|000020d0| 49 20 77 61 6e 74 20 74 | 6f 20 6c 6f 6f 73 65 6c |I want t|o loosel|
|000020e0| 79 20 74 72 61 63 6b 20 | 74 68 65 20 76 61 72 69 |y track |the vari|
|000020f0| 6f 75 73 20 70 6f 72 74 | 69 6e 67 20 65 66 66 6f |ous port|ing effo|
|00002100| 72 74 73 2e 0a 58 59 6f | 75 20 64 6f 20 6e 6f 74 |rts..XYo|u do not|
|00002110| 20 6e 65 65 64 20 74 6f | 20 77 61 69 74 20 66 6f | need to| wait fo|
|00002120| 72 20 61 6e 20 22 6f 6b | 61 79 22 2c 20 62 75 74 |r an "ok|ay", but|
|00002130| 20 49 20 64 6f 20 77 61 | 6e 74 20 74 6f 20 6b 6e | I do wa|nt to kn|
|00002140| 6f 77 20 74 68 61 74 20 | 79 6f 75 0a 58 61 72 65 |ow that |you.Xare|
|00002150| 20 77 6f 72 6b 69 6e 67 | 20 6f 6e 20 69 74 2e 20 | working| on it. |
|00002160| 20 41 6e 64 20 6f 66 20 | 63 6f 75 72 73 65 2c 20 | And of |course, |
|00002170| 6f 6e 63 65 20 69 74 20 | 69 73 20 66 69 6e 69 73 |once it |is finis|
|00002180| 68 65 64 2c 20 70 6c 65 | 61 73 65 20 73 65 6e 64 |hed, ple|ase send|
|00002190| 20 6d 65 0a 58 74 68 65 | 20 6d 6f 64 75 6c 65 20 | me.Xthe| module |
|000021a0| 66 69 6c 65 73 20 73 6f | 20 74 68 61 74 20 49 20 |files so| that I |
|000021b0| 63 61 6e 20 61 64 64 20 | 74 68 65 6d 20 74 6f 20 |can add |them to |
|000021c0| 74 68 65 20 6d 61 69 6e | 20 64 69 73 74 72 69 62 |the main| distrib|
|000021d0| 75 74 69 6f 6e 21 0a 58 | 0a 58 2d 2d 2d 2d 2d 2d |ution!.X|.X------|
|000021e0| 2d 2d 2d 2d 0a 58 0a 58 | 54 68 65 72 65 20 69 73 |----.X.X|There is|
|000021f0| 20 6f 6e 65 20 73 65 74 | 20 6f 66 20 66 75 6e 63 | one set| of func|
|00002200| 74 69 6f 6e 73 20 77 68 | 69 63 68 20 65 78 74 72 |tions wh|ich extr|
|00002210| 61 63 74 20 61 6c 6c 20 | 74 68 65 20 69 6e 66 6f |act all |the info|
|00002220| 72 6d 61 74 69 6f 6e 20 | 74 68 61 74 0a 58 74 6f |rmation |that.Xto|
|00002230| 70 20 6e 65 65 64 73 20 | 66 6f 72 20 64 69 73 70 |p needs |for disp|
|00002240| 6c 61 79 2e 20 20 54 68 | 65 73 65 20 66 75 6e 63 |lay. Th|ese func|
|00002250| 74 69 6f 6e 73 20 61 72 | 65 20 63 6f 6c 6c 65 63 |tions ar|e collec|
|00002260| 74 65 64 20 69 6e 20 74 | 6f 20 6f 6e 65 20 66 69 |ted in t|o one fi|
|00002270| 6c 65 2e 0a 58 54 6f 20 | 6d 61 6b 65 20 74 6f 70 |le..XTo |make top|
|00002280| 20 77 6f 72 6b 20 6f 6e | 20 61 20 64 69 66 66 65 | work on| a diffe|
|00002290| 72 65 6e 74 20 61 72 63 | 68 69 74 65 63 74 75 72 |rent arc|hitectur|
|000022a0| 65 20 73 69 6d 70 6c 79 | 20 72 65 71 75 69 72 65 |e simply| require|
|000022b0| 73 20 61 0a 58 64 69 66 | 66 65 72 65 6e 74 20 69 |s a.Xdif|ferent i|
|000022c0| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 20 6f 66 |mplement|ation of|
|000022d0| 20 74 68 65 73 65 20 66 | 75 6e 63 74 69 6f 6e 73 | these f|unctions|
|000022e0| 2e 20 20 54 68 65 20 66 | 75 6e 63 74 69 6f 6e 73 |. The f|unctions|
|000022f0| 20 66 6f 72 20 61 0a 58 | 67 69 76 65 6e 20 61 72 | for a.X|given ar|
|00002300| 63 68 69 74 65 63 74 75 | 72 65 20 22 66 6f 6f 22 |chitectu|re "foo"|
|00002310| 20 61 72 65 20 73 74 6f | 72 65 64 20 69 6e 20 61 | are sto|red in a|
|00002320| 20 66 69 6c 65 20 63 61 | 6c 6c 65 64 20 22 6d 5f | file ca|lled "m_|
|00002330| 66 6f 6f 2e 63 22 2e 20 | 20 54 68 65 0a 58 43 6f |foo.c". | The.XCo|
|00002340| 6e 66 69 67 75 72 65 20 | 73 63 72 69 70 74 20 6c |nfigure |script l|
|00002350| 6f 6f 6b 73 20 66 6f 72 | 20 74 68 65 73 65 20 66 |ooks for| these f|
|00002360| 69 6c 65 73 20 61 6e 64 | 20 6c 65 74 73 20 74 68 |iles and| lets th|
|00002370| 65 20 63 6f 6e 66 69 67 | 75 72 65 72 20 63 68 6f |e config|urer cho|
|00002380| 6f 73 65 0a 58 6f 6e 65 | 20 6f 66 20 74 68 65 6d |ose.Xone| of them|
|00002390| 2e 20 20 54 68 69 73 20 | 66 69 6c 65 20 69 73 20 |. This |file is |
|000023a0| 63 61 6c 6c 65 64 20 61 | 20 22 6d 6f 64 75 6c 65 |called a| "module|
|000023b0| 22 2e 20 20 54 68 65 20 | 69 64 65 61 20 69 73 20 |". The |idea is |
|000023c0| 74 68 61 74 20 6d 61 6b | 69 6e 67 0a 58 74 6f 70 |that mak|ing.Xtop|
|000023d0| 20 77 6f 72 6b 20 6f 6e | 20 61 20 64 69 66 66 65 | work on| a diffe|
|000023e0| 72 65 6e 74 20 6d 61 63 | 68 69 6e 65 20 6f 6e 6c |rent mac|hine onl|
|000023f0| 79 20 72 65 71 75 69 72 | 65 73 20 6f 6e 65 20 61 |y requir|es one a|
|00002400| 64 64 69 74 69 6f 6e 61 | 6c 20 66 69 6c 65 20 61 |dditiona|l file a|
|00002410| 6e 64 0a 58 64 6f 65 73 | 20 6e 6f 74 20 72 65 71 |nd.Xdoes| not req|
|00002420| 75 69 72 65 20 63 68 61 | 6e 67 65 73 20 74 6f 20 |uire cha|nges to |
|00002430| 61 6e 79 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |any exis|ting fil|
|00002440| 65 73 2e 0a 58 0a 58 41 | 20 6d 6f 64 75 6c 65 20 |es..X.XA| module |
|00002450| 74 65 6d 70 6c 61 74 65 | 20 69 73 20 69 6e 63 6c |template| is incl|
|00002460| 75 64 65 64 20 69 6e 20 | 74 68 65 20 64 69 73 74 |uded in |the dist|
|00002470| 72 69 62 75 74 69 6f 6e | 2c 20 63 61 6c 6c 65 64 |ribution|, called|
|00002480| 20 22 6d 2d 74 65 6d 70 | 6c 61 74 65 22 2e 0a 58 | "m-temp|late"..X|
|00002490| 54 6f 20 77 72 69 74 65 | 20 79 6f 75 72 20 6f 77 |To write| your ow|
|000024a0| 6e 20 6d 6f 64 75 6c 65 | 2c 20 69 74 20 69 73 20 |n module|, it is |
|000024b0| 61 20 67 6f 6f 64 20 69 | 64 65 61 20 74 6f 20 73 |a good i|dea to s|
|000024c0| 74 61 72 74 20 77 69 74 | 68 20 74 68 69 73 20 74 |tart wit|h this t|
|000024d0| 65 6d 70 6c 61 74 65 2e | 0a 58 49 66 20 79 6f 75 |emplate.|.XIf you|
|000024e0| 20 61 72 63 68 69 74 65 | 63 74 75 72 65 20 69 73 | archite|cture is|
|000024f0| 20 73 69 6d 69 6c 61 72 | 20 74 6f 20 6f 6e 65 20 | similar| to one |
|00002500| 66 6f 72 20 77 68 69 63 | 68 20 61 20 6d 6f 64 75 |for whic|h a modu|
|00002510| 6c 65 20 61 6c 72 65 61 | 64 79 0a 58 65 78 69 73 |le alrea|dy.Xexis|
|00002520| 74 73 2c 20 74 68 65 6e | 20 79 6f 75 20 63 61 6e |ts, then| you can|
|00002530| 20 73 74 61 72 74 20 77 | 69 74 68 20 74 68 61 74 | start w|ith that|
|00002540| 20 6d 6f 64 75 6c 65 20 | 69 6e 73 74 65 61 64 2e | module |instead.|
|00002550| 20 20 49 66 20 79 6f 75 | 20 64 6f 20 73 6f 2c 0a | If you| do so,.|
|00002560| 58 72 65 6d 65 6d 62 65 | 72 20 74 6f 20 63 68 61 |Xremembe|r to cha|
|00002570| 6e 67 65 20 74 68 65 20 | 22 41 55 54 48 4f 52 22 |nge the |"AUTHOR"|
|00002580| 20 73 65 63 74 69 6f 6e | 20 61 74 20 74 68 65 20 | section| at the |
|00002590| 74 6f 70 21 0a 58 0a 58 | 54 68 65 20 66 69 72 73 |top!.X.X|The firs|
|000025a0| 74 20 63 6f 6d 6d 65 6e | 74 20 69 6e 20 61 20 6d |t commen|t in a m|
|000025b0| 6f 64 75 6c 65 20 63 6f | 6e 74 61 69 6e 73 20 69 |odule co|ntains i|
|000025c0| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 77 68 69 63 68 |nformati|on which|
|000025d0| 20 69 73 20 65 78 74 72 | 61 63 74 65 64 0a 58 61 | is extr|acted.Xa|
|000025e0| 6e 64 20 75 73 65 64 20 | 62 79 20 43 6f 6e 66 69 |nd used |by Confi|
|000025f0| 67 75 72 65 2e 20 20 54 | 68 69 73 20 69 6e 66 6f |gure. T|his info|
|00002600| 72 6d 61 74 69 6f 6e 20 | 69 73 20 6d 61 72 6b 65 |rmation |is marke|
|00002610| 64 20 77 69 74 68 20 77 | 6f 72 64 73 20 69 6e 20 |d with w|ords in |
|00002620| 61 6c 6c 0a 58 63 61 70 | 69 74 61 6c 73 20 28 73 |all.Xcap|itals (s|
|00002630| 75 63 68 20 61 73 20 22 | 53 59 4e 4f 50 53 49 53 |uch as "|SYNOPSIS|
|00002640| 3a 22 20 61 6e 64 20 22 | 4c 49 42 53 3a 22 29 2e |:" and "|LIBS:").|
|00002650| 20 20 47 6f 20 6c 6f 6f | 6b 20 61 74 20 6d 2d 74 | Go loo|k at m-t|
|00002660| 65 6d 70 6c 61 74 65 3a | 20 69 74 0a 58 69 73 20 |emplate:| it.Xis |
|00002670| 66 61 69 72 6c 79 20 73 | 65 6c 66 2d 65 78 70 6c |fairly s|elf-expl|
|00002680| 61 6e 61 74 6f 72 79 2e | 20 20 54 68 65 20 74 65 |anatory.| The te|
|00002690| 78 74 20 61 66 74 65 72 | 20 22 4c 49 42 53 3a 22 |xt after| "LIBS:"|
|000026a0| 20 28 6f 6e 20 74 68 65 | 20 73 61 6d 65 20 6c 69 | (on the| same li|
|000026b0| 6e 65 29 0a 58 69 73 20 | 65 78 74 72 61 63 74 65 |ne).Xis |extracte|
|000026c0| 64 20 61 6e 64 20 69 6e | 63 6c 75 64 65 64 20 69 |d and in|cluded i|
|000026d0| 6e 20 74 68 65 20 4c 49 | 42 53 20 64 65 66 69 6e |n the LI|BS defin|
|000026e0| 69 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 4d 61 6b |ition of| the Mak|
|000026f0| 65 66 69 6c 65 20 73 6f | 0a 58 74 68 61 74 20 65 |efile so|.Xthat e|
|00002700| 78 74 72 61 20 6c 69 62 | 72 61 72 69 65 73 20 77 |xtra lib|raries w|
|00002710| 68 69 63 68 20 6d 61 79 | 20 62 65 20 6e 65 63 65 |hich may| be nece|
|00002720| 73 73 61 72 79 20 6f 6e | 20 73 6f 6d 65 20 6d 61 |ssary on| some ma|
|00002730| 63 68 69 6e 65 73 20 28 | 73 75 63 68 20 61 73 0a |chines (|such as.|
|00002740| 58 22 2d 6c 6b 76 6d 22 | 29 20 63 61 6e 20 62 65 |X"-lkvm"|) can be|
|00002750| 20 73 70 65 63 69 66 69 | 65 64 20 69 6e 20 74 68 | specifi|ed in th|
|00002760| 65 20 6d 6f 64 75 6c 65 | 2e 20 20 54 68 65 20 74 |e module|. The t|
|00002770| 65 78 74 20 61 66 74 65 | 72 20 22 43 46 4c 41 47 |ext afte|r "CFLAG|
|00002780| 53 3a 22 0a 58 28 6f 6e | 20 74 68 65 20 73 61 6d |S:".X(on| the sam|
|00002790| 65 20 6c 69 6e 65 29 20 | 69 73 20 65 78 74 72 61 |e line) |is extra|
|000027a0| 63 74 65 64 20 61 6e 64 | 20 69 6e 63 6c 75 64 65 |cted and| include|
|000027b0| 64 20 61 73 20 66 6c 61 | 67 73 20 69 6e 20 74 68 |d as fla|gs in th|
|000027c0| 65 20 22 43 46 4c 41 47 | 53 22 0a 58 64 65 66 69 |e "CFLAG|S".Xdefi|
|000027d0| 6e 69 74 69 6f 6e 20 6f | 66 20 74 68 65 20 4d 61 |nition o|f the Ma|
|000027e0| 6b 65 66 69 6c 65 20 28 | 74 68 75 73 20 69 6e 20 |kefile (|thus in |
|000027f0| 65 76 65 72 79 20 63 6f | 6d 70 69 6c 61 74 69 6f |every co|mpilatio|
|00002800| 6e 20 73 74 65 70 29 2e | 20 20 54 68 69 73 20 69 |n step).| This i|
|00002810| 73 0a 58 75 73 65 64 20 | 66 6f 72 20 72 61 72 65 |s.Xused |for rare|
|00002820| 20 63 69 72 63 75 6d 73 | 74 61 6e 63 65 73 20 6f | circums|tances o|
|00002830| 6e 6c 79 3a 20 20 70 6c | 65 61 73 65 20 64 6f 6e |nly: pl|ease don|
|00002840| 27 74 20 61 62 75 73 65 | 20 74 68 69 73 20 68 6f |'t abuse| this ho|
|00002850| 6f 6b 2e 0a 58 0a 58 53 | 6f 6d 65 20 6f 70 65 72 |ok..X.XS|ome oper|
|00002860| 61 74 69 6e 67 20 73 79 | 73 74 65 6d 73 20 68 61 |ating sy|stems ha|
|00002870| 76 65 20 69 64 69 6f 73 | 79 6e 63 72 61 73 69 65 |ve idios|yncrasie|
|00002880| 73 20 77 68 69 63 68 20 | 77 69 6c 6c 20 61 66 66 |s which |will aff|
|00002890| 65 63 74 20 74 68 65 20 | 66 6f 72 6d 0a 58 61 6e |ect the |form.Xan|
|000028a0| 64 2f 6f 72 20 63 6f 6e | 74 65 6e 74 20 6f 66 20 |d/or con|tent of |
|000028b0| 74 68 65 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |the info|rmation |
|000028c0| 74 6f 70 20 64 69 73 70 | 6c 61 79 73 2e 20 20 59 |top disp|lays. Y|
|000028d0| 6f 75 20 6d 61 79 20 77 | 69 73 68 20 74 6f 0a 58 |ou may w|ish to.X|
|000028e0| 64 6f 63 75 6d 65 6e 74 | 20 73 75 63 68 20 61 6e |document| such an|
|000028f0| 6f 6d 61 6c 69 65 73 20 | 69 6e 20 74 68 65 20 74 |omalies |in the t|
|00002900| 6f 70 20 6d 61 6e 20 70 | 61 67 65 2e 20 20 54 68 |op man p|age. Th|
|00002910| 69 73 20 63 61 6e 20 62 | 65 20 64 6f 6e 65 20 62 |is can b|e done b|
|00002920| 79 20 61 64 64 69 6e 67 | 0a 58 61 20 66 69 6c 65 |y adding|.Xa file|
|00002930| 20 63 61 6c 6c 65 64 20 | 6d 5f 7b 6d 6f 64 75 6c | called |m_{modul|
|00002940| 65 6e 61 6d 65 7d 2e 6d | 61 6e 20 28 77 68 65 72 |ename}.m|an (wher|
|00002950| 65 20 7b 6d 6f 64 75 6c | 65 6e 61 6d 65 7d 20 69 |e {modul|ename} i|
|00002960| 73 20 72 65 70 6c 61 63 | 65 64 20 77 69 74 68 0a |s replac|ed with.|
|00002970| 58 74 68 65 20 6e 61 6d | 65 20 6f 66 20 74 68 65 |Xthe nam|e of the|
|00002980| 20 6d 6f 64 75 6c 65 29 | 2e 20 20 43 6f 6e 66 69 | module)|. Confi|
|00002990| 67 75 72 65 20 77 69 6c | 6c 20 61 75 74 6f 6d 61 |gure wil|l automa|
|000029a0| 74 69 63 61 6c 6c 79 20 | 61 64 64 20 74 68 69 73 |tically |add this|
|000029b0| 20 66 69 6c 65 20 74 6f | 0a 58 74 68 65 20 65 6e | file to|.Xthe en|
|000029c0| 64 20 6f 66 20 74 68 65 | 20 6d 61 6e 20 70 61 67 |d of the| man pag|
|000029d0| 65 2e 20 20 53 65 65 20 | 6d 5f 73 75 6e 6f 73 34 |e. See |m_sunos4|
|000029e0| 2e 6d 61 6e 20 66 6f 72 | 20 61 6e 20 65 78 61 6d |.man for| an exam|
|000029f0| 70 6c 65 2e 0a 58 0a 58 | 41 20 6d 6f 64 75 6c 65 |ple..X.X|A module|
|00002a00| 20 69 73 20 63 6f 6e 63 | 65 72 6e 65 64 20 77 69 | is conc|erned wi|
|00002a10| 74 68 20 74 77 6f 20 73 | 74 72 75 63 74 75 72 65 |th two s|tructure|
|00002a20| 73 3a 0a 58 0a 58 54 68 | 65 20 73 74 61 74 69 63 |s:.X.XTh|e static|
|00002a30| 73 20 73 74 72 75 63 74 | 20 69 73 20 66 69 6c 6c |s struct| is fill|
|00002a40| 65 64 20 69 6e 20 62 79 | 20 6d 61 63 68 69 6e 65 |ed in by| machine|
|00002a50| 5f 69 6e 69 74 2e 20 20 | 45 61 63 68 20 69 74 65 |_init. |Each ite|
|00002a60| 6d 20 69 73 20 61 0a 58 | 70 6f 69 6e 74 65 72 20 |m is a.X|pointer |
|00002a70| 74 6f 20 61 20 6c 69 73 | 74 20 6f 66 20 63 68 61 |to a lis|t of cha|
|00002a80| 72 61 63 74 65 72 20 70 | 6f 69 6e 74 65 72 73 2e |racter p|ointers.|
|00002a90| 20 20 54 68 65 20 6c 69 | 73 74 20 69 73 20 74 65 | The li|st is te|
|00002aa0| 72 6d 69 6e 61 74 65 64 | 20 0a 58 77 69 74 68 20 |rminated| .Xwith |
|00002ab0| 61 20 6e 75 6c 6c 20 70 | 6f 69 6e 74 65 72 2e 0a |a null p|ointer..|
|00002ac0| 58 0a 58 73 74 72 75 63 | 74 20 73 74 61 74 69 63 |X.Xstruc|t static|
|00002ad0| 73 0a 58 7b 0a 58 20 20 | 20 20 63 68 61 72 20 2a |s.X{.X | char *|
|00002ae0| 2a 70 72 6f 63 73 74 61 | 74 65 5f 6e 61 6d 65 73 |*procsta|te_names|
|00002af0| 3b 09 2f 2a 20 70 72 6f | 63 65 73 73 20 73 74 61 |;./* pro|cess sta|
|00002b00| 74 65 20 6e 61 6d 65 73 | 20 2a 2f 0a 58 20 20 20 |te names| */.X |
|00002b10| 20 63 68 61 72 20 2a 2a | 63 70 75 73 74 61 74 65 | char **|cpustate|
|00002b20| 5f 6e 61 6d 65 73 3b 09 | 2f 2a 20 63 70 75 20 73 |_names;.|/* cpu s|
|00002b30| 74 61 74 65 20 6e 61 6d | 65 73 20 2a 2f 0a 58 20 |tate nam|es */.X |
|00002b40| 20 20 20 63 68 61 72 20 | 2a 2a 6d 65 6d 6f 72 79 | char |**memory|
|00002b50| 5f 6e 61 6d 65 73 3b 09 | 2f 2a 20 6d 65 6d 6f 72 |_names;.|/* memor|
|00002b60| 79 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 6e 61 |y inform|ation na|
|00002b70| 6d 65 73 20 2a 2f 0a 58 | 7d 3b 0a 58 0a 58 54 68 |mes */.X|};.X.XTh|
|00002b80| 65 20 73 79 73 74 65 6d | 5f 69 6e 66 6f 20 73 74 |e system|_info st|
|00002b90| 72 75 63 74 20 69 73 20 | 66 69 6c 6c 65 64 20 69 |ruct is |filled i|
|00002ba0| 6e 20 62 79 20 67 65 74 | 5f 73 79 73 74 65 6d 5f |n by get|_system_|
|00002bb0| 69 6e 66 6f 20 61 6e 64 | 0a 58 67 65 74 5f 70 72 |info and|.Xget_pr|
|00002bc0| 6f 63 65 73 73 5f 69 6e | 66 6f 2e 0a 58 0a 58 73 |ocess_in|fo..X.Xs|
|00002bd0| 74 72 75 63 74 20 73 79 | 73 74 65 6d 5f 69 6e 66 |truct sy|stem_inf|
|00002be0| 6f 0a 58 7b 0a 58 20 20 | 20 20 69 6e 74 20 20 20 |o.X{.X | int |
|00002bf0| 20 6c 61 73 74 5f 70 69 | 64 3b 20 20 20 20 20 2f | last_pi|d; /|
|00002c00| 2a 20 6c 61 73 74 20 70 | 69 64 20 61 73 73 69 67 |* last p|id assig|
|00002c10| 6e 65 64 20 28 30 20 6d | 65 61 6e 73 20 6e 6f 6e |ned (0 m|eans non|
|00002c20| 2d 73 65 71 75 65 6e 74 | 69 61 6c 20 61 73 73 69 |-sequent|ial assi|
|00002c30| 67 6e 6d 65 6e 74 29 20 | 2a 2f 0a 58 20 20 20 20 |gnment) |*/.X |
|00002c40| 64 6f 75 62 6c 65 20 6c | 6f 61 64 5f 61 76 67 5b |double l|oad_avg[|
|00002c50| 4e 55 4d 5f 41 56 45 52 | 41 47 45 53 5d 3b 20 20 |NUM_AVER|AGES]; |
|00002c60| 20 20 20 2f 2a 20 73 65 | 65 20 62 65 6c 6f 77 20 | /* se|e below |
|00002c70| 2a 2f 0a 58 20 20 20 20 | 69 6e 74 20 20 20 20 70 |*/.X |int p|
|00002c80| 5f 74 6f 74 61 6c 3b 20 | 20 20 20 20 20 2f 2a 20 |_total; | /* |
|00002c90| 74 6f 74 61 6c 20 6e 75 | 6d 62 65 72 20 6f 66 20 |total nu|mber of |
|00002ca0| 70 72 6f 63 65 73 73 65 | 73 20 2a 2f 0a 58 20 20 |processe|s */.X |
|00002cb0| 20 20 69 6e 74 20 20 20 | 20 70 5f 61 63 74 69 76 | int | p_activ|
|00002cc0| 65 3b 20 20 20 20 20 2f | 2a 20 6e 75 6d 62 65 72 |e; /|* number|
|00002cd0| 20 6f 66 20 70 72 6f 63 | 73 20 63 6f 6e 73 69 64 | of proc|s consid|
|00002ce0| 65 72 65 64 20 22 61 63 | 74 69 76 65 22 20 2a 2f |ered "ac|tive" */|
|00002cf0| 0a 58 20 20 20 20 69 6e | 74 20 20 20 20 2a 70 72 |.X in|t *pr|
|00002d00| 6f 63 73 74 61 74 65 73 | 3b 20 20 2f 2a 20 61 72 |ocstates|; /* ar|
|00002d10| 72 61 79 20 6f 66 20 70 | 72 6f 63 65 73 73 20 73 |ray of p|rocess s|
|00002d20| 74 61 74 65 20 63 6f 75 | 6e 74 65 72 73 20 2a 2f |tate cou|nters */|
|00002d30| 0a 58 20 20 20 20 69 6e | 74 20 20 20 20 2a 63 70 |.X in|t *cp|
|00002d40| 75 73 74 61 74 65 73 3b | 20 20 20 2f 2a 20 61 72 |ustates;| /* ar|
|00002d50| 72 61 79 20 6f 66 20 63 | 70 75 73 74 61 74 65 20 |ray of c|pustate |
|00002d60| 63 6f 75 6e 74 65 72 73 | 20 2a 2f 0a 58 20 20 20 |counters| */.X |
|00002d70| 20 69 6e 74 20 20 20 20 | 2a 6d 65 6d 6f 72 79 3b | int |*memory;|
|00002d80| 20 20 20 20 20 20 2f 2a | 20 6d 65 6d 6f 72 79 20 | /*| memory |
|00002d90| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 2a 2f 0a 58 |informat|ion */.X|
|00002da0| 7d 3b 0a 58 0a 58 54 68 | 65 20 6c 61 73 74 20 74 |};.X.XTh|e last t|
|00002db0| 68 72 65 65 20 70 6f 69 | 6e 74 65 72 73 20 65 61 |hree poi|nters ea|
|00002dc0| 63 68 20 70 6f 69 6e 74 | 20 74 6f 20 61 6e 20 61 |ch point| to an a|
|00002dd0| 72 72 61 79 20 6f 66 20 | 69 6e 74 65 67 65 72 73 |rray of |integers|
|00002de0| 2e 20 20 54 68 65 0a 58 | 6c 65 6e 67 74 68 20 6f |. The.X|length o|
|00002df0| 66 20 74 68 65 20 61 72 | 72 61 79 20 69 73 20 64 |f the ar|ray is d|
|00002e00| 65 74 65 72 6d 69 6e 65 | 64 20 62 79 20 74 68 65 |etermine|d by the|
|00002e10| 20 6c 65 6e 67 74 68 20 | 6f 66 20 74 68 65 20 63 | length |of the c|
|00002e20| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 0a 58 5f 6e |orrespon|ding.X_n|
|00002e30| 61 6d 65 73 20 61 72 72 | 61 79 20 69 6e 20 74 68 |ames arr|ay in th|
|00002e40| 65 20 73 74 61 74 69 63 | 73 20 73 74 72 75 63 74 |e static|s struct|
|00002e50| 75 72 65 2e 20 20 46 75 | 72 74 68 65 72 6d 6f 72 |ure. Fu|rthermor|
|00002e60| 65 2c 20 69 66 20 61 6e | 20 65 6e 74 72 79 20 69 |e, if an| entry i|
|00002e70| 6e 20 61 0a 58 5f 6e 61 | 6d 65 73 20 61 72 72 61 |n a.X_na|mes arra|
|00002e80| 79 20 69 73 20 74 68 65 | 20 65 6d 70 74 79 20 73 |y is the| empty s|
|00002e90| 74 72 69 6e 67 20 28 22 | 22 29 20 74 68 65 6e 20 |tring ("|") then |
|00002ea0| 74 68 65 20 63 6f 72 72 | 65 73 70 6f 6e 64 69 6e |the corr|espondin|
|00002eb0| 67 20 76 61 6c 75 65 20 | 69 6e 0a 58 74 68 65 20 |g value |in.Xthe |
|00002ec0| 76 61 6c 75 65 20 61 72 | 72 61 79 20 77 69 6c 6c |value ar|ray will|
|00002ed0| 20 62 65 20 73 6b 69 70 | 70 65 64 20 6f 76 65 72 | be skip|ped over|
|00002ee0| 2e 20 20 54 68 65 20 64 | 69 73 70 6c 61 79 20 72 |. The d|isplay r|
|00002ef0| 6f 75 74 69 6e 65 20 64 | 69 73 70 6c 61 79 73 2c |outine d|isplays,|
|00002f00| 0a 58 66 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 74 |.Xfor ex|ample, t|
|00002f10| 68 65 20 73 74 72 69 6e | 67 20 70 72 6f 63 73 74 |he strin|g procst|
|00002f20| 61 74 65 5f 6e 61 6d 65 | 73 5b 30 5d 20 74 68 65 |ate_name|s[0] the|
|00002f30| 6e 20 74 68 65 20 6e 75 | 6d 62 65 72 0a 58 70 72 |n the nu|mber.Xpr|
|00002f40| 6f 63 73 74 61 74 65 73 | 5b 30 5d 2c 20 74 68 65 |ocstates|[0], the|
|00002f50| 6e 20 70 72 6f 63 73 74 | 61 74 65 5f 6e 61 6d 65 |n procst|ate_name|
|00002f60| 73 5b 31 5d 2c 20 70 72 | 6f 63 73 74 61 74 65 73 |s[1], pr|ocstates|
|00002f70| 5b 31 5d 2c 20 65 74 63 | 2e 20 75 6e 74 69 6c 0a |[1], etc|. until.|
|00002f80| 58 70 72 6f 63 73 74 61 | 74 65 5f 6e 61 6d 65 73 |Xprocsta|te_names|
|00002f90| 5b 4e 5d 20 3d 3d 20 4e | 55 4c 4c 2e 20 20 54 68 |[N] == N|ULL. Th|
|00002fa0| 69 73 20 61 6c 6c 6f 77 | 73 20 66 6f 72 20 61 20 |is allow|s for a |
|00002fb0| 74 72 65 6d 65 6e 64 6f | 75 73 20 61 6d 6f 75 6e |tremendo|us amoun|
|00002fc0| 74 20 6f 66 0a 58 66 6c | 65 78 69 62 69 6c 69 74 |t of.Xfl|exibilit|
|00002fd0| 79 20 69 6e 20 6c 61 62 | 65 6c 69 6e 67 20 74 68 |y in lab|eling th|
|00002fe0| 65 20 64 69 73 70 6c 61 | 79 65 64 20 76 61 6c 75 |e displa|yed valu|
|00002ff0| 65 73 2e 0a 58 0a 58 22 | 70 72 6f 63 73 74 61 74 |es..X.X"|procstat|
|00003000| 65 73 22 20 61 6e 64 20 | 22 6d 65 6d 6f 72 79 22 |es" and |"memory"|
|00003010| 20 61 72 65 20 64 69 73 | 70 6c 61 79 65 64 20 61 | are dis|played a|
|00003020| 73 20 73 74 72 61 69 67 | 68 74 20 69 6e 74 65 67 |s straig|ht integ|
|00003030| 65 72 20 76 61 6c 75 65 | 73 2e 0a 58 56 61 6c 75 |er value|s..XValu|
|00003040| 65 73 20 69 6e 20 22 63 | 70 75 73 74 61 74 65 73 |es in "c|pustates|
|00003050| 22 20 61 72 65 20 64 69 | 73 70 6c 61 79 65 64 20 |" are di|splayed |
|00003060| 61 73 20 61 20 70 65 72 | 63 65 6e 74 61 67 65 20 |as a per|centage |
|00003070| 2a 20 31 30 2e 20 20 46 | 6f 72 0a 58 65 78 61 6d |* 10. F|or.Xexam|
|00003080| 70 6c 65 2c 20 74 68 65 | 20 28 69 6e 74 65 67 65 |ple, the| (intege|
|00003090| 72 29 20 76 61 6c 75 65 | 20 31 30 35 20 69 73 20 |r) value| 105 is |
|000030a0| 64 69 73 70 6c 61 79 65 | 64 20 61 73 20 31 30 2e |displaye|d as 10.|
|000030b0| 35 25 2e 0a 58 0a 58 54 | 68 65 73 65 20 72 6f 75 |5%..X.XT|hese rou|
|000030c0| 74 69 6e 65 73 20 6d 75 | 73 74 20 62 65 20 64 65 |tines mu|st be de|
|000030d0| 66 69 6e 65 64 20 62 79 | 20 74 68 65 20 6d 61 63 |fined by| the mac|
|000030e0| 68 69 6e 65 20 64 65 70 | 65 6e 64 65 6e 74 20 6d |hine dep|endent m|
|000030f0| 6f 64 75 6c 65 2e 0a 58 | 0a 58 69 6e 74 20 6d 61 |odule..X|.Xint ma|
|00003100| 63 68 69 6e 65 5f 69 6e | 69 74 28 73 74 72 75 63 |chine_in|it(struc|
|00003110| 74 20 73 74 61 74 69 63 | 73 20 2a 29 0a 58 0a 58 |t static|s *).X.X|
|00003120| 09 72 65 74 75 72 6e 73 | 20 30 20 6f 6e 20 73 75 |.returns| 0 on su|
|00003130| 63 63 65 73 73 20 61 6e | 64 20 2d 31 20 6f 6e 20 |ccess an|d -1 on |
|00003140| 66 61 69 6c 75 72 65 2c | 0a 58 09 70 72 69 6e 74 |failure,|.X.print|
|00003150| 73 20 65 72 72 6f 72 20 | 6d 65 73 73 61 67 65 73 |s error |messages|
|00003160| 0a 58 0a 58 63 68 61 72 | 20 2a 66 6f 72 6d 61 74 |.X.Xchar| *format|
|00003170| 5f 68 65 61 64 65 72 28 | 63 68 61 72 20 2a 29 0a |_header(|char *).|
|00003180| 58 0a 58 09 52 65 74 75 | 72 6e 73 20 61 20 73 74 |X.X.Retu|rns a st|
|00003190| 72 69 6e 67 20 77 68 69 | 63 68 20 73 68 6f 75 6c |ring whi|ch shoul|
|000031a0| 64 20 62 65 20 75 73 65 | 64 20 61 73 20 74 68 65 |d be use|d as the|
|000031b0| 20 68 65 61 64 65 72 20 | 66 6f 72 20 74 68 65 0a | header |for the.|
|000031c0| 58 09 70 72 6f 63 65 73 | 73 20 64 69 73 70 6c 61 |X.proces|s displa|
|000031d0| 79 20 61 72 65 61 2e 20 | 20 54 68 65 20 61 72 67 |y area. | The arg|
|000031e0| 75 6d 65 6e 74 20 69 73 | 20 61 20 73 74 72 69 6e |ument is| a strin|
|000031f0| 67 20 75 73 65 64 20 74 | 6f 20 6c 61 62 65 6c 0a |g used t|o label.|
|00003200| 58 09 74 68 65 20 75 73 | 65 72 6e 61 6d 65 20 63 |X.the us|ername c|
|00003210| 6f 6c 75 6d 6e 20 28 65 | 69 74 68 65 72 20 22 55 |olumn (e|ither "U|
|00003220| 53 45 52 4e 41 4d 45 22 | 20 6f 72 20 22 55 49 44 |SERNAME"| or "UID|
|00003230| 22 29 20 61 6e 64 20 69 | 73 20 61 6c 77 61 79 73 |") and i|s always|
|00003240| 0a 58 09 38 20 63 68 61 | 72 61 63 74 65 72 73 20 |.X.8 cha|racters |
|00003250| 69 6e 20 6c 65 6e 67 74 | 68 2e 0a 58 0a 58 76 6f |in lengt|h..X.Xvo|
|00003260| 69 64 20 67 65 74 5f 73 | 79 73 74 65 6d 5f 69 6e |id get_s|ystem_in|
|00003270| 66 6f 28 73 74 72 75 63 | 74 20 73 79 73 74 65 6d |fo(struc|t system|
|00003280| 5f 69 6e 66 6f 20 2a 29 | 0a 58 0a 58 63 61 64 64 |_info *)|.X.Xcadd|
|00003290| 72 5f 74 20 67 65 74 5f | 70 72 6f 63 65 73 73 5f |r_t get_|process_|
|000032a0| 69 6e 66 6f 28 73 74 72 | 75 63 74 20 73 79 73 74 |info(str|uct syst|
|000032b0| 65 6d 5f 69 6e 66 6f 20 | 2a 2c 20 69 6e 74 2c 20 |em_info |*, int, |
|000032c0| 69 6e 74 2c 20 69 6e 74 | 20 28 2a 66 75 6e 63 29 |int, int| (*func)|
|000032d0| 28 29 29 0a 58 0a 58 09 | 72 65 74 75 72 6e 73 20 |()).X.X.|returns |
|000032e0| 61 20 68 61 6e 64 6c 65 | 20 74 6f 20 75 73 65 20 |a handle| to use |
|000032f0| 77 69 74 68 20 66 6f 72 | 6d 61 74 5f 6e 65 78 74 |with for|mat_next|
|00003300| 5f 70 72 6f 63 65 73 73 | 0a 58 0a 58 63 68 61 72 |_process|.X.Xchar|
|00003310| 20 2a 66 6f 72 6d 61 74 | 5f 6e 65 78 74 5f 70 72 | *format|_next_pr|
|00003320| 6f 63 65 73 73 28 63 61 | 64 64 72 5f 74 2c 20 63 |ocess(ca|ddr_t, c|
|00003330| 68 61 72 20 2a 28 2a 66 | 75 6e 63 29 28 29 29 0a |har *(*f|unc)()).|
|00003340| 58 0a 58 09 72 65 74 75 | 72 6e 73 20 73 74 72 69 |X.X.retu|rns stri|
|00003350| 6e 67 20 77 68 69 63 68 | 20 64 65 73 63 72 69 62 |ng which| describ|
|00003360| 65 73 20 6e 65 78 74 20 | 70 72 6f 63 65 73 73 0a |es next |process.|
|00003370| 58 0a 58 69 6e 74 20 70 | 72 6f 63 5f 63 6f 6d 70 |X.Xint p|roc_comp|
|00003380| 61 72 65 28 63 61 64 64 | 72 5f 74 2c 20 63 61 64 |are(cadd|r_t, cad|
|00003390| 64 72 5f 74 29 0a 58 0a | 58 09 71 73 6f 72 74 20 |dr_t).X.|X.qsort |
|000033a0| 63 6f 6d 70 61 72 69 73 | 6f 6e 20 66 75 6e 63 74 |comparis|on funct|
|000033b0| 69 6f 6e 0a 58 0a 58 75 | 69 64 5f 74 20 70 72 6f |ion.X.Xu|id_t pro|
|000033c0| 63 5f 6f 77 6e 65 72 28 | 70 69 64 5f 74 29 0a 58 |c_owner(|pid_t).X|
|000033d0| 0a 58 09 52 65 74 75 72 | 6e 73 20 74 68 65 20 75 |.X.Retur|ns the u|
|000033e0| 69 64 20 6f 77 6e 65 72 | 20 6f 66 20 74 68 65 20 |id owner| of the |
|000033f0| 70 72 6f 63 65 73 73 20 | 73 70 65 63 69 66 69 65 |process |specifie|
|00003400| 64 20 62 79 20 74 68 65 | 20 70 69 64 20 61 72 67 |d by the| pid arg|
|00003410| 75 6d 65 6e 74 2e 0a 58 | 09 54 68 69 73 20 66 75 |ument..X|.This fu|
|00003420| 6e 63 74 69 6f 6e 20 69 | 73 20 56 45 52 59 20 49 |nction i|s VERY I|
|00003430| 4d 50 4f 52 54 41 4e 54 | 2e 20 20 49 66 20 69 74 |MPORTANT|. If it|
|00003440| 20 66 61 69 6c 73 20 74 | 6f 20 64 6f 20 69 74 73 | fails t|o do its|
|00003450| 20 6a 6f 62 2c 20 74 68 | 65 6e 0a 58 09 74 6f 70 | job, th|en.X.top|
|00003460| 20 6d 61 79 20 70 6f 73 | 65 20 61 20 73 65 63 75 | may pos|e a secu|
|00003470| 72 69 74 79 20 72 69 73 | 6b 2e 0a 58 0a 58 0a 58 |rity ris|k..X.X.X|
|00003480| 67 65 74 5f 70 72 6f 63 | 65 73 73 5f 69 6e 66 6f |get_proc|ess_info|
|00003490| 20 69 73 20 63 61 6c 6c | 65 64 20 69 6d 6d 65 64 | is call|ed immed|
|000034a0| 69 61 74 65 6c 79 20 61 | 66 74 65 72 20 67 65 74 |iately a|fter get|
|000034b0| 5f 73 79 73 74 65 6d 5f | 69 6e 66 6f 2e 20 20 49 |_system_|info. I|
|000034c0| 6e 0a 58 66 61 63 74 2c | 20 74 68 65 20 74 77 6f |n.Xfact,| the two|
|000034d0| 20 66 75 6e 63 74 69 6f | 6e 73 20 63 6f 75 6c 64 | functio|ns could|
|000034e0| 20 62 65 20 72 6f 6c 6c | 65 64 20 69 6e 20 74 6f | be roll|ed in to|
|000034f0| 20 6f 6e 65 2e 20 20 54 | 68 65 20 72 65 61 73 6f | one. T|he reaso|
|00003500| 6e 20 74 68 65 79 0a 58 | 61 72 65 20 6e 6f 74 20 |n they.X|are not |
|00003510| 69 73 20 6d 6f 73 74 6c | 79 20 68 69 73 74 6f 72 |is mostl|y histor|
|00003520| 69 63 61 6c 2e 0a 58 0a | 58 54 6f 70 20 72 65 6c |ical..X.|XTop rel|
|00003530| 69 65 73 20 6f 6e 20 74 | 68 65 20 65 78 69 73 74 |ies on t|he exist|
|00003540| 65 6e 63 65 20 6f 66 20 | 61 20 66 75 6e 63 74 69 |ence of |a functi|
|00003550| 6f 6e 20 63 61 6c 6c 65 | 64 20 22 73 65 74 70 72 |on calle|d "setpr|
|00003560| 69 6f 72 69 74 79 22 20 | 74 6f 0a 58 63 68 61 6e |iority" |to.Xchan|
|00003570| 67 65 20 61 20 70 72 6f | 63 65 73 73 27 73 20 70 |ge a pro|cess's p|
|00003580| 72 69 6f 72 69 74 79 2e | 20 20 54 68 69 73 20 65 |riority.| This e|
|00003590| 78 69 73 74 73 20 61 73 | 20 61 20 6b 65 72 6e 65 |xists as| a kerne|
|000035a0| 6c 20 63 61 6c 6c 20 6f | 6e 20 6d 6f 73 74 20 34 |l call o|n most 4|
|000035b0| 2e 33 0a 58 42 53 44 20 | 64 65 72 69 76 65 64 20 |.3.XBSD |derived |
|000035c0| 55 6e 69 78 65 73 2e 20 | 20 49 66 20 6e 65 69 74 |Unixes. | If neit|
|000035d0| 68 65 72 20 79 6f 75 72 | 20 6f 70 65 72 61 74 69 |her your| operati|
|000035e0| 6e 67 20 73 79 73 74 65 | 6d 20 6e 6f 72 20 79 6f |ng syste|m nor yo|
|000035f0| 75 72 20 43 0a 58 6c 69 | 62 72 61 72 79 20 73 75 |ur C.Xli|brary su|
|00003600| 70 70 6c 69 65 73 20 73 | 75 63 68 20 61 20 66 75 |pplies s|uch a fu|
|00003610| 6e 63 74 69 6f 6e 2c 20 | 74 68 65 6e 20 79 6f 75 |nction, |then you|
|00003620| 20 77 69 6c 6c 20 6e 65 | 65 64 20 74 6f 20 61 64 | will ne|ed to ad|
|00003630| 64 20 6f 6e 65 20 74 6f | 20 74 68 65 0a 58 6d 6f |d one to| the.Xmo|
|00003640| 64 75 6c 65 2e 20 20 49 | 74 20 69 73 20 64 65 66 |dule. I|t is def|
|00003650| 69 6e 65 64 20 61 73 20 | 66 6f 6c 6c 6f 77 73 3a |ined as |follows:|
|00003660| 0a 58 0a 58 09 69 6e 74 | 20 73 65 74 70 72 69 6f |.X.X.int| setprio|
|00003670| 72 69 74 79 20 28 69 6e | 74 20 64 75 6d 6d 79 2c |rity (in|t dummy,|
|00003680| 20 69 6e 74 20 77 68 6f | 2c 20 69 6e 74 20 6e 69 | int who|, int ni|
|00003690| 63 65 76 61 6c 29 0a 58 | 0a 58 09 46 6f 72 20 74 |ceval).X|.X.For t|
|000036a0| 68 65 20 70 75 72 70 6f | 73 65 73 20 6f 66 20 74 |he purpo|ses of t|
|000036b0| 6f 70 2c 20 74 68 65 20 | 66 69 72 73 74 20 61 72 |op, the |first ar|
|000036c0| 67 75 6d 65 6e 74 20 69 | 73 20 6d 65 61 6e 69 6e |gument i|s meanin|
|000036d0| 67 6c 65 73 73 2e 0a 58 | 09 54 68 65 20 73 65 63 |gless..X|.The sec|
|000036e0| 6f 6e 64 20 69 73 20 74 | 68 65 20 70 69 64 20 61 |ond is t|he pid a|
|000036f0| 6e 64 20 74 68 65 20 74 | 68 69 72 64 20 69 73 20 |nd the t|hird is |
|00003700| 74 68 65 20 6e 65 77 20 | 6e 69 63 65 20 76 61 6c |the new |nice val|
|00003710| 75 65 2e 0a 58 09 54 68 | 69 73 20 66 75 6e 63 74 |ue..X.Th|is funct|
|00003720| 69 6f 6e 20 73 68 6f 75 | 6c 64 20 62 65 68 61 76 |ion shou|ld behav|
|00003730| 65 20 6a 75 73 74 20 6c | 69 6b 65 20 61 20 6b 65 |e just l|ike a ke|
|00003740| 72 6e 65 6c 20 63 61 6c | 6c 2c 20 73 65 74 74 69 |rnel cal|l, setti|
|00003750| 6e 67 0a 58 09 65 72 72 | 6e 6f 20 61 6e 64 20 72 |ng.X.err|no and r|
|00003760| 65 74 75 72 6e 69 6e 67 | 20 2d 31 20 69 6e 20 63 |eturning| -1 in c|
|00003770| 61 73 65 20 6f 66 20 61 | 6e 20 65 72 72 6f 72 2e |ase of a|n error.|
|00003780| 20 20 54 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 20 | This f|unction |
|00003790| 4d 55 53 54 0a 58 09 63 | 68 65 63 6b 20 74 6f 20 |MUST.X.c|heck to |
|000037a0| 6d 61 6b 65 20 73 75 72 | 65 20 74 68 61 74 20 61 |make sur|e that a|
|000037b0| 20 6e 6f 6e 2d 72 6f 6f | 74 20 75 73 65 72 20 64 | non-roo|t user d|
|000037c0| 6f 65 73 20 6e 6f 74 20 | 73 70 65 63 69 66 79 20 |oes not |specify |
|000037d0| 61 20 6e 69 63 65 0a 58 | 09 76 61 6c 75 65 20 6c |a nice.X|.value l|
|000037e0| 65 73 73 20 74 68 61 6e | 20 74 68 65 20 70 72 6f |ess than| the pro|
|000037f0| 63 65 73 73 27 73 20 63 | 75 72 72 65 6e 74 20 76 |cess's c|urrent v|
|00003800| 61 6c 75 65 2e 20 20 49 | 66 20 69 74 20 64 65 74 |alue. I|f it det|
|00003810| 65 63 74 73 20 73 75 63 | 68 0a 58 09 61 20 63 6f |ects suc|h.X.a co|
|00003820| 6e 64 69 74 69 6f 6e 2c | 20 69 74 20 73 68 6f 75 |ndition,| it shou|
|00003830| 6c 64 20 73 65 74 20 65 | 72 72 6e 6f 20 74 6f 20 |ld set e|rrno to |
|00003840| 45 41 43 43 45 53 20 61 | 6e 64 20 72 65 74 75 72 |EACCES a|nd retur|
|00003850| 6e 20 2d 31 2e 0a 58 09 | 4f 74 68 65 72 20 70 6f |n -1..X.|Other po|
|00003860| 73 73 69 62 6c 65 20 45 | 52 52 4e 4f 20 76 61 6c |ssible E|RRNO val|
|00003870| 75 65 73 3a 20 20 45 53 | 52 43 48 20 77 68 65 6e |ues: ES|RCH when|
|00003880| 20 70 69 64 20 22 77 68 | 6f 22 20 64 6f 65 73 20 | pid "wh|o" does |
|00003890| 6e 6f 74 20 65 78 69 73 | 74 2c 0a 58 09 45 50 45 |not exis|t,.X.EPE|
|000038a0| 52 4d 20 77 68 65 6e 20 | 74 68 65 20 69 6e 76 6f |RM when |the invo|
|000038b0| 6b 65 72 20 69 73 20 6e | 6f 74 20 72 6f 6f 74 20 |ker is n|ot root |
|000038c0| 61 6e 64 20 6e 6f 74 20 | 74 68 65 20 73 61 6d 65 |and not |the same|
|000038d0| 20 61 73 20 74 68 65 0a | 58 09 70 72 6f 63 65 73 | as the.|X.proces|
|000038e0| 73 20 6f 77 6e 65 72 2e | 0a 58 0a 58 4e 6f 74 65 |s owner.|.X.XNote|
|000038f0| 20 74 68 61 74 20 74 6f | 70 20 63 68 65 63 6b 73 | that to|p checks|
|00003900| 20 70 72 6f 63 65 73 73 | 20 6f 77 6e 65 72 73 68 | process| ownersh|
|00003910| 69 70 20 61 6e 64 20 73 | 68 6f 75 6c 64 20 6e 65 |ip and s|hould ne|
|00003920| 76 65 72 20 63 61 6c 6c | 20 73 65 74 70 72 69 6f |ver call| setprio|
|00003930| 72 69 74 79 0a 58 77 68 | 65 6e 20 74 68 65 20 69 |rity.Xwh|en the i|
|00003940| 6e 76 6f 6b 65 72 27 73 | 20 75 69 64 20 69 73 20 |nvoker's| uid is |
|00003950| 6e 6f 74 20 72 6f 6f 74 | 20 61 6e 64 20 6e 6f 74 |not root| and not|
|00003960| 20 74 68 65 20 73 61 6d | 65 20 61 73 20 74 68 65 | the sam|e as the|
|00003970| 20 70 72 6f 63 65 73 73 | 27 73 20 6f 77 6e 65 72 | process|'s owner|
|00003980| 0a 58 75 69 64 2e 0a 58 | 0a 58 0a 58 54 68 65 20 |.Xuid..X|.X.XThe |
|00003990| 66 69 6c 65 20 22 6d 61 | 63 68 69 6e 65 2e 68 22 |file "ma|chine.h"|
|000039a0| 20 63 6f 6e 74 61 69 6e | 73 20 64 65 66 69 6e 69 | contain|s defini|
|000039b0| 74 69 6f 6e 73 20 77 68 | 69 63 68 20 61 72 65 20 |tions wh|ich are |
|000039c0| 75 73 65 66 75 6c 20 74 | 6f 20 6d 6f 64 75 6c 65 |useful t|o module|
|000039d0| 73 0a 58 61 6e 64 20 74 | 6f 20 74 6f 70 2e 63 20 |s.Xand t|o top.c |
|000039e0| 28 73 75 63 68 20 61 73 | 20 74 68 65 20 73 74 72 |(such as| the str|
|000039f0| 75 63 74 75 72 65 20 64 | 65 66 69 6e 69 74 69 6f |ucture d|efinitio|
|00003a00| 6e 73 29 2e 20 20 59 6f | 75 20 53 48 4f 55 4c 44 |ns). Yo|u SHOULD|
|00003a10| 20 4e 4f 54 20 6e 65 65 | 64 0a 58 74 6f 20 63 68 | NOT nee|d.Xto ch|
|00003a20| 61 6e 67 65 20 69 74 20 | 77 68 65 6e 20 70 6f 72 |ange it |when por|
|00003a30| 74 69 6e 67 20 74 6f 20 | 61 20 6e 65 77 20 70 6c |ting to |a new pl|
|00003a40| 61 74 66 6f 72 6d 2e 0a | 58 0a 58 50 6f 72 74 69 |atform..|X.XPorti|
|00003a50| 6e 67 20 74 6f 20 61 20 | 6e 65 77 20 70 6c 61 74 |ng to a |new plat|
|00003a60| 66 6f 72 6d 20 73 68 6f | 75 6c 64 20 4e 4f 54 20 |form sho|uld NOT |
|00003a70| 72 65 71 75 69 72 65 20 | 61 6e 79 20 63 68 61 6e |require |any chan|
|00003a80| 67 65 73 20 74 6f 20 65 | 78 69 73 74 69 6e 67 0a |ges to e|xisting.|
|00003a90| 58 66 69 6c 65 73 2e 20 | 20 59 6f 75 20 73 68 6f |Xfiles. | You sho|
|00003aa0| 75 6c 64 20 6f 6e 6c 79 | 20 6e 65 65 64 20 74 6f |uld only| need to|
|00003ab0| 20 61 64 64 20 6d 5f 20 | 66 69 6c 65 73 2e 20 20 | add m_ |files. |
|00003ac0| 49 66 20 79 6f 75 20 66 | 65 65 6c 20 79 6f 75 20 |If you f|eel you |
|00003ad0| 6e 65 65 64 20 61 0a 58 | 63 68 61 6e 67 65 20 69 |need a.X|change i|
|00003ae0| 6e 20 6f 6e 65 20 6f 66 | 20 74 68 65 20 65 78 69 |n one of| the exi|
|00003af0| 73 74 69 6e 67 20 66 69 | 6c 65 73 2c 20 70 6c 65 |sting fi|les, ple|
|00003b00| 61 73 65 20 63 6f 6e 74 | 61 63 74 20 6d 65 20 73 |ase cont|act me s|
|00003b10| 6f 20 74 68 61 74 20 77 | 65 20 63 61 6e 0a 58 64 |o that w|e can.Xd|
|00003b20| 69 73 63 75 73 73 20 74 | 68 65 20 64 65 74 61 69 |iscuss t|he detai|
|00003b30| 6c 73 2e 20 20 49 20 77 | 61 6e 74 20 74 6f 20 6b |ls. I w|ant to k|
|00003b40| 65 65 70 20 73 75 63 68 | 20 63 68 61 6e 67 65 73 |eep such| changes|
|00003b50| 20 61 73 20 67 65 6e 65 | 72 61 6c 20 61 73 0a 58 | as gene|ral as.X|
|00003b60| 70 6f 73 73 69 62 6c 65 | 2e 0a 58 0a 45 4e 44 5f |possible|..X.END_|
|00003b70| 4f 46 5f 46 49 4c 45 0a | 69 66 20 74 65 73 74 20 |OF_FILE.|if test |
|00003b80| 37 30 35 35 20 2d 6e 65 | 20 60 77 63 20 2d 63 20 |7055 -ne| `wc -c |
|00003b90| 3c 27 50 6f 72 74 69 6e | 67 27 60 3b 20 74 68 65 |<'Portin|g'`; the|
|00003ba0| 6e 0a 20 20 20 20 65 63 | 68 6f 20 73 68 61 72 3a |n. ec|ho shar:|
|00003bb0| 20 5c 22 27 50 6f 72 74 | 69 6e 67 27 5c 22 20 75 | \"'Port|ing'\" u|
|00003bc0| 6e 70 61 63 6b 65 64 20 | 77 69 74 68 20 77 72 6f |npacked |with wro|
|00003bd0| 6e 67 20 73 69 7a 65 21 | 0a 66 69 0a 23 20 65 6e |ng size!|.fi.# en|
|00003be0| 64 20 6f 66 20 27 50 6f | 72 74 69 6e 67 27 0a 66 |d of 'Po|rting'.f|
|00003bf0| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 63 6f |i.if tes|t -f 'co|
|00003c00| 6d 6d 61 6e 64 73 2e 63 | 27 20 2d 61 20 22 24 7b |mmands.c|' -a "${|
|00003c10| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|00003c20| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|00003c30| 20 57 69 6c 6c 20 6e 6f | 74 20 63 6c 6f 62 62 65 | Will no|t clobbe|
|00003c40| 72 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |r existi|ng file |
|00003c50| 5c 22 27 63 6f 6d 6d 61 | 6e 64 73 2e 63 27 5c 22 |\"'comma|nds.c'\"|
|00003c60| 0a 65 6c 73 65 0a 65 63 | 68 6f 20 73 68 61 72 3a |.else.ec|ho shar:|
|00003c70| 20 45 78 74 72 61 63 74 | 69 6e 67 20 5c 22 27 63 | Extract|ing \"'c|
|00003c80| 6f 6d 6d 61 6e 64 73 2e | 63 27 5c 22 20 5c 28 39 |ommands.|c'\" \(9|
|00003c90| 39 37 37 20 63 68 61 72 | 61 63 74 65 72 73 5c 29 |977 char|acters\)|
|00003ca0| 0a 73 65 64 20 22 73 2f | 5e 58 2f 2f 22 20 3e 27 |.sed "s/|^X//" >'|
|00003cb0| 63 6f 6d 6d 61 6e 64 73 | 2e 63 27 20 3c 3c 27 45 |commands|.c' <<'E|
|00003cc0| 4e 44 5f 4f 46 5f 46 49 | 4c 45 27 0a 58 2f 2a 0a |ND_OF_FI|LE'.X/*.|
|00003cd0| 58 20 2a 20 20 54 6f 70 | 20 75 73 65 72 73 2f 70 |X * Top| users/p|
|00003ce0| 72 6f 63 65 73 73 65 73 | 20 64 69 73 70 6c 61 79 |rocesses| display|
|00003cf0| 20 66 6f 72 20 55 6e 69 | 78 0a 58 20 2a 20 20 56 | for Uni|x.X * V|
|00003d00| 65 72 73 69 6f 6e 20 33 | 0a 58 20 2a 0a 58 20 2a |ersion 3|.X *.X *|
|00003d10| 20 20 54 68 69 73 20 70 | 72 6f 67 72 61 6d 20 6d | This p|rogram m|
|00003d20| 61 79 20 62 65 20 66 72 | 65 65 6c 79 20 72 65 64 |ay be fr|eely red|
|00003d30| 69 73 74 72 69 62 75 74 | 65 64 2c 0a 58 20 2a 20 |istribut|ed,.X * |
|00003d40| 20 62 75 74 20 74 68 69 | 73 20 65 6e 74 69 72 65 | but thi|s entire|
|00003d50| 20 63 6f 6d 6d 65 6e 74 | 20 4d 55 53 54 20 72 65 | comment| MUST re|
|00003d60| 6d 61 69 6e 20 69 6e 74 | 61 63 74 2e 0a 58 20 2a |main int|act..X *|
|00003d70| 0a 58 20 2a 20 20 43 6f | 70 79 72 69 67 68 74 20 |.X * Co|pyright |
|00003d80| 28 63 29 20 31 39 38 34 | 2c 20 31 39 38 39 2c 20 |(c) 1984|, 1989, |
|00003d90| 57 69 6c 6c 69 61 6d 20 | 4c 65 46 65 62 76 72 65 |William |LeFebvre|
|00003da0| 2c 20 52 69 63 65 20 55 | 6e 69 76 65 72 73 69 74 |, Rice U|niversit|
|00003db0| 79 0a 58 20 2a 20 20 43 | 6f 70 79 72 69 67 68 74 |y.X * C|opyright|
|00003dc0| 20 28 63 29 20 31 39 38 | 39 2c 20 31 39 39 30 2c | (c) 198|9, 1990,|
|00003dd0| 20 31 39 39 32 2c 20 57 | 69 6c 6c 69 61 6d 20 4c | 1992, W|illiam L|
|00003de0| 65 46 65 62 76 72 65 2c | 20 4e 6f 72 74 68 77 65 |eFebvre,| Northwe|
|00003df0| 73 74 65 72 6e 20 55 6e | 69 76 65 72 73 69 74 79 |stern Un|iversity|
|00003e00| 0a 58 20 2a 2f 0a 58 0a | 58 2f 2a 0a 58 20 2a 20 |.X */.X.|X/*.X * |
|00003e10| 20 54 68 69 73 20 66 69 | 6c 65 20 63 6f 6e 74 61 | This fi|le conta|
|00003e20| 69 6e 73 20 74 68 65 20 | 72 6f 75 74 69 6e 65 73 |ins the |routines|
|00003e30| 20 74 68 61 74 20 69 6d | 70 6c 65 6d 65 6e 74 20 | that im|plement |
|00003e40| 73 6f 6d 65 20 6f 66 20 | 74 68 65 20 69 6e 74 65 |some of |the inte|
|00003e50| 72 61 63 74 69 76 65 0a | 58 20 2a 20 20 6d 6f 64 |ractive.|X * mod|
|00003e60| 65 20 63 6f 6d 6d 61 6e | 64 73 2e 20 20 4e 6f 74 |e comman|ds. Not|
|00003e70| 65 20 74 68 61 74 20 73 | 6f 6d 65 20 6f 66 20 74 |e that s|ome of t|
|00003e80| 68 65 20 63 6f 6d 6d 61 | 6e 64 73 20 61 72 65 20 |he comma|nds are |
|00003e90| 69 6d 70 6c 65 6d 65 6e | 74 65 64 20 69 6e 2d 6c |implemen|ted in-l|
|00003ea0| 69 6e 65 0a 58 20 2a 20 | 20 69 6e 20 22 6d 61 69 |ine.X * | in "mai|
|00003eb0| 6e 22 2e 20 20 54 68 69 | 73 20 69 73 20 6e 65 63 |n". Thi|s is nec|
|00003ec0| 65 73 73 61 72 79 20 62 | 65 63 61 75 73 65 20 74 |essary b|ecause t|
|00003ed0| 68 65 79 20 63 68 61 6e | 67 65 20 74 68 65 20 67 |hey chan|ge the g|
|00003ee0| 6c 6f 62 61 6c 20 73 74 | 61 74 65 20 6f 66 0a 58 |lobal st|ate of.X|
|00003ef0| 20 2a 20 20 22 74 6f 70 | 22 20 28 69 2e 65 2e 3a | * "top|" (i.e.:|
|00003f00| 20 20 63 68 61 6e 67 69 | 6e 67 20 74 68 65 20 6e | changi|ng the n|
|00003f10| 75 6d 62 65 72 20 6f 66 | 20 70 72 6f 63 65 73 73 |umber of| process|
|00003f20| 65 73 20 74 6f 20 64 69 | 73 70 6c 61 79 29 2e 0a |es to di|splay)..|
|00003f30| 58 20 2a 2f 0a 58 0a 58 | 23 69 6e 63 6c 75 64 65 |X */.X.X|#include|
|00003f40| 20 22 6f 73 2e 68 22 0a | 58 23 69 6e 63 6c 75 64 | "os.h".|X#includ|
|00003f50| 65 20 3c 63 74 79 70 65 | 2e 68 3e 0a 58 23 69 6e |e <ctype|.h>.X#in|
|00003f60| 63 6c 75 64 65 20 3c 73 | 69 67 6e 61 6c 2e 68 3e |clude <s|ignal.h>|
|00003f70| 0a 58 23 69 6e 63 6c 75 | 64 65 20 3c 65 72 72 6e |.X#inclu|de <errn|
|00003f80| 6f 2e 68 3e 0a 58 23 69 | 6e 63 6c 75 64 65 20 3c |o.h>.X#i|nclude <|
|00003f90| 73 79 73 2f 74 69 6d 65 | 2e 68 3e 0a 58 23 69 6e |sys/time|.h>.X#in|
|00003fa0| 63 6c 75 64 65 20 3c 73 | 79 73 2f 72 65 73 6f 75 |clude <s|ys/resou|
|00003fb0| 72 63 65 2e 68 3e 0a 58 | 0a 58 23 69 6e 63 6c 75 |rce.h>.X|.X#inclu|
|00003fc0| 64 65 20 22 73 69 67 64 | 65 73 63 2e 68 22 09 09 |de "sigd|esc.h"..|
|00003fd0| 2f 2a 20 67 65 6e 65 72 | 61 74 65 64 20 61 75 74 |/* gener|ated aut|
|00003fe0| 6f 6d 61 74 69 63 61 6c | 6c 79 20 2a 2f 0a 58 23 |omatical|ly */.X#|
|00003ff0| 69 6e 63 6c 75 64 65 20 | 22 62 6f 6f 6c 65 61 6e |include |"boolean|
|00004000| 2e 68 22 0a 58 23 69 6e | 63 6c 75 64 65 20 22 75 |.h".X#in|clude "u|
|00004010| 74 69 6c 73 2e 68 22 0a | 58 0a 58 65 78 74 65 72 |tils.h".|X.Xexter|
|00004020| 6e 20 69 6e 74 20 20 65 | 72 72 6e 6f 3b 0a 58 0a |n int e|rrno;.X.|
|00004030| 58 65 78 74 65 72 6e 20 | 63 68 61 72 20 2a 63 6f |Xextern |char *co|
|00004040| 70 79 72 69 67 68 74 3b | 0a 58 0a 58 2f 2a 20 69 |pyright;|.X.X/* i|
|00004050| 6d 70 6f 72 74 65 64 20 | 66 72 6f 6d 20 73 63 72 |mported |from scr|
|00004060| 65 65 6e 2e 63 20 2a 2f | 0a 58 65 78 74 65 72 6e |een.c */|.Xextern|
|00004070| 20 69 6e 74 20 6f 76 65 | 72 73 74 72 69 6b 65 3b | int ove|rstrike;|
|00004080| 0a 58 0a 58 69 6e 74 20 | 65 72 72 5f 63 6f 6d 70 |.X.Xint |err_comp|
|00004090| 61 72 28 29 3b 0a 58 63 | 68 61 72 20 2a 65 72 72 |ar();.Xc|har *err|
|000040a0| 5f 73 74 72 69 6e 67 28 | 29 3b 0a 58 0a 58 2f 2a |_string(|);.X.X/*|
|000040b0| 0a 58 20 2a 20 20 73 68 | 6f 77 5f 68 65 6c 70 28 |.X * sh|ow_help(|
|000040c0| 29 20 2d 20 64 69 73 70 | 6c 61 79 20 74 68 65 20 |) - disp|lay the |
|000040d0| 68 65 6c 70 20 73 63 72 | 65 65 6e 3b 20 69 6e 76 |help scr|een; inv|
|000040e0| 6f 6b 65 64 20 69 6e 20 | 72 65 73 70 6f 6e 73 65 |oked in |response|
|000040f0| 20 74 6f 0a 58 20 2a 09 | 09 65 69 74 68 65 72 20 | to.X *.|.either |
|00004100| 27 68 27 20 6f 72 20 27 | 3f 27 2e 0a 58 20 2a 2f |'h' or '|?'..X */|
|00004110| 0a 58 0a 58 73 68 6f 77 | 5f 68 65 6c 70 28 29 0a |.X.Xshow|_help().|
|00004120| 58 0a 58 7b 0a 58 20 20 | 20 20 70 72 69 6e 74 66 |X.X{.X | printf|
|00004130| 28 22 54 6f 70 20 76 65 | 72 73 69 6f 6e 20 25 73 |("Top ve|rsion %s|
|00004140| 2c 20 25 73 5c 6e 22 2c | 20 76 65 72 73 69 6f 6e |, %s\n",| version|
|00004150| 5f 73 74 72 69 6e 67 28 | 29 2c 20 63 6f 70 79 72 |_string(|), copyr|
|00004160| 69 67 68 74 29 3b 0a 58 | 20 20 20 20 66 70 75 74 |ight);.X| fput|
|00004170| 73 28 22 5c 6e 5c 6e 5c | 0a 58 41 20 74 6f 70 20 |s("\n\n\|.XA top |
|00004180| 75 73 65 72 73 20 64 69 | 73 70 6c 61 79 20 66 6f |users di|splay fo|
|00004190| 72 20 55 6e 69 78 5c 6e | 5c 0a 58 5c 6e 5c 0a 58 |r Unix\n|\.X\n\.X|
|000041a0| 54 68 65 73 65 20 73 69 | 6e 67 6c 65 2d 63 68 61 |These si|ngle-cha|
|000041b0| 72 61 63 74 65 72 20 63 | 6f 6d 6d 61 6e 64 73 20 |racter c|ommands |
|000041c0| 61 72 65 20 61 76 61 69 | 6c 61 62 6c 65 3a 5c 6e |are avai|lable:\n|
|000041d0| 5c 0a 58 5c 6e 5c 0a 58 | 5e 4c 20 20 20 20 20 20 |\.X\n\.X|^L |
|000041e0| 2d 20 72 65 64 72 61 77 | 20 73 63 72 65 65 6e 5c |- redraw| screen\|
|000041f0| 6e 5c 0a 58 71 20 20 20 | 20 20 20 20 2d 20 71 75 |n\.Xq | - qu|
|00004200| 69 74 5c 6e 5c 0a 58 68 | 20 6f 72 20 3f 20 20 2d |it\n\.Xh| or ? -|
|00004210| 20 68 65 6c 70 3b 20 73 | 68 6f 77 20 74 68 69 73 | help; s|how this|
|00004220| 20 74 65 78 74 5c 6e 22 | 2c 20 73 74 64 6f 75 74 | text\n"|, stdout|
|00004230| 29 3b 0a 58 0a 58 20 20 | 20 20 2f 2a 20 6e 6f 74 |);.X.X | /* not|
|00004240| 20 61 6c 6c 20 63 6f 6d | 6d 61 6e 64 73 20 61 72 | all com|mands ar|
|00004250| 65 20 61 76 61 69 6c 61 | 6c 62 65 20 77 69 74 68 |e availa|lbe with|
|00004260| 20 6f 76 65 72 73 74 72 | 69 6b 65 20 74 65 72 6d | overstr|ike term|
|00004270| 69 6e 61 6c 73 20 2a 2f | 0a 58 20 20 20 20 69 66 |inals */|.X if|
|00004280| 20 28 6f 76 65 72 73 74 | 72 69 6b 65 29 0a 58 20 | (overst|rike).X |
|00004290| 20 20 20 7b 0a 58 09 66 | 70 75 74 73 28 22 5c 6e | {.X.f|puts("\n|
|000042a0| 5c 0a 58 4f 74 68 65 72 | 20 63 6f 6d 6d 61 6e 64 |\.XOther| command|
|000042b0| 73 20 61 72 65 20 61 6c | 73 6f 20 61 76 61 69 6c |s are al|so avail|
|000042c0| 61 62 6c 65 2c 20 62 75 | 74 20 74 68 69 73 20 74 |able, bu|t this t|
|000042d0| 65 72 6d 69 6e 61 6c 20 | 69 73 20 6e 6f 74 5c 6e |erminal |is not\n|
|000042e0| 5c 0a 58 73 6f 70 68 69 | 73 74 69 63 61 74 65 64 |\.Xsophi|sticated|
|000042f0| 20 65 6e 6f 75 67 68 20 | 74 6f 20 68 61 6e 64 6c | enough |to handl|
|00004300| 65 20 74 68 6f 73 65 20 | 63 6f 6d 6d 61 6e 64 73 |e those |commands|
|00004310| 20 67 72 61 63 65 66 75 | 6c 6c 79 2e 5c 6e 5c 6e | gracefu|lly.\n\n|
|00004320| 22 2c 20 73 74 64 6f 75 | 74 29 3b 0a 58 20 20 20 |", stdou|t);.X |
|00004330| 20 7d 0a 58 20 20 20 20 | 65 6c 73 65 0a 58 20 20 | }.X |else.X |
|00004340| 20 20 7b 0a 58 09 66 70 | 75 74 73 28 22 5c 0a 58 | {.X.fp|uts("\.X|
|00004350| 64 20 20 20 20 20 20 20 | 2d 20 63 68 61 6e 67 65 |d |- change|
|00004360| 20 6e 75 6d 62 65 72 20 | 6f 66 20 64 69 73 70 6c | number |of displ|
|00004370| 61 79 73 20 74 6f 20 73 | 68 6f 77 5c 6e 5c 0a 58 |ays to s|how\n\.X|
|00004380| 65 20 20 20 20 20 20 20 | 2d 20 6c 69 73 74 20 65 |e |- list e|
|00004390| 72 72 6f 72 73 20 67 65 | 6e 65 72 61 74 65 64 20 |rrors ge|nerated |
|000043a0| 62 79 20 6c 61 73 74 20 | 5c 22 6b 69 6c 6c 5c 22 |by last |\"kill\"|
|000043b0| 20 6f 72 20 5c 22 72 65 | 6e 69 63 65 5c 22 20 63 | or \"re|nice\" c|
|000043c0| 6f 6d 6d 61 6e 64 5c 6e | 5c 0a 58 69 20 20 20 20 |ommand\n|\.Xi |
|000043d0| 20 20 20 2d 20 74 6f 67 | 67 6c 65 20 74 68 65 20 | - tog|gle the |
|000043e0| 64 69 73 70 6c 61 79 69 | 6e 67 20 6f 66 20 69 64 |displayi|ng of id|
|000043f0| 6c 65 20 70 72 6f 63 65 | 73 73 65 73 5c 6e 5c 0a |le proce|sses\n\.|
|00004400| 58 49 20 20 20 20 20 20 | 20 2d 20 73 61 6d 65 20 |XI | - same |
|00004410| 61 73 20 27 69 27 5c 6e | 5c 0a 58 6b 20 20 20 20 |as 'i'\n|\.Xk |
|00004420| 20 20 20 2d 20 6b 69 6c | 6c 20 70 72 6f 63 65 73 | - kil|l proces|
|00004430| 73 65 73 3b 20 73 65 6e | 64 20 61 20 73 69 67 6e |ses; sen|d a sign|
|00004440| 61 6c 20 74 6f 20 61 20 | 6c 69 73 74 20 6f 66 20 |al to a |list of |
|00004450| 70 72 6f 63 65 73 73 65 | 73 5c 6e 5c 0a 58 6e 20 |processe|s\n\.Xn |
|00004460| 6f 72 20 23 20 20 2d 20 | 63 68 61 6e 67 65 20 6e |or # - |change n|
|00004470| 75 6d 62 65 72 20 6f 66 | 20 70 72 6f 63 65 73 73 |umber of| process|
|00004480| 65 73 20 74 6f 20 64 69 | 73 70 6c 61 79 5c 6e 5c |es to di|splay\n\|
|00004490| 0a 58 72 20 20 20 20 20 | 20 20 2d 20 72 65 6e 69 |.Xr | - reni|
|000044a0| 63 65 20 61 20 70 72 6f | 63 65 73 73 5c 6e 5c 0a |ce a pro|cess\n\.|
|000044b0| 58 73 20 20 20 20 20 20 | 20 2d 20 63 68 61 6e 67 |Xs | - chang|
|000044c0| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 73 65 63 6f |e number| of seco|
|000044d0| 6e 64 73 20 74 6f 20 64 | 65 6c 61 79 20 62 65 74 |nds to d|elay bet|
|000044e0| 77 65 65 6e 20 75 70 64 | 61 74 65 73 5c 6e 5c 0a |ween upd|ates\n\.|
|000044f0| 58 75 20 20 20 20 20 20 | 20 2d 20 64 69 73 70 6c |Xu | - displ|
|00004500| 61 79 20 70 72 6f 63 65 | 73 73 65 73 20 66 6f 72 |ay proce|sses for|
|00004510| 20 6f 6e 6c 79 20 6f 6e | 65 20 75 73 65 72 20 28 | only on|e user (|
|00004520| 2b 20 73 65 6c 65 63 74 | 73 20 61 6c 6c 20 75 73 |+ select|s all us|
|00004530| 65 72 73 29 5c 6e 5c 0a | 58 5c 6e 5c 0a 58 5c 6e |ers)\n\.|X\n\.X\n|
|00004540| 22 2c 20 73 74 64 6f 75 | 74 29 3b 0a 58 20 20 20 |", stdou|t);.X |
|00004550| 20 7d 0a 58 7d 0a 58 0a | 58 2f 2a 0a 58 20 2a 20 | }.X}.X.|X/*.X * |
|00004560| 20 55 74 69 6c 69 74 79 | 20 72 6f 75 74 69 6e 65 | Utility| routine|
|00004570| 73 20 74 68 61 74 20 68 | 65 6c 70 20 77 69 74 68 |s that h|elp with|
|00004580| 20 73 6f 6d 65 20 6f 66 | 20 74 68 65 20 63 6f 6d | some of| the com|
|00004590| 6d 61 6e 64 73 2e 0a 58 | 20 2a 2f 0a 58 0a 58 63 |mands..X| */.X.Xc|
|000045a0| 68 61 72 20 2a 6e 65 78 | 74 5f 66 69 65 6c 64 28 |har *nex|t_field(|
|000045b0| 73 74 72 29 0a 58 0a 58 | 72 65 67 69 73 74 65 72 |str).X.X|register|
|000045c0| 20 63 68 61 72 20 2a 73 | 74 72 3b 0a 58 0a 58 7b | char *s|tr;.X.X{|
|000045d0| 0a 58 20 20 20 20 69 66 | 20 28 28 73 74 72 20 3d |.X if| ((str =|
|000045e0| 20 73 74 72 63 68 72 28 | 73 74 72 2c 20 27 20 27 | strchr(|str, ' '|
|000045f0| 29 29 20 3d 3d 20 4e 55 | 4c 4c 29 0a 58 20 20 20 |)) == NU|LL).X |
|00004600| 20 7b 0a 58 09 72 65 74 | 75 72 6e 28 4e 55 4c 4c | {.X.ret|urn(NULL|
|00004610| 29 3b 0a 58 20 20 20 20 | 7d 0a 58 20 20 20 20 2a |);.X |}.X *|
|00004620| 73 74 72 20 3d 20 27 5c | 30 27 3b 0a 58 20 20 20 |str = '\|0';.X |
|00004630| 20 77 68 69 6c 65 20 28 | 2a 2b 2b 73 74 72 20 3d | while (|*++str =|
|00004640| 3d 20 27 20 27 29 20 2f | 2a 20 6c 6f 6f 70 20 2a |= ' ') /|* loop *|
|00004650| 2f 3b 0a 58 20 20 20 20 | 72 65 74 75 72 6e 28 73 |/;.X |return(s|
|00004660| 74 72 29 3b 0a 58 7d 0a | 58 0a 58 73 63 61 6e 69 |tr);.X}.|X.Xscani|
|00004670| 6e 74 28 73 74 72 2c 20 | 69 6e 74 70 29 0a 58 0a |nt(str, |intp).X.|
|00004680| 58 63 68 61 72 20 2a 73 | 74 72 3b 0a 58 69 6e 74 |Xchar *s|tr;.Xint|
|00004690| 20 20 2a 69 6e 74 70 3b | 0a 58 0a 58 7b 0a 58 20 | *intp;|.X.X{.X |
|000046a0| 20 20 20 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 | regis|ter int |
|000046b0| 76 61 6c 20 3d 20 30 3b | 0a 58 20 20 20 20 72 65 |val = 0;|.X re|
|000046c0| 67 69 73 74 65 72 20 63 | 68 61 72 20 63 68 3b 0a |gister c|har ch;.|
|000046d0| 58 0a 58 20 20 20 20 77 | 68 69 6c 65 20 28 28 63 |X.X w|hile ((c|
|000046e0| 68 20 3d 20 2a 73 74 72 | 2b 2b 29 20 21 3d 20 27 |h = *str|++) != '|
|000046f0| 5c 30 27 29 0a 58 20 20 | 20 20 7b 0a 58 09 69 66 |\0').X | {.X.if|
|00004700| 20 28 69 73 64 69 67 69 | 74 28 63 68 29 29 0a 58 | (isdigi|t(ch)).X|
|00004710| 09 7b 0a 58 09 20 20 20 | 20 76 61 6c 20 3d 20 76 |.{.X. | val = v|
|00004720| 61 6c 20 2a 20 31 30 20 | 2b 20 28 63 68 20 2d 20 |al * 10 |+ (ch - |
|00004730| 27 30 27 29 3b 0a 58 09 | 7d 0a 58 09 65 6c 73 65 |'0');.X.|}.X.else|
|00004740| 20 69 66 20 28 69 73 73 | 70 61 63 65 28 63 68 29 | if (iss|pace(ch)|
|00004750| 29 0a 58 09 7b 0a 58 09 | 20 20 20 20 62 72 65 61 |).X.{.X.| brea|
|00004760| 6b 3b 0a 58 09 7d 0a 58 | 09 65 6c 73 65 0a 58 09 |k;.X.}.X|.else.X.|
|00004770| 7b 0a 58 09 20 20 20 20 | 72 65 74 75 72 6e 28 2d |{.X. |return(-|
|00004780| 31 29 3b 0a 58 09 7d 0a | 58 20 20 20 20 7d 0a 58 |1);.X.}.|X }.X|
|00004790| 20 20 20 20 2a 69 6e 74 | 70 20 3d 20 76 61 6c 3b | *int|p = val;|
|000047a0| 0a 58 20 20 20 20 72 65 | 74 75 72 6e 28 30 29 3b |.X re|turn(0);|
|000047b0| 0a 58 7d 0a 58 0a 58 2f | 2a 0a 58 20 2a 20 20 53 |.X}.X.X/|*.X * S|
|000047c0| 6f 6d 65 20 6f 66 20 74 | 68 65 20 63 6f 6d 6d 61 |ome of t|he comma|
|000047d0| 6e 64 73 20 6d 61 6b 65 | 20 73 79 73 74 65 6d 20 |nds make| system |
|000047e0| 63 61 6c 6c 73 20 74 68 | 61 74 20 63 6f 75 6c 64 |calls th|at could|
|000047f0| 20 67 65 6e 65 72 61 74 | 65 20 65 72 72 6f 72 73 | generat|e errors|
|00004800| 2e 0a 58 20 2a 20 20 54 | 68 65 73 65 20 65 72 72 |..X * T|hese err|
|00004810| 6f 72 73 20 61 72 65 20 | 63 6f 6c 6c 65 63 74 65 |ors are |collecte|
|00004820| 64 20 75 70 20 69 6e 20 | 61 6e 20 61 72 72 61 79 |d up in |an array|
|00004830| 20 6f 66 20 73 74 72 75 | 63 74 75 72 65 73 20 66 | of stru|ctures f|
|00004840| 6f 72 20 6c 61 74 65 72 | 0a 58 20 2a 20 20 63 6f |or later|.X * co|
|00004850| 6e 74 65 6d 70 6c 61 74 | 69 6f 6e 20 61 6e 64 20 |ntemplat|ion and |
|00004860| 64 69 73 70 6c 61 79 2e | 20 20 53 75 63 68 20 72 |display.| Such r|
|00004870| 6f 75 74 69 6e 65 73 20 | 72 65 74 75 72 6e 20 61 |outines |return a|
|00004880| 20 73 74 72 69 6e 67 20 | 63 6f 6e 74 61 69 6e 69 | string |containi|
|00004890| 6e 67 20 61 6e 0a 58 20 | 2a 20 20 65 72 72 6f 72 |ng an.X |* error|
|000048a0| 20 6d 65 73 73 61 67 65 | 2c 20 6f 72 20 4e 55 4c | message|, or NUL|
|000048b0| 4c 20 69 66 20 6e 6f 20 | 65 72 72 6f 72 73 20 6f |L if no |errors o|
|000048c0| 63 63 75 72 72 65 64 2e | 20 20 54 68 65 20 6e 65 |ccurred.| The ne|
|000048d0| 78 74 20 66 65 77 20 72 | 6f 75 74 69 6e 65 73 20 |xt few r|outines |
|000048e0| 61 72 65 0a 58 20 2a 20 | 20 66 6f 72 20 6d 61 6e |are.X * | for man|
|000048f0| 69 70 75 6c 61 74 69 6e | 67 20 61 6e 64 20 64 69 |ipulatin|g and di|
|00004900| 73 70 6c 61 79 69 6e 67 | 20 74 68 65 73 65 20 65 |splaying| these e|
|00004910| 72 72 6f 72 73 2e 20 20 | 57 65 20 6e 65 65 64 20 |rrors. |We need |
|00004920| 61 6e 20 75 70 70 65 72 | 20 6c 69 6d 69 74 20 6f |an upper| limit o|
|00004930| 6e 0a 58 20 2a 20 20 74 | 68 65 20 6e 75 6d 62 65 |n.X * t|he numbe|
|00004940| 72 20 6f 66 20 65 72 72 | 6f 72 73 2c 20 73 6f 20 |r of err|ors, so |
|00004950| 77 65 20 61 72 62 69 74 | 72 61 72 69 6c 79 20 63 |we arbit|rarily c|
|00004960| 68 6f 6f 73 65 20 32 30 | 2e 0a 58 20 2a 2f 0a 58 |hoose 20|..X */.X|
|00004970| 0a 58 23 64 65 66 69 6e | 65 20 45 52 52 4d 41 58 |.X#defin|e ERRMAX|
|00004980| 20 32 30 0a 58 0a 58 73 | 74 72 75 63 74 20 65 72 | 20.X.Xs|truct er|
|00004990| 72 73 09 09 2f 2a 20 73 | 74 72 75 63 74 75 72 65 |rs../* s|tructure|
|000049a0| 20 66 6f 72 20 61 20 73 | 79 73 74 65 6d 2d 63 61 | for a s|ystem-ca|
|000049b0| 6c 6c 20 65 72 72 6f 72 | 20 2a 2f 0a 58 7b 0a 58 |ll error| */.X{.X|
|000049c0| 20 20 20 20 69 6e 74 20 | 20 65 72 72 6e 6f 3b 09 | int | errno;.|
|000049d0| 09 2f 2a 20 76 61 6c 75 | 65 20 6f 66 20 65 72 72 |./* valu|e of err|
|000049e0| 6e 6f 20 28 74 68 61 74 | 20 69 73 2c 20 74 68 65 |no (that| is, the|
|000049f0| 20 61 63 74 75 61 6c 20 | 65 72 72 6f 72 29 20 2a | actual |error) *|
|00004a00| 2f 0a 58 20 20 20 20 63 | 68 61 72 20 2a 61 72 67 |/.X c|har *arg|
|00004a10| 3b 09 09 2f 2a 20 61 72 | 67 75 6d 65 6e 74 20 74 |;../* ar|gument t|
|00004a20| 68 61 74 20 63 61 75 73 | 65 64 20 74 68 65 20 65 |hat caus|ed the e|
|00004a30| 72 72 6f 72 20 2a 2f 0a | 58 7d 3b 0a 58 0a 58 73 |rror */.|X};.X.Xs|
|00004a40| 74 61 74 69 63 20 73 74 | 72 75 63 74 20 65 72 72 |tatic st|ruct err|
|00004a50| 73 20 65 72 72 73 5b 45 | 52 52 4d 41 58 5d 3b 0a |s errs[E|RRMAX];.|
|00004a60| 58 73 74 61 74 69 63 20 | 69 6e 74 20 65 72 72 63 |Xstatic |int errc|
|00004a70| 6e 74 3b 0a 58 73 74 61 | 74 69 63 20 63 68 61 72 |nt;.Xsta|tic char|
|00004a80| 20 2a 65 72 72 5f 74 6f | 6f 6d 61 6e 79 20 3d 20 | *err_to|omany = |
|00004a90| 22 20 74 6f 6f 20 6d 61 | 6e 79 20 65 72 72 6f 72 |" too ma|ny error|
|00004aa0| 73 20 6f 63 63 75 72 72 | 65 64 22 3b 0a 58 73 74 |s occurr|ed";.Xst|
|00004ab0| 61 74 69 63 20 63 68 61 | 72 20 2a 65 72 72 5f 6c |atic cha|r *err_l|
|00004ac0| 69 73 74 65 6d 20 3d 20 | 0a 58 09 22 20 4d 61 6e |istem = |.X." Man|
|00004ad0| 79 20 65 72 72 6f 72 73 | 20 6f 63 63 75 72 72 65 |y errors| occurre|
|00004ae0| 64 2e 20 20 50 72 65 73 | 73 20 60 65 27 20 74 6f |d. Pres|s `e' to|
|00004af0| 20 64 69 73 70 6c 61 79 | 20 74 68 65 20 6c 69 73 | display| the lis|
|00004b00| 74 20 6f 66 20 65 72 72 | 6f 72 73 2e 22 3b 0a 58 |t of err|ors.";.X|
|00004b10| 0a 58 2f 2a 20 54 68 65 | 73 65 20 6d 61 63 72 6f |.X/* The|se macro|
|00004b20| 73 20 67 65 74 20 75 73 | 65 64 20 74 6f 20 72 65 |s get us|ed to re|
|00004b30| 73 65 74 20 61 6e 64 20 | 6c 6f 67 20 74 68 65 20 |set and |log the |
|00004b40| 65 72 72 6f 72 73 20 2a | 2f 0a 58 23 64 65 66 69 |errors *|/.X#defi|
|00004b50| 6e 65 20 45 52 52 5f 52 | 45 53 45 54 20 20 20 65 |ne ERR_R|ESET e|
|00004b60| 72 72 63 6e 74 20 3d 20 | 30 0a 58 23 64 65 66 69 |rrcnt = |0.X#defi|
|00004b70| 6e 65 20 45 52 52 4f 52 | 28 70 2c 20 65 29 20 69 |ne ERROR|(p, e) i|
|00004b80| 66 20 28 65 72 72 63 6e | 74 20 3e 3d 20 45 52 52 |f (errcn|t >= ERR|
|00004b90| 4d 41 58 29 20 5c 0a 58 | 09 09 20 20 20 20 7b 20 |MAX) \.X|.. { |
|00004ba0| 5c 0a 58 09 09 09 72 65 | 74 75 72 6e 28 65 72 72 |\.X...re|turn(err|
|00004bb0| 5f 74 6f 6f 6d 61 6e 79 | 29 3b 20 5c 0a 58 09 09 |_toomany|); \.X..|
|00004bc0| 20 20 20 20 7d 20 5c 0a | 58 09 09 20 20 20 20 65 | } \.|X.. e|
|00004bd0| 6c 73 65 20 5c 0a 58 09 | 09 20 20 20 20 7b 20 5c |lse \.X.|. { \|
|00004be0| 0a 58 09 09 09 65 72 72 | 73 5b 65 72 72 63 6e 74 |.X...err|s[errcnt|
|00004bf0| 5d 2e 61 72 67 20 3d 20 | 28 70 29 3b 20 5c 0a 58 |].arg = |(p); \.X|
|00004c00| 09 09 09 65 72 72 73 5b | 65 72 72 63 6e 74 2b 2b |...errs[|errcnt++|
|00004c10| 5d 2e 65 72 72 6e 6f 20 | 3d 20 28 65 29 3b 20 5c |].errno |= (e); \|
|00004c20| 0a 58 09 09 20 20 20 20 | 7d 0a 58 0a 58 2f 2a 0a |.X.. |}.X.X/*.|
|00004c30| 58 20 2a 20 20 65 72 72 | 5f 73 74 72 69 6e 67 28 |X * err|_string(|
|00004c40| 29 20 2d 20 72 65 74 75 | 72 6e 20 61 6e 20 61 70 |) - retu|rn an ap|
|00004c50| 70 72 6f 70 72 69 61 74 | 65 20 65 72 72 6f 72 20 |propriat|e error |
|00004c60| 73 74 72 69 6e 67 2e 20 | 20 54 68 69 73 20 69 73 |string. | This is|
|00004c70| 20 77 68 61 74 20 74 68 | 65 0a 58 20 2a 09 63 6f | what th|e.X *.co|
|00004c80| 6d 6d 61 6e 64 20 77 69 | 6c 6c 20 72 65 74 75 72 |mmand wi|ll retur|
|00004c90| 6e 20 66 6f 72 20 64 69 | 73 70 6c 61 79 69 6e 67 |n for di|splaying|
|00004ca0| 2e 20 20 49 66 20 6e 6f | 20 65 72 72 6f 72 73 20 |. If no| errors |
|00004cb0| 77 65 72 65 20 6c 6f 67 | 67 65 64 2c 20 74 68 65 |were log|ged, the|
|00004cc0| 6e 0a 58 20 2a 09 72 65 | 74 75 72 6e 20 4e 55 4c |n.X *.re|turn NUL|
|00004cd0| 4c 2e 20 20 54 68 65 20 | 6d 61 78 69 6d 75 6d 20 |L. The |maximum |
|00004ce0| 6c 65 6e 67 74 68 20 6f | 66 20 74 68 65 20 65 72 |length o|f the er|
|00004cf0| 72 6f 72 20 73 74 72 69 | 6e 67 20 69 73 20 64 65 |ror stri|ng is de|
|00004d00| 66 69 6e 65 64 20 62 79 | 0a 58 20 2a 09 22 53 54 |fined by|.X *."ST|
|00004d10| 52 4d 41 58 22 2e 0a 58 | 20 2a 2f 0a 58 0a 58 23 |RMAX"..X| */.X.X#|
|00004d20| 64 65 66 69 6e 65 20 53 | 54 52 4d 41 58 20 38 30 |define S|TRMAX 80|
|00004d30| 0a 58 0a 58 63 68 61 72 | 20 2a 65 72 72 5f 73 74 |.X.Xchar| *err_st|
|00004d40| 72 69 6e 67 28 29 0a 58 | 0a 58 7b 0a 58 20 20 20 |ring().X|.X{.X |
|00004d50| 20 72 65 67 69 73 74 65 | 72 20 73 74 72 75 63 74 | registe|r struct|
|00004d60| 20 65 72 72 73 20 2a 65 | 72 72 70 3b 0a 58 20 20 | errs *e|rrp;.X |
|00004d70| 20 20 72 65 67 69 73 74 | 65 72 20 69 6e 74 20 20 | regist|er int |
|00004d80| 63 6e 74 20 3d 20 30 3b | 0a 58 20 20 20 20 72 65 |cnt = 0;|.X re|
|00004d90| 67 69 73 74 65 72 20 69 | 6e 74 20 20 66 69 72 73 |gister i|nt firs|
|00004da0| 74 20 3d 20 59 65 73 3b | 0a 58 20 20 20 20 72 65 |t = Yes;|.X re|
|00004db0| 67 69 73 74 65 72 20 69 | 6e 74 20 20 63 75 72 72 |gister i|nt curr|
|00004dc0| 65 72 72 20 3d 20 2d 31 | 3b 0a 58 20 20 20 20 69 |err = -1|;.X i|
|00004dd0| 6e 74 20 73 74 72 69 6e | 67 6c 65 6e 3b 09 09 2f |nt strin|glen;../|
|00004de0| 2a 20 63 68 61 72 61 63 | 74 65 72 73 20 73 74 69 |* charac|ters sti|
|00004df0| 6c 6c 20 61 76 61 69 6c | 61 62 6c 65 20 69 6e 20 |ll avail|able in |
|00004e00| 22 73 74 72 69 6e 67 22 | 20 2a 2f 0a 58 20 20 20 |"string"| */.X |
|00004e10| 20 73 74 61 74 69 63 20 | 63 68 61 72 20 73 74 72 | static |char str|
|00004e20| 69 6e 67 5b 53 54 52 4d | 41 58 5d 3b 0a 58 0a 58 |ing[STRM|AX];.X.X|
|00004e30| 20 20 20 20 2f 2a 20 69 | 66 20 74 68 65 72 65 20 | /* i|f there |
|00004e40| 61 72 65 20 6e 6f 20 65 | 72 72 6f 72 73 2c 20 72 |are no e|rrors, r|
|00004e50| 65 74 75 72 6e 20 4e 55 | 4c 4c 20 2a 2f 0a 58 20 |eturn NU|LL */.X |
|00004e60| 20 20 20 69 66 20 28 65 | 72 72 63 6e 74 20 3d 3d | if (e|rrcnt ==|
|00004e70| 20 30 29 0a 58 20 20 20 | 20 7b 0a 58 09 72 65 74 | 0).X | {.X.ret|
|00004e80| 75 72 6e 28 4e 55 4c 4c | 29 3b 0a 58 20 20 20 20 |urn(NULL|);.X |
|00004e90| 7d 0a 58 0a 58 20 20 20 | 20 2f 2a 20 73 6f 72 74 |}.X.X | /* sort|
|00004ea0| 20 74 68 65 20 65 72 72 | 6f 72 73 20 2a 2f 0a 58 | the err|ors */.X|
|00004eb0| 20 20 20 20 71 73 6f 72 | 74 28 28 63 68 61 72 20 | qsor|t((char |
|00004ec0| 2a 29 65 72 72 73 2c 20 | 65 72 72 63 6e 74 2c 20 |*)errs, |errcnt, |
|00004ed0| 73 69 7a 65 6f 66 28 73 | 74 72 75 63 74 20 65 72 |sizeof(s|truct er|
|00004ee0| 72 73 29 2c 20 65 72 72 | 5f 63 6f 6d 70 61 72 29 |rs), err|_compar)|
|00004ef0| 3b 0a 58 0a 58 20 20 20 | 20 2f 2a 20 6e 65 65 64 |;.X.X | /* need|
|00004f00| 20 61 20 73 70 61 63 65 | 20 61 74 20 74 68 65 20 | a space| at the |
|00004f10| 66 72 6f 6e 74 20 6f 66 | 20 74 68 65 20 65 72 72 |front of| the err|
|00004f20| 6f 72 20 73 74 72 69 6e | 67 20 2a 2f 0a 58 20 20 |or strin|g */.X |
|00004f30| 20 20 73 74 72 69 6e 67 | 5b 30 5d 20 3d 20 27 20 | string|[0] = ' |
|00004f40| 27 3b 0a 58 20 20 20 20 | 73 74 72 69 6e 67 5b 31 |';.X |string[1|
|00004f50| 5d 20 3d 20 27 5c 30 27 | 3b 0a 58 20 20 20 20 73 |] = '\0'|;.X s|
|00004f60| 74 72 69 6e 67 6c 65 6e | 20 3d 20 53 54 52 4d 41 |tringlen| = STRMA|
|00004f70| 58 20 2d 20 32 3b 0a 58 | 0a 58 20 20 20 20 2f 2a |X - 2;.X|.X /*|
|00004f80| 20 6c 6f 6f 70 20 74 68 | 72 75 20 74 68 65 20 73 | loop th|ru the s|
|00004f90| 6f 72 74 65 64 20 6c 69 | 73 74 2c 20 62 75 69 6c |orted li|st, buil|
|00004fa0| 64 69 6e 67 20 61 6e 20 | 65 72 72 6f 72 20 73 74 |ding an |error st|
|00004fb0| 72 69 6e 67 20 2a 2f 0a | 58 20 20 20 20 77 68 69 |ring */.|X whi|
|00004fc0| 6c 65 20 28 63 6e 74 20 | 3c 20 65 72 72 63 6e 74 |le (cnt |< errcnt|
|00004fd0| 29 0a 58 20 20 20 20 7b | 0a 58 09 65 72 72 70 20 |).X {|.X.errp |
|00004fe0| 3d 20 26 28 65 72 72 73 | 5b 63 6e 74 2b 2b 5d 29 |= &(errs|[cnt++])|
|00004ff0| 3b 0a 58 09 69 66 20 28 | 65 72 72 70 2d 3e 65 72 |;.X.if (|errp->er|
|00005000| 72 6e 6f 20 21 3d 20 63 | 75 72 72 65 72 72 29 0a |rno != c|urrerr).|
|00005010| 58 09 7b 0a 58 09 20 20 | 20 20 69 66 20 28 63 75 |X.{.X. | if (cu|
|00005020| 72 72 65 72 72 20 21 3d | 20 2d 31 29 0a 58 09 20 |rrerr !=| -1).X. |
|00005030| 20 20 20 7b 0a 58 09 09 | 69 66 20 28 28 73 74 72 | {.X..|if ((str|
|00005040| 69 6e 67 6c 65 6e 20 3d | 20 73 74 72 5f 61 64 64 |inglen =| str_add|
|00005050| 65 72 72 28 73 74 72 69 | 6e 67 2c 20 73 74 72 69 |err(stri|ng, stri|
|00005060| 6e 67 6c 65 6e 2c 20 63 | 75 72 72 65 72 72 29 29 |nglen, c|urrerr))|
|00005070| 20 3c 20 32 29 0a 58 09 | 09 7b 0a 58 09 09 20 20 | < 2).X.|.{.X.. |
|00005080| 20 20 72 65 74 75 72 6e | 28 65 72 72 5f 6c 69 73 | return|(err_lis|
|00005090| 74 65 6d 29 3b 0a 58 09 | 09 7d 0a 58 09 09 28 76 |tem);.X.|.}.X..(v|
|000050a0| 6f 69 64 29 20 73 74 72 | 63 61 74 28 73 74 72 69 |oid) str|cat(stri|
|000050b0| 6e 67 2c 20 22 3b 20 22 | 29 3b 09 20 20 2f 2a 20 |ng, "; "|);. /* |
|000050c0| 77 65 20 6b 6e 6f 77 20 | 74 68 65 72 65 27 73 20 |we know |there's |
|000050d0| 6d 6f 72 65 20 2a 2f 0a | 58 09 20 20 20 20 7d 0a |more */.|X. }.|
|000050e0| 58 09 20 20 20 20 63 75 | 72 72 65 72 72 20 3d 20 |X. cu|rrerr = |
|000050f0| 65 72 72 70 2d 3e 65 72 | 72 6e 6f 3b 0a 58 09 20 |errp->er|rno;.X. |
|00005100| 20 20 20 66 69 72 73 74 | 20 3d 20 59 65 73 3b 0a | first| = Yes;.|
|00005110| 58 09 7d 0a 58 09 69 66 | 20 28 28 73 74 72 69 6e |X.}.X.if| ((strin|
|00005120| 67 6c 65 6e 20 3d 20 73 | 74 72 5f 61 64 64 61 72 |glen = s|tr_addar|
|00005130| 67 28 73 74 72 69 6e 67 | 2c 20 73 74 72 69 6e 67 |g(string|, string|
|00005140| 6c 65 6e 2c 20 65 72 72 | 70 2d 3e 61 72 67 2c 20 |len, err|p->arg, |
|00005150| 66 69 72 73 74 29 29 20 | 3d 3d 30 29 0a 58 09 7b |first)) |==0).X.{|
|00005160| 0a 58 09 20 20 20 20 72 | 65 74 75 72 6e 28 65 72 |.X. r|eturn(er|
|00005170| 72 5f 6c 69 73 74 65 6d | 29 3b 0a 58 09 7d 0a 58 |r_listem|);.X.}.X|
|00005180| 09 66 69 72 73 74 20 3d | 20 4e 6f 3b 0a 58 20 20 |.first =| No;.X |
|00005190| 20 20 7d 0a 58 0a 58 20 | 20 20 20 2f 2a 20 61 64 | }.X.X | /* ad|
|000051a0| 64 20 66 69 6e 61 6c 20 | 6d 65 73 73 61 67 65 20 |d final |message |
|000051b0| 2a 2f 0a 58 20 20 20 20 | 73 74 72 69 6e 67 6c 65 |*/.X |stringle|
|000051c0| 6e 20 3d 20 73 74 72 5f | 61 64 64 65 72 72 28 73 |n = str_|adderr(s|
|000051d0| 74 72 69 6e 67 2c 20 73 | 74 72 69 6e 67 6c 65 6e |tring, s|tringlen|
|000051e0| 2c 20 63 75 72 72 65 72 | 72 29 3b 0a 58 0a 58 20 |, currer|r);.X.X |
|000051f0| 20 20 20 2f 2a 20 72 65 | 74 75 72 6e 20 74 68 65 | /* re|turn the|
|00005200| 20 65 72 72 6f 72 20 73 | 74 72 69 6e 67 20 2a 2f | error s|tring */|
|00005210| 0a 58 20 20 20 20 72 65 | 74 75 72 6e 28 73 74 72 |.X re|turn(str|
|00005220| 69 6e 67 6c 65 6e 20 3d | 3d 20 30 20 3f 20 65 72 |inglen =|= 0 ? er|
|00005230| 72 5f 6c 69 73 74 65 6d | 20 3a 20 73 74 72 69 6e |r_listem| : strin|
|00005240| 67 29 3b 0a 58 7d 0a 58 | 0a 58 2f 2a 0a 58 20 2a |g);.X}.X|.X/*.X *|
|00005250| 20 20 73 74 72 5f 61 64 | 64 65 72 72 28 73 74 72 | str_ad|derr(str|
|00005260| 2c 20 6c 65 6e 2c 20 65 | 72 72 29 20 2d 20 61 64 |, len, e|rr) - ad|
|00005270| 64 20 61 6e 20 65 78 70 | 6c 61 6e 61 74 69 6f 6e |d an exp|lanation|
|00005280| 20 6f 66 20 65 72 72 6f | 72 20 22 65 72 72 22 20 | of erro|r "err" |
|00005290| 74 6f 0a 58 20 2a 09 74 | 68 65 20 73 74 72 69 6e |to.X *.t|he strin|
|000052a0| 67 20 22 73 74 72 22 2e | 0a 58 20 2a 2f 0a 58 0a |g "str".|.X */.X.|
|000052b0| 58 73 74 72 5f 61 64 64 | 65 72 72 28 73 74 72 2c |Xstr_add|err(str,|
|000052c0| 20 6c 65 6e 2c 20 65 72 | 72 29 0a 58 0a 58 63 68 | len, er|r).X.Xch|
|000052d0| 61 72 20 2a 73 74 72 3b | 0a 58 69 6e 74 20 6c 65 |ar *str;|.Xint le|
|000052e0| 6e 3b 0a 58 69 6e 74 20 | 65 72 72 3b 0a 58 0a 58 |n;.Xint |err;.X.X|
|000052f0| 7b 0a 58 20 20 20 20 72 | 65 67 69 73 74 65 72 20 |{.X r|egister |
|00005300| 63 68 61 72 20 2a 6d 73 | 67 3b 0a 58 20 20 20 20 |char *ms|g;.X |
|00005310| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 20 6d 73 |register| int ms|
|00005320| 67 6c 65 6e 3b 0a 58 0a | 58 20 20 20 20 6d 73 67 |glen;.X.|X msg|
|00005330| 20 3d 20 65 72 72 20 3d | 3d 20 30 20 3f 20 22 4e | = err =|= 0 ? "N|
|00005340| 6f 74 20 61 20 6e 75 6d | 62 65 72 22 20 3a 20 65 |ot a num|ber" : e|
|00005350| 72 72 6d 73 67 28 65 72 | 72 29 3b 0a 58 20 20 20 |rrmsg(er|r);.X |
|00005360| 20 6d 73 67 6c 65 6e 20 | 3d 20 73 74 72 6c 65 6e | msglen |= strlen|
|00005370| 28 6d 73 67 29 20 2b 20 | 32 3b 0a 58 20 20 20 20 |(msg) + |2;.X |
|00005380| 69 66 20 28 6c 65 6e 20 | 3c 3d 20 6d 73 67 6c 65 |if (len |<= msgle|
|00005390| 6e 29 0a 58 20 20 20 20 | 7b 0a 58 09 72 65 74 75 |n).X |{.X.retu|
|000053a0| 72 6e 28 30 29 3b 0a 58 | 20 20 20 20 7d 0a 58 20 |rn(0);.X| }.X |
|000053b0| 20 20 20 28 76 6f 69 64 | 29 20 73 74 72 63 61 74 | (void|) strcat|
|000053c0| 28 73 74 72 2c 20 22 3a | 20 22 29 3b 0a 58 20 20 |(str, ":| ");.X |
|000053d0| 20 20 28 76 6f 69 64 29 | 20 73 74 72 63 61 74 28 | (void)| strcat(|
|000053e0| 73 74 72 2c 20 6d 73 67 | 29 3b 0a 58 20 20 20 20 |str, msg|);.X |
|000053f0| 72 65 74 75 72 6e 28 6c | 65 6e 20 2d 20 6d 73 67 |return(l|en - msg|
|00005400| 6c 65 6e 29 3b 0a 58 7d | 0a 58 0a 58 2f 2a 0a 58 |len);.X}|.X.X/*.X|
|00005410| 20 2a 20 20 73 74 72 5f | 61 64 64 61 72 67 28 73 | * str_|addarg(s|
|00005420| 74 72 2c 20 6c 65 6e 2c | 20 61 72 67 2c 20 66 69 |tr, len,| arg, fi|
|00005430| 72 73 74 29 20 2d 20 61 | 64 64 20 74 68 65 20 73 |rst) - a|dd the s|
|00005440| 74 72 69 6e 67 20 61 72 | 67 75 6d 65 6e 74 20 22 |tring ar|gument "|
|00005450| 61 72 67 22 20 74 6f 0a | 58 20 2a 09 74 68 65 20 |arg" to.|X *.the |
|00005460| 73 74 72 69 6e 67 20 22 | 73 74 72 22 2e 20 20 54 |string "|str". T|
|00005470| 68 69 73 20 69 73 20 74 | 68 65 20 66 69 72 73 74 |his is t|he first|
|00005480| 20 69 6e 20 74 68 65 20 | 67 72 6f 75 70 20 77 68 | in the |group wh|
|00005490| 65 6e 20 22 66 69 72 73 | 74 22 0a 58 20 2a 09 69 |en "firs|t".X *.i|
|000054a0| 73 20 73 65 74 20 28 69 | 6e 64 69 63 61 74 69 6e |s set (i|ndicatin|
|000054b0| 67 20 74 68 61 74 20 61 | 20 63 6f 6d 6d 61 20 73 |g that a| comma s|
|000054c0| 68 6f 75 6c 64 20 4e 4f | 54 20 62 65 20 61 64 64 |hould NO|T be add|
|000054d0| 65 64 20 74 6f 20 74 68 | 65 20 66 72 6f 6e 74 29 |ed to th|e front)|
|000054e0| 2e 0a 58 20 2a 2f 0a 58 | 0a 58 73 74 72 5f 61 64 |..X */.X|.Xstr_ad|
|000054f0| 64 61 72 67 28 73 74 72 | 2c 20 6c 65 6e 2c 20 61 |darg(str|, len, a|
|00005500| 72 67 2c 20 66 69 72 73 | 74 29 0a 58 0a 58 63 68 |rg, firs|t).X.Xch|
|00005510| 61 72 20 2a 73 74 72 3b | 0a 58 69 6e 74 20 20 6c |ar *str;|.Xint l|
|00005520| 65 6e 3b 0a 58 63 68 61 | 72 20 2a 61 72 67 3b 0a |en;.Xcha|r *arg;.|
|00005530| 58 69 6e 74 20 20 66 69 | 72 73 74 3b 0a 58 0a 58 |Xint fi|rst;.X.X|
|00005540| 7b 0a 58 20 20 20 20 72 | 65 67 69 73 74 65 72 20 |{.X r|egister |
|00005550| 69 6e 74 20 61 72 67 6c | 65 6e 3b 0a 58 0a 58 20 |int argl|en;.X.X |
|00005560| 20 20 20 61 72 67 6c 65 | 6e 20 3d 20 73 74 72 6c | argle|n = strl|
|00005570| 65 6e 28 61 72 67 29 3b | 0a 58 20 20 20 20 69 66 |en(arg);|.X if|
|00005580| 20 28 21 66 69 72 73 74 | 29 0a 58 20 20 20 20 7b | (!first|).X {|
|00005590| 0a 58 09 61 72 67 6c 65 | 6e 20 2b 3d 20 32 3b 0a |.X.argle|n += 2;.|
|000055a0| 58 20 20 20 20 7d 0a 58 | 20 20 20 20 69 66 20 28 |X }.X| if (|
|000055b0| 6c 65 6e 20 3c 3d 20 61 | 72 67 6c 65 6e 29 0a 58 |len <= a|rglen).X|
|000055c0| 20 20 20 20 7b 0a 58 09 | 72 65 74 75 72 6e 28 30 | {.X.|return(0|
|000055d0| 29 3b 0a 58 20 20 20 20 | 7d 0a 58 20 20 20 20 69 |);.X |}.X i|
|000055e0| 66 20 28 21 66 69 72 73 | 74 29 0a 58 20 20 20 20 |f (!firs|t).X |
|000055f0| 7b 0a 58 09 28 76 6f 69 | 64 29 20 73 74 72 63 61 |{.X.(voi|d) strca|
|00005600| 74 28 73 74 72 2c 20 22 | 2c 20 22 29 3b 0a 58 20 |t(str, "|, ");.X |
|00005610| 20 20 20 7d 0a 58 20 20 | 20 20 28 76 6f 69 64 29 | }.X | (void)|
|00005620| 20 73 74 72 63 61 74 28 | 73 74 72 2c 20 61 72 67 | strcat(|str, arg|
|00005630| 29 3b 0a 58 20 20 20 20 | 72 65 74 75 72 6e 28 6c |);.X |return(l|
|00005640| 65 6e 20 2d 20 61 72 67 | 6c 65 6e 29 3b 0a 58 7d |en - arg|len);.X}|
|00005650| 0a 58 0a 58 2f 2a 0a 58 | 20 2a 20 20 65 72 72 5f |.X.X/*.X| * err_|
|00005660| 63 6f 6d 70 61 72 28 70 | 31 2c 20 70 32 29 20 2d |compar(p|1, p2) -|
|00005670| 20 63 6f 6d 70 61 72 69 | 73 6f 6e 20 72 6f 75 74 | compari|son rout|
|00005680| 69 6e 65 20 75 73 65 64 | 20 62 79 20 22 71 73 6f |ine used| by "qso|
|00005690| 72 74 22 0a 58 20 2a 09 | 66 6f 72 20 73 6f 72 74 |rt".X *.|for sort|
|000056a0| 69 6e 67 20 65 72 72 6f | 72 73 2e 0a 58 20 2a 2f |ing erro|rs..X */|
|000056b0| 0a 58 0a 58 65 72 72 5f | 63 6f 6d 70 61 72 28 70 |.X.Xerr_|compar(p|
|000056c0| 31 2c 20 70 32 29 0a 58 | 0a 58 72 65 67 69 73 74 |1, p2).X|.Xregist|
|000056d0| 65 72 20 73 74 72 75 63 | 74 20 65 72 72 73 20 2a |er struc|t errs *|
|000056e0| 70 31 2c 20 2a 70 32 3b | 0a 58 0a 58 7b 0a 58 20 |p1, *p2;|.X.X{.X |
|000056f0| 20 20 20 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 | regis|ter int |
|00005700| 72 65 73 75 6c 74 3b 0a | 58 0a 58 20 20 20 20 69 |result;.|X.X i|
|00005710| 66 20 28 28 72 65 73 75 | 6c 74 20 3d 20 70 31 2d |f ((resu|lt = p1-|
|00005720| 3e 65 72 72 6e 6f 20 2d | 20 70 32 2d 3e 65 72 72 |>errno -| p2->err|
|00005730| 6e 6f 29 20 3d 3d 20 30 | 29 0a 58 20 20 20 20 7b |no) == 0|).X {|
|00005740| 0a 58 09 72 65 74 75 72 | 6e 28 73 74 72 63 6d 70 |.X.retur|n(strcmp|
|00005750| 28 70 31 2d 3e 61 72 67 | 2c 20 70 32 2d 3e 61 72 |(p1->arg|, p2->ar|
|00005760| 67 29 29 3b 0a 58 20 20 | 20 20 7d 0a 58 20 20 20 |g));.X | }.X |
|00005770| 20 72 65 74 75 72 6e 28 | 72 65 73 75 6c 74 29 3b | return(|result);|
|00005780| 0a 58 7d 0a 58 0a 58 2f | 2a 0a 58 20 2a 20 20 65 |.X}.X.X/|*.X * e|
|00005790| 72 72 6f 72 5f 63 6f 75 | 6e 74 28 29 20 2d 20 72 |rror_cou|nt() - r|
|000057a0| 65 74 75 72 6e 20 74 68 | 65 20 6e 75 6d 62 65 72 |eturn th|e number|
|000057b0| 20 6f 66 20 65 72 72 6f | 72 73 20 63 75 72 72 65 | of erro|rs curre|
|000057c0| 6e 74 6c 79 20 6c 6f 67 | 67 65 64 2e 0a 58 20 2a |ntly log|ged..X *|
|000057d0| 2f 0a 58 0a 58 65 72 72 | 6f 72 5f 63 6f 75 6e 74 |/.X.Xerr|or_count|
|000057e0| 28 29 0a 58 0a 58 7b 0a | 58 20 20 20 20 72 65 74 |().X.X{.|X ret|
|000057f0| 75 72 6e 28 65 72 72 63 | 6e 74 29 3b 0a 58 7d 0a |urn(errc|nt);.X}.|
|00005800| 58 0a 58 2f 2a 0a 58 20 | 2a 20 20 73 68 6f 77 5f |X.X/*.X |* show_|
|00005810| 65 72 72 6f 72 73 28 29 | 20 2d 20 64 69 73 70 6c |errors()| - displ|
|00005820| 61 79 20 6f 6e 20 73 74 | 64 6f 75 74 20 74 68 65 |ay on st|dout the|
|00005830| 20 63 75 72 72 65 6e 74 | 20 6c 6f 67 20 6f 66 20 | current| log of |
|00005840| 65 72 72 6f 72 73 2e 0a | 58 20 2a 2f 0a 58 0a 58 |errors..|X */.X.X|
|00005850| 73 68 6f 77 5f 65 72 72 | 6f 72 73 28 29 0a 58 0a |show_err|ors().X.|
|00005860| 58 7b 0a 58 20 20 20 20 | 72 65 67 69 73 74 65 72 |X{.X |register|
|00005870| 20 69 6e 74 20 63 6e 74 | 20 3d 20 30 3b 0a 58 20 | int cnt| = 0;.X |
|00005880| 20 20 20 72 65 67 69 73 | 74 65 72 20 73 74 72 75 | regis|ter stru|
|00005890| 63 74 20 65 72 72 73 20 | 2a 65 72 72 70 20 3d 20 |ct errs |*errp = |
|000058a0| 65 72 72 73 3b 0a 58 0a | 58 20 20 20 20 70 72 69 |errs;.X.|X pri|
|000058b0| 6e 74 66 28 22 25 64 20 | 65 72 72 6f 72 25 73 3a |ntf("%d |error%s:|
|000058c0| 5c 6e 5c 6e 22 2c 20 65 | 72 72 63 6e 74 2c 20 65 |\n\n", e|rrcnt, e|
|000058d0| 72 72 63 6e 74 20 3d 3d | 20 31 20 3f 20 22 22 20 |rrcnt ==| 1 ? "" |
|000058e0| 3a 20 22 73 22 29 3b 0a | 58 20 20 20 20 77 68 69 |: "s");.|X whi|
|000058f0| 6c 65 20 28 63 6e 74 2b | 2b 20 3c 20 65 72 72 63 |le (cnt+|+ < errc|
|00005900| 6e 74 29 0a 58 20 20 20 | 20 7b 0a 58 09 70 72 69 |nt).X | {.X.pri|
|00005910| 6e 74 66 28 22 25 35 73 | 3a 20 25 73 5c 6e 22 2c |ntf("%5s|: %s\n",|
|00005920| 20 65 72 72 70 2d 3e 61 | 72 67 2c 0a 58 09 20 20 | errp->a|rg,.X. |
|00005930| 20 20 65 72 72 70 2d 3e | 65 72 72 6e 6f 20 3d 3d | errp->|errno ==|
|00005940| 20 30 20 3f 20 22 4e 6f | 74 20 61 20 6e 75 6d 62 | 0 ? "No|t a numb|
|00005950| 65 72 22 20 3a 20 65 72 | 72 6d 73 67 28 65 72 72 |er" : er|rmsg(err|
|00005960| 70 2d 3e 65 72 72 6e 6f | 29 29 3b 0a 58 09 65 72 |p->errno|));.X.er|
|00005970| 72 70 2b 2b 3b 0a 58 20 | 20 20 20 7d 0a 58 7d 0a |rp++;.X | }.X}.|
|00005980| 58 0a 58 2f 2a 0a 58 20 | 2a 20 20 6b 69 6c 6c 5f |X.X/*.X |* kill_|
|00005990| 70 72 6f 63 73 28 73 74 | 72 29 20 2d 20 73 65 6e |procs(st|r) - sen|
|000059a0| 64 20 73 69 67 6e 61 6c | 73 20 74 6f 20 70 72 6f |d signal|s to pro|
|000059b0| 63 65 73 73 65 73 2c 20 | 6d 75 63 68 20 6c 69 6b |cesses, |much lik|
|000059c0| 65 20 74 68 65 20 22 6b | 69 6c 6c 22 0a 58 20 2a |e the "k|ill".X *|
|000059d0| 09 09 63 6f 6d 6d 61 6e | 64 20 64 6f 65 73 3b 20 |..comman|d does; |
|000059e0| 69 6e 76 6f 6b 65 64 20 | 69 6e 20 72 65 73 70 6f |invoked |in respo|
|000059f0| 6e 73 65 20 74 6f 20 27 | 6b 27 2e 0a 58 20 2a 2f |nse to '|k'..X */|
|00005a00| 0a 58 0a 58 63 68 61 72 | 20 2a 6b 69 6c 6c 5f 70 |.X.Xchar| *kill_p|
|00005a10| 72 6f 63 73 28 73 74 72 | 29 0a 58 0a 58 63 68 61 |rocs(str|).X.Xcha|
|00005a20| 72 20 2a 73 74 72 3b 0a | 58 0a 58 7b 0a 58 20 20 |r *str;.|X.X{.X |
|00005a30| 20 20 72 65 67 69 73 74 | 65 72 20 63 68 61 72 20 | regist|er char |
|00005a40| 2a 6e 70 74 72 3b 0a 58 | 20 20 20 20 69 6e 74 20 |*nptr;.X| int |
|00005a50| 73 69 67 6e 75 6d 20 3d | 20 53 49 47 54 45 52 4d |signum =| SIGTERM|
|00005a60| 3b 09 2f 2a 20 64 65 66 | 61 75 6c 74 20 2a 2f 0a |;./* def|ault */.|
|00005a70| 58 20 20 20 20 69 6e 74 | 20 70 72 6f 63 6e 75 6d |X int| procnum|
|00005a80| 3b 0a 58 20 20 20 20 73 | 74 72 75 63 74 20 73 69 |;.X s|truct si|
|00005a90| 67 64 65 73 63 20 2a 73 | 69 67 70 3b 0a 58 20 20 |gdesc *s|igp;.X |
|00005aa0| 20 20 69 6e 74 20 75 69 | 64 3b 0a 58 0a 58 20 20 | int ui|d;.X.X |
|00005ab0| 20 20 2f 2a 20 72 65 73 | 65 74 20 65 72 72 6f 72 | /* res|et error|
|00005ac0| 20 61 72 72 61 79 20 2a | 2f 0a 58 20 20 20 20 45 | array *|/.X E|
|00005ad0| 52 52 5f 52 45 53 45 54 | 3b 0a 58 0a 58 20 20 20 |RR_RESET|;.X.X |
|00005ae0| 20 2f 2a 20 72 65 6d 65 | 6d 62 65 72 20 6f 75 72 | /* reme|mber our|
|00005af0| 20 75 69 64 20 2a 2f 0a | 58 20 20 20 20 75 69 64 | uid */.|X uid|
|00005b00| 20 3d 20 67 65 74 75 69 | 64 28 29 3b 0a 58 0a 58 | = getui|d();.X.X|
|00005b10| 20 20 20 20 69 66 20 28 | 73 74 72 5b 30 5d 20 3d | if (|str[0] =|
|00005b20| 3d 20 27 2d 27 29 0a 58 | 20 20 20 20 7b 0a 58 09 |= '-').X| {.X.|
|00005b30| 2f 2a 20 65 78 70 6c 69 | 63 69 74 20 73 69 67 6e |/* expli|cit sign|
|00005b40| 61 6c 20 73 70 65 63 69 | 66 69 65 64 20 2a 2f 0a |al speci|fied */.|
|00005b50| 58 09 69 66 20 28 28 6e | 70 74 72 20 3d 20 6e 65 |X.if ((n|ptr = ne|
|00005b60| 78 74 5f 66 69 65 6c 64 | 28 73 74 72 29 29 20 3d |xt_field|(str)) =|
|00005b70| 3d 20 4e 55 4c 4c 29 0a | 58 09 7b 0a 58 09 20 20 |= NULL).|X.{.X. |
|00005b80| 20 20 72 65 74 75 72 6e | 28 22 20 6b 69 6c 6c 3a | return|(" kill:|
|00005b90| 20 6e 6f 20 70 72 6f 63 | 65 73 73 65 73 20 73 70 | no proc|esses sp|
|00005ba0| 65 63 69 66 69 65 64 22 | 29 3b 0a 58 09 7d 0a 58 |ecified"|);.X.}.X|
|00005bb0| 0a 58 09 69 66 20 28 69 | 73 64 69 67 69 74 28 73 |.X.if (i|sdigit(s|
|00005bc0| 74 72 5b 31 5d 29 29 0a | 58 09 7b 0a 58 09 20 20 |tr[1])).|X.{.X. |
|00005bd0| 20 20 28 76 6f 69 64 29 | 20 73 63 61 6e 69 6e 74 | (void)| scanint|
|00005be0| 28 73 74 72 20 2b 20 31 | 2c 20 26 73 69 67 6e 75 |(str + 1|, &signu|
|00005bf0| 6d 29 3b 0a 58 09 20 20 | 20 20 69 66 20 28 73 69 |m);.X. | if (si|
|00005c00| 67 6e 75 6d 20 3c 3d 20 | 30 20 7c 7c 20 73 69 67 |gnum <= |0 || sig|
|00005c10| 6e 75 6d 20 3e 3d 20 4e | 53 49 47 29 0a 58 09 20 |num >= N|SIG).X. |
|00005c20| 20 20 20 7b 0a 58 09 09 | 72 65 74 75 72 6e 28 22 | {.X..|return("|
|00005c30| 20 69 6e 76 61 6c 69 64 | 20 73 69 67 6e 61 6c 20 | invalid| signal |
|00005c40| 6e 75 6d 62 65 72 22 29 | 3b 0a 58 09 20 20 20 20 |number")|;.X. |
|00005c50| 7d 0a 58 09 7d 0a 58 09 | 65 6c 73 65 20 0a 58 09 |}.X.}.X.|else .X.|
|00005c60| 7b 0a 58 09 20 20 20 20 | 2f 2a 20 74 72 61 6e 73 |{.X. |/* trans|
|00005c70| 6c 61 74 65 20 74 68 65 | 20 6e 61 6d 65 20 69 6e |late the| name in|
|00005c80| 74 6f 20 61 20 6e 75 6d | 62 65 72 20 2a 2f 0a 58 |to a num|ber */.X|
|00005c90| 09 20 20 20 20 66 6f 72 | 20 28 73 69 67 70 20 3d |. for| (sigp =|
|00005ca0| 20 73 69 67 64 65 73 63 | 3b 20 73 69 67 70 2d 3e | sigdesc|; sigp->|
|00005cb0| 6e 61 6d 65 20 21 3d 20 | 4e 55 4c 4c 3b 20 73 69 |name != |NULL; si|
|00005cc0| 67 70 2b 2b 29 0a 58 09 | 20 20 20 20 7b 0a 58 09 |gp++).X.| {.X.|
|00005cd0| 09 69 66 20 28 73 74 72 | 63 6d 70 28 73 69 67 70 |.if (str|cmp(sigp|
|00005ce0| 2d 3e 6e 61 6d 65 2c 20 | 73 74 72 20 2b 20 31 29 |->name, |str + 1)|
|00005cf0| 20 3d 3d 20 30 29 0a 58 | 09 09 7b 0a 58 09 09 20 | == 0).X|..{.X.. |
|00005d00| 20 20 20 73 69 67 6e 75 | 6d 20 3d 20 73 69 67 70 | signu|m = sigp|
|00005d10| 2d 3e 6e 75 6d 62 65 72 | 3b 0a 58 09 09 20 20 20 |->number|;.X.. |
|00005d20| 20 62 72 65 61 6b 3b 0a | 58 09 09 7d 0a 58 09 20 | break;.|X..}.X. |
|00005d30| 20 20 20 7d 0a 58 0a 58 | 09 20 20 20 20 2f 2a 20 | }.X.X|. /* |
|00005d40| 77 61 73 20 69 74 20 65 | 76 65 72 20 66 6f 75 6e |was it e|ver foun|
|00005d50| 64 20 2a 2f 0a 58 09 20 | 20 20 20 69 66 20 28 73 |d */.X. | if (s|
|00005d60| 69 67 70 2d 3e 6e 61 6d | 65 20 3d 3d 20 4e 55 4c |igp->nam|e == NUL|
|00005d70| 4c 29 0a 58 09 20 20 20 | 20 7b 0a 58 09 09 72 65 |L).X. | {.X..re|
|00005d80| 74 75 72 6e 28 22 20 62 | 61 64 20 73 69 67 6e 61 |turn(" b|ad signa|
|00005d90| 6c 20 6e 61 6d 65 22 29 | 3b 0a 58 09 20 20 20 20 |l name")|;.X. |
|00005da0| 7d 0a 58 09 7d 0a 58 09 | 2f 2a 20 70 75 74 20 74 |}.X.}.X.|/* put t|
|00005db0| 68 65 20 6e 65 77 20 70 | 6f 69 6e 74 65 72 20 69 |he new p|ointer i|
|00005dc0| 6e 20 70 6c 61 63 65 20 | 2a 2f 0a 58 09 73 74 72 |n place |*/.X.str|
|00005dd0| 20 3d 20 6e 70 74 72 3b | 0a 58 20 20 20 20 7d 0a | = nptr;|.X }.|
|00005de0| 58 0a 58 20 20 20 20 2f | 2a 20 6c 6f 6f 70 20 74 |X.X /|* loop t|
|00005df0| 68 72 75 20 74 68 65 20 | 73 74 72 69 6e 67 2c 20 |hru the |string, |
|00005e00| 6b 69 6c 6c 69 6e 67 20 | 70 72 6f 63 65 73 73 65 |killing |processe|
|00005e10| 73 20 2a 2f 0a 58 20 20 | 20 20 64 6f 0a 58 20 20 |s */.X | do.X |
|00005e20| 20 20 7b 0a 58 09 69 66 | 20 28 73 63 61 6e 69 6e | {.X.if| (scanin|
|00005e30| 74 28 73 74 72 2c 20 26 | 70 72 6f 63 6e 75 6d 29 |t(str, &|procnum)|
|00005e40| 20 3d 3d 20 2d 31 29 0a | 58 09 7b 0a 58 09 20 20 | == -1).|X.{.X. |
|00005e50| 20 20 45 52 52 4f 52 28 | 73 74 72 2c 20 30 29 3b | ERROR(|str, 0);|
|00005e60| 0a 58 09 7d 0a 58 09 65 | 6c 73 65 0a 58 09 7b 0a |.X.}.X.e|lse.X.{.|
|00005e70| 58 09 20 20 20 20 2f 2a | 20 63 68 65 63 6b 20 70 |X. /*| check p|
|00005e80| 72 6f 63 65 73 73 20 6f | 77 6e 65 72 20 69 66 20 |rocess o|wner if |
|00005e90| 77 65 27 72 65 20 6e 6f | 74 20 72 6f 6f 74 20 2a |we're no|t root *|
|00005ea0| 2f 0a 58 09 20 20 20 20 | 69 66 20 28 75 69 64 20 |/.X. |if (uid |
|00005eb0| 26 26 20 28 75 69 64 20 | 21 3d 20 70 72 6f 63 5f |&& (uid |!= proc_|
|00005ec0| 6f 77 6e 65 72 28 70 72 | 6f 63 6e 75 6d 29 29 29 |owner(pr|ocnum)))|
|00005ed0| 0a 58 09 20 20 20 20 7b | 0a 58 09 09 45 52 52 4f |.X. {|.X..ERRO|
|00005ee0| 52 28 73 74 72 2c 20 45 | 41 43 43 45 53 29 3b 0a |R(str, E|ACCES);.|
|00005ef0| 58 09 20 20 20 20 7d 0a | 58 09 20 20 20 20 2f 2a |X. }.|X. /*|
|00005f00| 20 67 6f 20 69 6e 20 66 | 6f 72 20 74 68 65 20 6b | go in f|or the k|
|00005f10| 69 6c 6c 20 2a 2f 0a 58 | 09 20 20 20 20 65 6c 73 |ill */.X|. els|
|00005f20| 65 20 69 66 20 28 6b 69 | 6c 6c 28 70 72 6f 63 6e |e if (ki|ll(procn|
|00005f30| 75 6d 2c 20 73 69 67 6e | 75 6d 29 20 3d 3d 20 2d |um, sign|um) == -|
|00005f40| 31 29 0a 58 09 20 20 20 | 20 7b 0a 58 09 09 2f 2a |1).X. | {.X../*|
|00005f50| 20 63 68 61 6c 6b 20 75 | 70 20 61 6e 20 65 72 72 | chalk u|p an err|
|00005f60| 6f 72 20 2a 2f 0a 58 09 | 09 45 52 52 4f 52 28 73 |or */.X.|.ERROR(s|
|00005f70| 74 72 2c 20 65 72 72 6e | 6f 29 3b 0a 58 09 20 20 |tr, errn|o);.X. |
|00005f80| 20 20 7d 0a 58 09 7d 0a | 58 20 20 20 20 7d 20 77 | }.X.}.|X } w|
|00005f90| 68 69 6c 65 20 28 28 73 | 74 72 20 3d 20 6e 65 78 |hile ((s|tr = nex|
|00005fa0| 74 5f 66 69 65 6c 64 28 | 73 74 72 29 29 20 21 3d |t_field(|str)) !=|
|00005fb0| 20 4e 55 4c 4c 29 3b 0a | 58 0a 58 20 20 20 20 2f | NULL);.|X.X /|
|00005fc0| 2a 20 72 65 74 75 72 6e | 20 61 70 70 72 6f 70 72 |* return| appropr|
|00005fd0| 69 61 74 65 20 65 72 72 | 6f 72 20 73 74 72 69 6e |iate err|or strin|
|00005fe0| 67 20 2a 2f 0a 58 20 20 | 20 20 72 65 74 75 72 6e |g */.X | return|
|00005ff0| 28 65 72 72 5f 73 74 72 | 69 6e 67 28 29 29 3b 0a |(err_str|ing());.|
|00006000| 58 7d 0a 58 0a 58 2f 2a | 0a 58 20 2a 20 20 72 65 |X}.X.X/*|.X * re|
|00006010| 6e 69 63 65 5f 70 72 6f | 63 73 28 73 74 72 29 20 |nice_pro|cs(str) |
|00006020| 2d 20 63 68 61 6e 67 65 | 20 74 68 65 20 22 6e 69 |- change| the "ni|
|00006030| 63 65 22 20 6f 66 20 70 | 72 6f 63 65 73 73 65 73 |ce" of p|rocesses|
|00006040| 2c 20 6d 75 63 68 20 6c | 69 6b 65 20 74 68 65 0a |, much l|ike the.|
|00006050| 58 20 2a 09 09 22 72 65 | 6e 69 63 65 22 20 63 6f |X *.."re|nice" co|
|00006060| 6d 6d 61 6e 64 20 64 6f | 65 73 3b 20 69 6e 76 6f |mmand do|es; invo|
|00006070| 6b 65 64 20 69 6e 20 72 | 65 73 70 6f 6e 73 65 20 |ked in r|esponse |
|00006080| 74 6f 20 27 72 27 2e 0a | 58 20 2a 2f 0a 58 0a 58 |to 'r'..|X */.X.X|
|00006090| 63 68 61 72 20 2a 72 65 | 6e 69 63 65 5f 70 72 6f |char *re|nice_pro|
|000060a0| 63 73 28 73 74 72 29 0a | 58 0a 58 63 68 61 72 20 |cs(str).|X.Xchar |
|000060b0| 2a 73 74 72 3b 0a 58 0a | 58 7b 0a 58 20 20 20 20 |*str;.X.|X{.X |
|000060c0| 72 65 67 69 73 74 65 72 | 20 63 68 61 72 20 6e 65 |register| char ne|
|000060d0| 67 61 74 65 3b 0a 58 20 | 20 20 20 69 6e 74 20 70 |gate;.X | int p|
|000060e0| 72 69 6f 3b 0a 58 20 20 | 20 20 69 6e 74 20 70 72 |rio;.X | int pr|
|000060f0| 6f 63 6e 75 6d 3b 0a 58 | 20 20 20 20 69 6e 74 20 |ocnum;.X| int |
|00006100| 75 69 64 3b 0a 58 0a 58 | 20 20 20 20 45 52 52 5f |uid;.X.X| ERR_|
|00006110| 52 45 53 45 54 3b 0a 58 | 20 20 20 20 75 69 64 20 |RESET;.X| uid |
|00006120| 3d 20 67 65 74 75 69 64 | 28 29 3b 0a 58 0a 58 20 |= getuid|();.X.X |
|00006130| 20 20 20 2f 2a 20 61 6c | 6c 6f 77 20 66 6f 72 20 | /* al|low for |
|00006140| 6e 65 67 61 74 69 76 65 | 20 70 72 69 6f 72 69 74 |negative| priorit|
|00006150| 79 20 76 61 6c 75 65 73 | 20 2a 2f 0a 58 20 20 20 |y values| */.X |
|00006160| 20 69 66 20 28 28 6e 65 | 67 61 74 65 20 3d 20 28 | if ((ne|gate = (|
|00006170| 2a 73 74 72 20 3d 3d 20 | 27 2d 27 29 29 20 21 3d |*str == |'-')) !=|
|00006180| 20 30 29 0a 58 20 20 20 | 20 7b 0a 58 09 2f 2a 20 | 0).X | {.X./* |
|00006190| 6d 6f 76 65 20 70 61 73 | 74 20 74 68 65 20 6d 69 |move pas|t the mi|
|000061a0| 6e 75 73 20 73 69 67 6e | 20 2a 2f 0a 58 09 73 74 |nus sign| */.X.st|
|000061b0| 72 2b 2b 3b 0a 58 20 20 | 20 20 7d 0a 58 0a 58 20 |r++;.X | }.X.X |
|000061c0| 20 20 20 2f 2a 20 75 73 | 65 20 70 72 6f 63 6e 75 | /* us|e procnu|
|000061d0| 6d 20 61 73 20 61 20 74 | 65 6d 70 6f 72 61 72 79 |m as a t|emporary|
|000061e0| 20 68 6f 6c 64 69 6e 67 | 20 70 6c 61 63 65 20 61 | holding| place a|
|000061f0| 6e 64 20 67 65 74 20 74 | 68 65 20 6e 75 6d 62 65 |nd get t|he numbe|
|00006200| 72 20 2a 2f 0a 58 20 20 | 20 20 70 72 6f 63 6e 75 |r */.X | procnu|
|00006210| 6d 20 3d 20 73 63 61 6e | 69 6e 74 28 73 74 72 2c |m = scan|int(str,|
|00006220| 20 26 70 72 69 6f 29 3b | 0a 58 0a 58 20 20 20 20 | &prio);|.X.X |
|00006230| 2f 2a 20 6e 65 67 61 74 | 65 20 69 66 20 6e 65 63 |/* negat|e if nec|
|00006240| 65 73 73 61 72 79 20 2a | 2f 0a 58 20 20 20 20 69 |essary *|/.X i|
|00006250| 66 20 28 6e 65 67 61 74 | 65 29 0a 58 20 20 20 20 |f (negat|e).X |
|00006260| 7b 0a 58 09 70 72 69 6f | 20 3d 20 2d 70 72 69 6f |{.X.prio| = -prio|
|00006270| 3b 0a 58 20 20 20 20 7d | 0a 58 0a 58 23 69 66 20 |;.X }|.X.X#if |
|00006280| 64 65 66 69 6e 65 64 28 | 50 52 49 4f 5f 4d 49 4e |defined(|PRIO_MIN|
|00006290| 29 20 26 26 20 64 65 66 | 69 6e 65 64 28 50 52 49 |) && def|ined(PRI|
|000062a0| 4f 5f 4d 41 58 29 0a 58 | 20 20 20 20 2f 2a 20 63 |O_MAX).X| /* c|
|000062b0| 68 65 63 6b 20 66 6f 72 | 20 76 61 6c 69 64 69 74 |heck for| validit|
|000062c0| 79 20 2a 2f 0a 58 20 20 | 20 20 69 66 20 28 70 72 |y */.X | if (pr|
|000062d0| 6f 63 6e 75 6d 20 3d 3d | 20 2d 31 20 7c 7c 20 70 |ocnum ==| -1 || p|
|000062e0| 72 69 6f 20 3c 3d 20 50 | 52 49 4f 5f 4d 49 4e 20 |rio <= P|RIO_MIN |
|000062f0| 7c 7c 20 70 72 69 6f 20 | 3e 3d 20 50 52 49 4f 5f ||| prio |>= PRIO_|
|00006300| 4d 41 58 29 0a 58 20 20 | 20 20 7b 0a 58 09 72 65 |MAX).X | {.X.re|
|00006310| 74 75 72 6e 28 22 20 62 | 61 64 20 70 72 69 6f 72 |turn(" b|ad prior|
|00006320| 69 74 79 20 76 61 6c 75 | 65 22 29 3b 0a 58 20 20 |ity valu|e");.X |
|00006330| 20 20 7d 0a 58 23 65 6e | 64 69 66 0a 58 0a 58 20 | }.X#en|dif.X.X |
|00006340| 20 20 20 2f 2a 20 6d 6f | 76 65 20 74 6f 20 74 68 | /* mo|ve to th|
|00006350| 65 20 66 69 72 73 74 20 | 70 72 6f 63 65 73 73 20 |e first |process |
|00006360| 6e 75 6d 62 65 72 20 2a | 2f 0a 58 20 20 20 20 69 |number *|/.X i|
|00006370| 66 20 28 28 73 74 72 20 | 3d 20 6e 65 78 74 5f 66 |f ((str |= next_f|
|00006380| 69 65 6c 64 28 73 74 72 | 29 29 20 3d 3d 20 4e 55 |ield(str|)) == NU|
|00006390| 4c 4c 29 0a 58 20 20 20 | 20 7b 0a 58 09 72 65 74 |LL).X | {.X.ret|
|000063a0| 75 72 6e 28 22 20 6e 6f | 20 70 72 6f 63 65 73 73 |urn(" no| process|
|000063b0| 65 73 20 73 70 65 63 69 | 66 69 65 64 22 29 3b 0a |es speci|fied");.|
|000063c0| 58 20 20 20 20 7d 0a 58 | 0a 58 20 20 20 20 2f 2a |X }.X|.X /*|
|000063d0| 20 6c 6f 6f 70 20 74 68 | 72 75 20 74 68 65 20 70 | loop th|ru the p|
|000063e0| 72 6f 63 65 73 73 20 6e | 75 6d 62 65 72 73 2c 20 |rocess n|umbers, |
|000063f0| 72 65 6e 69 63 69 6e 67 | 20 65 61 63 68 20 6f 6e |renicing| each on|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.