home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: bstatusl.ine
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 6d 69 70 | 6f 73 33 21 69 6e 74 65 |From mip|os3!inte|
|00000010| 6c 63 61 21 6f 6c 69 76 | 65 62 21 61 6d 65 73 21 |lca!oliv|eb!ames!|
|00000020| 6e 65 63 6e 74 63 21 6e | 63 6f 61 73 74 21 61 6c |necntc!n|coast!al|
|00000030| 6c 62 65 72 79 20 53 61 | 74 20 4a 61 6e 20 32 33 |lbery Sa|t Jan 23|
|00000040| 20 31 39 3a 31 35 3a 32 | 37 20 50 53 54 20 31 39 | 19:15:2|7 PST 19|
|00000050| 38 38 0a 41 72 74 69 63 | 6c 65 20 32 35 33 20 6f |88.Artic|le 253 o|
|00000060| 66 20 63 6f 6d 70 2e 73 | 6f 75 72 63 65 73 2e 6d |f comp.s|ources.m|
|00000070| 69 73 63 3a 0a 50 61 74 | 68 3a 20 74 64 32 63 61 |isc:.Pat|h: td2ca|
|00000080| 64 21 6d 69 70 6f 73 33 | 21 69 6e 74 65 6c 63 61 |d!mipos3|!intelca|
|00000090| 21 6f 6c 69 76 65 62 21 | 61 6d 65 73 21 6e 65 63 |!oliveb!|ames!nec|
|000000a0| 6e 74 63 21 6e 63 6f 61 | 73 74 21 61 6c 6c 62 65 |ntc!ncoa|st!allbe|
|000000b0| 72 79 0a 46 72 6f 6d 3a | 20 73 63 6f 74 74 40 7a |ry.From:| scott@z|
|000000c0| 6f 72 63 68 2e 55 55 43 | 50 20 28 53 63 6f 74 74 |orch.UUC|P (Scott|
|000000d0| 20 48 61 7a 65 6e 20 4d | 75 65 6c 6c 65 72 29 0a | Hazen M|ueller).|
|000000e0| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|000000f0| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 0a 53 75 |.sources|.misc.Su|
|00000100| 62 6a 65 63 74 3a 20 76 | 30 32 69 30 30 34 3a 20 |bject: v|02i004: |
|00000110| 33 42 31 20 73 74 61 74 | 75 73 20 62 61 72 20 72 |3B1 stat|us bar r|
|00000120| 65 64 75 78 0a 4d 65 73 | 73 61 67 65 2d 49 44 3a |edux.Mes|sage-ID:|
|00000130| 20 3c 37 30 37 38 40 6e | 63 6f 61 73 74 2e 55 55 | <7078@n|coast.UU|
|00000140| 43 50 3e 0a 44 61 74 65 | 3a 20 31 35 20 4a 61 6e |CP>.Date|: 15 Jan|
|00000150| 20 38 38 20 30 30 3a 32 | 38 3a 33 37 20 47 4d 54 | 88 00:2|8:37 GMT|
|00000160| 0a 53 65 6e 64 65 72 3a | 20 61 6c 6c 62 65 72 79 |.Sender:| allbery|
|00000170| 40 6e 63 6f 61 73 74 2e | 55 55 43 50 0a 4f 72 67 |@ncoast.|UUCP.Org|
|00000180| 61 6e 69 7a 61 74 69 6f | 6e 3a 20 41 74 20 48 6f |anizatio|n: At Ho|
|00000190| 6d 65 3b 20 53 75 6e 6e | 79 76 61 6c 65 2c 20 43 |me; Sunn|yvale, C|
|000001a0| 41 0a 4c 69 6e 65 73 3a | 20 31 31 32 39 0a 41 70 |A.Lines:| 1129.Ap|
|000001b0| 70 72 6f 76 65 64 3a 20 | 61 6c 6c 62 65 72 79 40 |proved: |allbery@|
|000001c0| 6e 63 6f 61 73 74 2e 55 | 55 43 50 0a 58 2d 41 72 |ncoast.U|UCP.X-Ar|
|000001d0| 63 68 69 76 65 3a 20 63 | 6f 6d 70 2e 73 6f 75 72 |chive: c|omp.sour|
|000001e0| 63 65 73 2e 6d 69 73 63 | 2f 38 38 30 31 2f 34 0a |ces.misc|/8801/4.|
|000001f0| 43 6f 6d 70 2e 53 6f 75 | 72 63 65 73 2e 4d 69 73 |Comp.Sou|rces.Mis|
|00000200| 63 3a 20 56 6f 6c 75 6d | 65 20 32 2c 20 49 73 73 |c: Volum|e 2, Iss|
|00000210| 75 65 20 34 0a 53 75 62 | 6d 69 74 74 65 64 2d 42 |ue 4.Sub|mitted-B|
|00000220| 79 3a 20 53 63 6f 74 74 | 20 48 61 7a 65 6e 20 4d |y: Scott| Hazen M|
|00000230| 75 65 6c 6c 65 72 20 3c | 73 63 6f 74 74 40 7a 6f |ueller <|scott@zo|
|00000240| 72 63 68 2e 75 75 63 70 | 3e 0a 41 72 63 68 69 76 |rch.uucp|>.Archiv|
|00000250| 65 2d 4e 61 6d 65 3a 20 | 33 62 31 2d 73 74 61 74 |e-Name: |3b1-stat|
|00000260| 75 73 2d 6c 69 6e 65 0a | 0a 43 6f 6d 70 2e 53 6f |us-line.|.Comp.So|
|00000270| 75 72 63 65 73 2e 4d 69 | 73 63 3a 20 56 6f 6c 75 |urces.Mi|sc: Volu|
|00000280| 6d 65 20 32 2c 20 49 73 | 73 75 65 20 34 0a 53 75 |me 2, Is|sue 4.Su|
|00000290| 62 6d 69 74 74 65 64 2d | 42 79 3a 20 53 63 6f 74 |bmitted-|By: Scot|
|000002a0| 74 20 48 61 7a 65 6e 20 | 4d 75 65 6c 6c 65 72 20 |t Hazen |Mueller |
|000002b0| 3c 73 63 6f 74 74 40 7a | 6f 72 63 68 2e 75 75 63 |<scott@z|orch.uuc|
|000002c0| 70 3e 0a 41 72 63 68 69 | 76 65 2d 4e 61 6d 65 3a |p>.Archi|ve-Name:|
|000002d0| 20 33 62 31 2d 73 74 61 | 74 75 73 2d 6c 69 6e 65 | 3b1-sta|tus-line|
|000002e0| 0a 0a 54 68 69 73 20 69 | 73 20 61 20 63 6f 6e 73 |..This i|s a cons|
|000002f0| 69 64 65 72 61 62 6c 65 | 20 65 6e 68 61 6e 63 65 |iderable| enhance|
|00000300| 64 20 28 65 6e 68 61 63 | 6b 65 64 3f 29 20 76 65 |d (enhac|ked?) ve|
|00000310| 72 73 69 6f 6e 20 6f 66 | 20 74 68 65 20 33 42 31 |rsion of| the 3B1|
|00000320| 20 73 74 61 74 75 73 20 | 62 61 72 0a 70 72 6f 67 | status |bar.prog|
|00000330| 72 61 6d 20 74 68 61 74 | 20 49 20 70 6f 73 74 65 |ram that| I poste|
|00000340| 64 20 74 6f 20 63 6f 6d | 70 2e 73 6f 75 72 63 65 |d to com|p.source|
|00000350| 73 2e 6d 69 73 63 20 61 | 72 6f 75 6e 64 20 6c 61 |s.misc a|round la|
|00000360| 73 74 20 4f 63 74 6f 62 | 65 72 2e 20 20 54 68 69 |st Octob|er. Thi|
|00000370| 73 20 76 65 72 73 69 6f | 6e 0a 69 73 20 6e 6f 74 |s versio|n.is not|
|00000380| 20 71 75 69 74 65 20 73 | 6f 20 6d 69 6e 69 6d 61 | quite s|o minima|
|00000390| 6c 2e 20 20 49 6e 20 61 | 64 64 69 74 69 6f 6e 20 |l. In a|ddition |
|000003a0| 74 6f 20 64 69 73 70 6c | 61 79 69 6e 67 20 61 20 |to displ|aying a |
|000003b0| 73 74 61 74 75 73 20 6c | 69 6e 65 20 61 63 72 6f |status l|ine acro|
|000003c0| 73 73 20 74 68 65 0a 74 | 6f 70 20 6f 66 20 74 68 |ss the.t|op of th|
|000003d0| 65 20 73 63 72 65 65 6e | 2c 20 69 74 20 75 73 65 |e screen|, it use|
|000003e0| 73 20 74 68 65 20 53 75 | 73 70 65 6e 64 20 61 6e |s the Su|spend an|
|000003f0| 64 20 52 65 73 75 6d 65 | 20 6b 65 79 73 20 74 6f |d Resume| keys to|
|00000400| 20 73 77 69 74 63 68 20 | 74 6f 20 74 68 65 20 6e | switch |to the n|
|00000410| 65 78 74 0a 61 6e 64 20 | 70 72 65 76 69 6f 75 73 |ext.and |previous|
|00000420| 20 77 69 6e 64 6f 77 73 | 3b 20 63 6f 6d 62 69 6e | windows|; combin|
|00000430| 65 64 20 77 69 74 68 20 | 6d 75 6c 74 69 70 6c 65 |ed with |multiple|
|00000440| 20 63 6f 6e 73 6f 6c 65 | 20 67 65 74 74 79 73 20 | console| gettys |
|00000450| 69 74 20 67 69 76 65 73 | 20 62 65 68 61 76 69 6f |it gives| behavio|
|00000460| 72 0a 72 61 74 68 65 72 | 20 6c 69 6b 65 20 74 68 |r.rather| like th|
|00000470| 61 74 20 6f 66 20 38 30 | 78 38 36 2d 62 61 73 65 |at of 80|x86-base|
|00000480| 64 20 55 6e 69 63 65 73 | 20 77 69 74 68 20 76 69 |d Unices| with vi|
|00000490| 72 74 75 61 6c 20 63 6f | 6e 73 6f 6c 65 73 2e 20 |rtual co|nsoles. |
|000004a0| 20 41 6c 73 6f 2c 20 69 | 74 20 6d 61 70 73 0a 61 | Also, i|t maps.a|
|000004b0| 20 62 75 6e 63 68 20 6f | 66 20 27 65 78 74 65 6e | bunch o|f 'exten|
|000004c0| 64 65 64 2d 73 74 61 74 | 75 73 27 20 66 75 6e 63 |ded-stat|us' func|
|000004d0| 74 69 6f 6e 73 20 74 6f | 20 74 68 65 20 73 68 69 |tions to| the shi|
|000004e0| 66 74 65 64 20 46 75 6e | 63 74 69 6f 6e 20 6b 65 |fted Fun|ction ke|
|000004f0| 79 73 20 6f 6e 20 74 68 | 65 0a 63 6f 6e 73 6f 6c |ys on th|e.consol|
|00000500| 65 20 6b 65 79 62 6f 61 | 72 64 20 28 61 6e 64 20 |e keyboa|rd (and |
|00000510| 61 20 68 65 6c 70 20 66 | 75 6e 63 74 69 6f 6e 20 |a help f|unction |
|00000520| 74 6f 20 73 68 69 66 74 | 2d 50 72 69 6e 74 29 2e |to shift|-Print).|
|00000530| 0a 0a 23 21 20 2f 62 69 | 6e 2f 73 68 0a 23 20 54 |..#! /bi|n/sh.# T|
|00000540| 68 69 73 20 69 73 20 61 | 20 73 68 65 6c 6c 20 61 |his is a| shell a|
|00000550| 72 63 68 69 76 65 2c 20 | 6d 65 61 6e 69 6e 67 3a |rchive, |meaning:|
|00000560| 0a 23 20 31 2e 20 52 65 | 6d 6f 76 65 20 65 76 65 |.# 1. Re|move eve|
|00000570| 72 79 74 68 69 6e 67 20 | 61 62 6f 76 65 20 74 68 |rything |above th|
|00000580| 65 20 23 21 20 2f 62 69 | 6e 2f 73 68 20 6c 69 6e |e #! /bi|n/sh lin|
|00000590| 65 2e 0a 23 20 32 2e 20 | 53 61 76 65 20 74 68 65 |e..# 2. |Save the|
|000005a0| 20 72 65 73 75 6c 74 69 | 6e 67 20 74 65 78 74 20 | resulti|ng text |
|000005b0| 69 6e 20 61 20 66 69 6c | 65 2e 0a 23 20 33 2e 20 |in a fil|e..# 3. |
|000005c0| 45 78 65 63 75 74 65 20 | 74 68 65 20 66 69 6c 65 |Execute |the file|
|000005d0| 20 77 69 74 68 20 2f 62 | 69 6e 2f 73 68 20 28 6e | with /b|in/sh (n|
|000005e0| 6f 74 20 63 73 68 29 20 | 74 6f 20 63 72 65 61 74 |ot csh) |to creat|
|000005f0| 65 20 74 68 65 20 66 69 | 6c 65 73 3a 0a 23 09 52 |e the fi|les:.#.R|
|00000600| 65 61 64 4d 65 0a 23 09 | 4d 61 6b 65 66 69 6c 65 |eadMe.#.|Makefile|
|00000610| 0a 23 09 6e 65 77 6d 67 | 72 2e 63 0a 23 09 73 74 |.#.newmg|r.c.#.st|
|00000620| 61 72 74 6d 67 72 2e 63 | 0a 23 09 6e 64 69 72 2e |artmgr.c|.#.ndir.|
|00000630| 63 0a 23 09 6e 64 69 72 | 2e 68 0a 23 20 54 68 69 |c.#.ndir|.h.# Thi|
|00000640| 73 20 61 72 63 68 69 76 | 65 20 63 72 65 61 74 65 |s archiv|e create|
|00000650| 64 3a 20 53 61 74 20 4a | 61 6e 20 20 39 20 32 31 |d: Sat J|an 9 21|
|00000660| 3a 31 35 3a 31 34 20 31 | 39 38 38 0a 65 78 70 6f |:15:14 1|988.expo|
|00000670| 72 74 20 50 41 54 48 3b | 20 50 41 54 48 3d 2f 62 |rt PATH;| PATH=/b|
|00000680| 69 6e 3a 24 50 41 54 48 | 0a 69 66 20 74 65 73 74 |in:$PATH|.if test|
|00000690| 20 2d 66 20 27 52 65 61 | 64 4d 65 27 0a 74 68 65 | -f 'Rea|dMe'.the|
|000006a0| 6e 0a 20 20 20 20 20 20 | 20 65 63 68 6f 20 73 68 |n. | echo sh|
|000006b0| 61 72 3a 20 77 69 6c 6c | 20 6e 6f 74 20 6f 76 65 |ar: will| not ove|
|000006c0| 72 2d 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |r-write |existing|
|000006d0| 20 66 69 6c 65 20 22 27 | 52 65 61 64 4d 65 27 22 | file "'|ReadMe'"|
|000006e0| 0a 65 6c 73 65 0a 63 61 | 74 20 3c 3c 20 5c 53 48 |.else.ca|t << \SH|
|000006f0| 41 52 5f 45 4f 46 20 3e | 20 27 52 65 61 64 4d 65 |AR_EOF >| 'ReadMe|
|00000700| 27 0a 0a 52 65 61 64 4d | 65 20 66 6f 72 20 39 20 |'..ReadM|e for 9 |
|00000710| 4a 61 6e 20 31 39 38 38 | 20 76 65 72 73 69 6f 6e |Jan 1988| version|
|00000720| 20 6f 66 20 73 74 61 72 | 74 6d 67 72 20 61 6e 64 | of star|tmgr and|
|00000730| 20 6e 65 77 6d 67 72 0a | 0a 54 68 65 73 65 20 74 | newmgr.|.These t|
|00000740| 77 6f 20 70 72 6f 67 72 | 61 6d 73 20 69 6d 70 6c |wo progr|ams impl|
|00000750| 65 6d 65 6e 74 20 61 20 | 72 65 70 6c 61 63 65 6d |ement a |replacem|
|00000760| 65 6e 74 20 66 6f 72 20 | 73 6d 67 72 2c 20 77 6d |ent for |smgr, wm|
|00000770| 67 72 20 61 6e 64 20 70 | 68 2e 20 20 54 68 65 79 |gr and p|h. They|
|00000780| 20 64 6f 6e 27 74 0a 64 | 6f 20 74 68 65 20 63 72 | don't.d|o the cr|
|00000790| 6f 6e 20 73 74 75 66 66 | 3b 20 75 73 65 20 63 72 |on stuff|; use cr|
|000007a0| 6f 6e 20 66 6f 72 20 74 | 68 61 74 2e 20 20 54 68 |on for t|hat. Th|
|000007b0| 65 79 20 64 6f 6e 27 74 | 20 64 6f 20 6d 61 69 6c |ey don't| do mail|
|000007c0| 2c 20 61 6e 64 20 49 20 | 64 6f 6e 27 74 20 63 61 |, and I |don't ca|
|000007d0| 72 65 2c 0a 62 65 63 61 | 75 73 65 20 49 20 64 6f |re,.beca|use I do|
|000007e0| 6e 27 74 20 75 73 65 20 | 2f 62 69 6e 2f 6d 61 69 |n't use |/bin/mai|
|000007f0| 6c 20 61 6e 79 77 61 79 | 2e 20 20 4c 69 6b 65 77 |l anyway|. Likew|
|00000800| 69 73 65 2c 20 74 68 65 | 79 20 6b 6e 6f 77 20 6e |ise, the|y know n|
|00000810| 6f 74 68 69 6e 67 20 61 | 62 6f 75 74 0a 63 61 6c |othing a|bout.cal|
|00000820| 65 6e 64 61 72 73 20 6f | 72 20 6d 65 6d 6f 73 2e |endars o|r memos.|
|00000830| 20 20 41 64 64 69 74 69 | 6f 6e 61 6c 6c 79 2c 20 | Additi|onally, |
|00000840| 74 68 65 20 77 6d 67 72 | 20 66 75 6e 63 74 69 6f |the wmgr| functio|
|00000850| 6e 20 64 6f 65 73 6e 27 | 74 20 62 72 69 6e 67 20 |n doesn'|t bring |
|00000860| 75 70 20 61 20 6d 65 6e | 75 3b 0a 69 74 20 6a 75 |up a men|u;.it ju|
|00000870| 73 74 20 73 77 69 74 63 | 68 65 73 20 79 6f 75 20 |st switc|hes you |
|00000880| 62 65 74 77 65 65 6e 20 | 77 69 6e 64 6f 77 73 2e |between |windows.|
|00000890| 0a 0a 57 68 61 74 20 73 | 74 61 72 74 6d 67 72 20 |..What s|tartmgr |
|000008a0| 64 6f 65 73 20 69 73 20 | 73 74 61 72 74 20 6e 65 |does is |start ne|
|000008b0| 77 6d 67 72 2e 20 20 49 | 74 20 73 74 61 72 74 73 |wmgr. I|t starts|
|000008c0| 20 69 74 20 69 6e 20 61 | 20 77 69 6e 64 6f 77 20 | it in a| window |
|000008d0| 61 63 72 6f 73 73 20 74 | 68 65 0a 74 6f 70 20 6f |across t|he.top o|
|000008e0| 66 20 74 68 65 20 73 63 | 72 65 65 6e 2c 20 69 6e |f the sc|reen, in|
|000008f0| 20 74 68 65 20 70 6c 61 | 63 65 73 20 77 68 65 72 | the pla|ces wher|
|00000900| 65 20 74 68 65 20 50 68 | 6f 6e 65 20 4d 61 6e 61 |e the Ph|one Mana|
|00000910| 67 65 72 2c 20 74 68 65 | 20 53 74 61 74 75 73 20 |ger, the| Status |
|00000920| 4d 61 6e 61 67 65 72 0a | 61 6e 64 20 74 68 65 20 |Manager.|and the |
|00000930| 57 69 6e 64 6f 77 20 4d | 61 6e 61 67 65 72 20 6c |Window M|anager l|
|00000940| 69 76 65 20 28 49 20 64 | 6f 6e 27 74 20 75 73 65 |ive (I d|on't use|
|00000950| 20 74 68 65 20 50 4d 20 | 65 69 74 68 65 72 2e 2e | the PM |either..|
|00000960| 2e 29 2e 20 20 49 74 20 | 74 68 65 6e 20 72 65 74 |.). It |then ret|
|00000970| 75 72 6e 73 2c 0a 73 6f | 20 61 6c 6c 20 79 6f 75 |urns,.so| all you|
|00000980| 20 6e 65 65 64 20 74 6f | 20 64 6f 20 69 73 20 73 | need to| do is s|
|00000990| 74 61 72 74 6d 67 72 2e | 20 20 49 74 20 70 72 6f |tartmgr.| It pro|
|000009a0| 62 61 62 6c 79 20 63 61 | 6e 20 62 65 20 74 75 72 |bably ca|n be tur|
|000009b0| 6e 65 64 20 69 6e 74 6f | 20 61 20 66 61 69 72 6c |ned into| a fairl|
|000009c0| 79 0a 67 65 6e 65 72 61 | 6c 20 70 72 6f 63 65 73 |y.genera|l proces|
|000009d0| 73 20 73 74 61 72 74 65 | 72 2c 20 62 75 74 20 49 |s starte|r, but I|
|000009e0| 20 64 6f 6e 27 74 20 68 | 61 76 65 20 74 68 65 20 | don't h|ave the |
|000009f0| 74 69 6d 65 2c 20 77 68 | 61 74 20 77 69 74 68 20 |time, wh|at with |
|00000a00| 61 6c 6c 20 6f 66 20 74 | 68 65 0a 73 74 75 66 66 |all of t|he.stuff|
|00000a10| 20 74 68 61 74 20 49 27 | 76 65 20 67 6f 74 20 70 | that I'|ve got p|
|00000a20| 69 6c 65 64 20 75 70 20 | 74 6f 20 6c 6f 6f 6b 20 |iled up |to look |
|00000a30| 61 74 2e 0a 0a 4e 65 77 | 6d 67 72 20 69 73 20 6a |at...New|mgr is j|
|00000a40| 75 73 74 20 61 20 66 6f | 72 65 76 65 72 20 6c 6f |ust a fo|rever lo|
|00000a50| 6f 70 20 74 68 61 74 20 | 64 69 73 70 6c 61 79 73 |op that |displays|
|00000a60| 20 73 6f 6d 65 20 73 74 | 61 74 75 73 20 69 6e 66 | some st|atus inf|
|00000a70| 6f 72 6d 61 74 69 6f 6e | 20 74 6f 0a 73 74 64 6f |ormation| to.stdo|
|00000a80| 75 74 20 61 6e 64 20 70 | 65 65 6b 73 20 61 74 20 |ut and p|eeks at |
|00000a90| 74 68 65 20 53 75 73 70 | 65 6e 64 2c 20 52 65 73 |the Susp|end, Res|
|00000aa0| 75 6d 65 20 53 68 69 66 | 74 2d 50 72 69 6e 74 20 |ume Shif|t-Print |
|00000ab0| 61 6e 64 20 53 68 69 66 | 74 2d 46 75 6e 63 74 69 |and Shif|t-Functi|
|00000ac0| 6f 6e 20 4b 65 79 73 2e | 0a 54 68 65 20 53 68 69 |on Keys.|.The Shi|
|00000ad0| 66 74 2d 46 75 6e 63 74 | 69 6f 6e 20 6b 65 79 73 |ft-Funct|ion keys|
|00000ae0| 20 64 69 73 70 6c 61 79 | 20 61 6c 6c 20 73 6f 72 | display| all sor|
|00000af0| 74 73 20 6f 66 20 61 64 | 64 69 74 69 6f 6e 61 6c |ts of ad|ditional|
|00000b00| 20 73 74 61 74 75 73 20 | 69 6e 66 6f 72 6d 61 74 | status |informat|
|00000b10| 69 6f 6e 3b 0a 73 69 6e | 63 65 20 49 20 75 73 65 |ion;.sin|ce I use|
|00000b20| 20 55 55 43 50 20 61 20 | 6c 6f 74 2c 20 66 6f 75 | UUCP a |lot, fou|
|00000b30| 72 20 6f 66 20 74 68 65 | 20 6b 65 79 73 20 73 68 |r of the| keys sh|
|00000b40| 6f 77 20 55 55 43 50 2d | 72 65 6c 61 74 65 64 20 |ow UUCP-|related |
|00000b50| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 28 4c 43 4b |informat|ion (LCK|
|00000b60| 2c 0a 43 2e 20 61 6e 64 | 20 44 2e 20 20 66 69 6c |,.C. and| D. fil|
|00000b70| 65 73 20 61 6e 64 20 61 | 6c 6c 20 6f 66 20 2f 75 |es and a|ll of /u|
|00000b80| 73 72 2f 73 70 6f 6f 6c | 2f 75 75 63 70 29 20 61 |sr/spool|/uucp) a|
|00000b90| 6e 64 20 74 68 65 20 6f | 74 68 65 72 20 66 6f 75 |nd the o|ther fou|
|00000ba0| 72 20 73 68 6f 77 20 70 | 72 6f 63 65 73 73 0a 73 |r show p|rocess.s|
|00000bb0| 74 61 74 75 73 2c 20 75 | 74 6d 70 20 69 6e 66 6f |tatus, u|tmp info|
|00000bc0| 72 6d 61 74 69 6f 6e 2c | 20 74 68 65 20 6d 61 69 |rmation,| the mai|
|00000bd0| 6c 20 64 69 72 65 63 74 | 6f 72 79 2c 20 61 6e 64 |l direct|ory, and|
|00000be0| 20 72 6f 6f 74 20 64 69 | 73 6b 20 73 74 61 74 73 | root di|sk stats|
|00000bf0| 2e 20 20 46 65 65 6c 20 | 66 72 65 65 0a 74 6f 20 |. Feel |free.to |
|00000c00| 68 61 63 6b 20 69 74 3b | 20 49 20 6a 75 73 74 20 |hack it;| I just |
|00000c10| 70 75 74 20 75 70 20 77 | 68 61 74 20 49 20 63 6f |put up w|hat I co|
|00000c20| 75 6c 64 20 74 68 69 6e | 6b 20 6f 66 20 74 68 61 |uld thin|k of tha|
|00000c30| 74 27 73 20 69 6e 74 65 | 72 65 73 74 69 6e 67 20 |t's inte|resting |
|00000c40| 74 6f 20 6d 65 2e 20 20 | 4c 6f 61 64 0a 61 76 65 |to me. |Load.ave|
|00000c50| 72 61 67 65 73 20 77 6f | 75 6c 64 20 62 65 20 6e |rages wo|uld be n|
|00000c60| 69 63 65 2c 20 62 75 74 | 20 49 20 63 6f 75 6c 64 |ice, but| I could|
|00000c70| 6e 27 74 20 66 69 6e 64 | 20 61 6e 79 20 6f 62 76 |n't find| any obv|
|00000c80| 69 6f 75 73 20 68 6f 6f | 6b 73 20 69 6e 20 2f 75 |ious hoo|ks in /u|
|00000c90| 6e 69 78 20 66 6f 72 20 | 74 68 61 74 2e 0a 0a 43 |nix for |that...C|
|00000ca0| 6f 6d 70 69 6c 69 6e 67 | 3a 20 20 6a 75 73 74 20 |ompiling|: just |
|00000cb0| 74 79 70 65 20 6d 61 6b | 65 2e 20 20 55 73 65 20 |type mak|e. Use |
|00000cc0| 6d 61 6b 65 20 69 6e 73 | 74 61 6c 6c 20 74 6f 20 |make ins|tall to |
|00000cd0| 6d 6f 76 65 20 74 68 65 | 20 65 78 65 63 75 74 61 |move the| executa|
|00000ce0| 62 6c 65 73 20 74 6f 20 | 74 68 65 0a 64 65 66 61 |bles to |the.defa|
|00000cf0| 75 6c 74 20 6c 6f 63 61 | 74 69 6f 6e 73 2e 20 20 |ult loca|tions. |
|00000d00| 4d 6f 64 69 66 79 20 74 | 68 65 20 4d 61 6b 65 66 |Modify t|he Makef|
|00000d10| 69 6c 65 20 61 6e 64 20 | 74 68 65 20 23 64 65 66 |ile and |the #def|
|00000d20| 69 6e 65 20 42 41 52 50 | 52 4f 47 20 66 6f 72 20 |ine BARP|ROG for |
|00000d30| 79 6f 75 72 20 73 69 74 | 65 2e 0a 49 20 75 73 65 |your sit|e..I use|
|00000d40| 20 74 68 65 20 6e 64 69 | 72 20 73 74 75 66 66 20 | the ndi|r stuff |
|00000d50| 28 49 20 67 6f 74 20 69 | 74 20 66 72 6f 6d 20 4e |(I got i|t from N|
|00000d60| 65 77 73 2c 20 49 20 64 | 6f 6e 27 74 20 6b 6e 6f |ews, I d|on't kno|
|00000d70| 77 20 77 68 6f 20 64 69 | 64 20 69 74 20 6f 72 69 |w who di|d it ori|
|00000d80| 67 69 6e 61 6c 6c 79 29 | 0a 74 6f 20 64 6f 20 64 |ginally)|.to do d|
|00000d90| 69 72 65 63 74 6f 72 79 | 20 73 63 61 6e 6e 69 6e |irectory| scannin|
|00000da0| 67 3b 20 69 74 20 73 68 | 6f 75 6c 64 20 62 65 20 |g; it sh|ould be |
|00000db0| 69 6e 20 74 68 65 20 64 | 69 73 74 72 69 62 75 74 |in the d|istribut|
|00000dc0| 69 6f 6e 2e 0a 0a 48 6f | 77 20 74 6f 20 75 73 65 |ion...Ho|w to use|
|00000dd0| 3a 20 20 73 74 61 72 74 | 6d 67 72 20 67 6f 65 73 |: start|mgr goes|
|00000de0| 20 69 6e 20 2f 65 74 63 | 2f 64 61 65 6d 6f 6e 73 | in /etc|/daemons|
|00000df0| 20 61 6e 64 20 6e 65 77 | 6d 67 72 20 67 6f 65 73 | and new|mgr goes|
|00000e00| 20 69 6e 74 6f 20 79 6f | 75 72 0a 6c 6f 63 61 6c | into yo|ur.local|
|00000e10| 20 65 78 65 63 75 74 61 | 62 6c 65 20 64 69 72 65 | executa|ble dire|
|00000e20| 63 74 6f 72 79 20 28 63 | 68 61 6e 67 65 20 61 20 |ctory (c|hange a |
|00000e30| 23 64 65 66 69 6e 65 20 | 69 6e 20 73 74 61 72 74 |#define |in start|
|00000e40| 6d 67 72 20 69 66 20 79 | 6f 75 20 64 6f 6e 27 74 |mgr if y|ou don't|
|00000e50| 0a 75 73 65 20 2f 75 73 | 72 2f 6c 6f 63 61 6c 29 |.use /us|r/local)|
|00000e60| 2e 20 20 59 6f 75 27 76 | 65 20 74 68 65 6e 20 65 |. You'v|e then e|
|00000e70| 69 74 68 65 72 20 67 6f | 74 20 74 6f 20 63 68 61 |ither go|t to cha|
|00000e80| 6e 67 65 20 2f 65 74 63 | 2f 72 63 20 28 73 6f 20 |nge /etc|/rc (so |
|00000e90| 69 74 20 64 6f 65 73 6e | 27 74 0a 73 74 61 72 74 |it doesn|'t.start|
|00000ea0| 20 73 6d 67 72 2c 77 6d | 67 72 20 61 6e 64 20 70 | smgr,wm|gr and p|
|00000eb0| 68 29 20 6f 72 20 70 75 | 74 20 61 20 73 63 72 69 |h) or pu|t a scri|
|00000ec0| 70 74 20 69 6e 20 2f 65 | 74 63 2f 64 61 65 6d 6f |pt in /e|tc/daemo|
|00000ed0| 6e 73 20 74 6f 20 6b 69 | 6c 6c 20 74 68 65 6d 20 |ns to ki|ll them |
|00000ee0| 6f 66 66 2e 0a 49 66 20 | 79 6f 75 20 64 6f 6e 27 |off..If |you don'|
|00000ef0| 74 20 6b 6e 6f 77 20 61 | 62 6f 75 74 20 2f 65 74 |t know a|bout /et|
|00000f00| 63 2f 72 63 20 61 6e 64 | 20 2f 65 74 63 2f 64 61 |c/rc and| /etc/da|
|00000f10| 65 6d 6f 6e 73 2c 20 6d | 61 79 62 65 20 79 6f 75 |emons, m|aybe you|
|00000f20| 20 73 68 6f 75 6c 64 6e | 27 74 0a 62 65 20 64 6f | shouldn|'t.be do|
|00000f30| 69 6e 67 20 74 68 69 73 | 2e 2e 2e 20 3a 2d 29 0a |ing this|... :-).|
|00000f40| 0a 55 73 65 20 74 68 65 | 20 53 68 69 66 74 2d 50 |.Use the| Shift-P|
|00000f50| 72 69 6e 74 20 6b 65 79 | 20 74 6f 20 64 69 73 70 |rint key| to disp|
|00000f60| 6c 61 79 20 74 68 65 20 | 6c 69 73 74 20 6f 66 20 |lay the |list of |
|00000f70| 6b 65 79 20 6d 61 70 70 | 69 6e 67 73 2c 20 6f 6e |key mapp|ings, on|
|00000f80| 63 65 20 74 68 65 20 70 | 72 6f 67 72 61 6d 0a 69 |ce the p|rogram.i|
|00000f90| 73 20 73 74 61 72 74 65 | 64 2e 0a 0a 4f 70 74 69 |s starte|d...Opti|
|00000fa0| 6f 6e 61 6c 6c 79 2c 20 | 79 6f 75 20 2a 63 61 6e |onally, |you *can|
|00000fb0| 2a 20 72 75 6e 20 73 74 | 61 72 74 6d 67 72 20 62 |* run st|artmgr b|
|00000fc0| 79 20 68 61 6e 64 3b 20 | 49 20 64 69 64 20 66 6f |y hand; |I did fo|
|00000fd0| 72 20 74 65 73 74 69 6e | 67 2e 20 20 54 68 65 20 |r testin|g. The |
|00000fe0| 6f 6e 6c 79 0a 74 68 69 | 6e 67 20 74 6f 20 6e 6f |only.thi|ng to no|
|00000ff0| 74 65 20 68 65 72 65 20 | 69 73 20 74 68 61 74 20 |te here |is that |
|00001000| 79 6f 75 72 20 63 75 72 | 72 65 6e 74 20 77 69 6e |your cur|rent win|
|00001010| 64 6f 77 20 77 69 6e 64 | 73 20 75 70 20 62 65 69 |dow wind|s up bei|
|00001020| 6e 67 20 74 68 65 20 6f | 6e 65 0a 74 68 61 74 20 |ng the o|ne.that |
|00001030| 73 74 61 72 74 6d 67 72 | 20 63 72 65 61 74 65 73 |startmgr| creates|
|00001040| 20 66 6f 72 20 74 68 65 | 20 73 74 61 74 75 73 20 | for the| status |
|00001050| 6c 69 6e 65 3b 20 49 20 | 63 6f 75 6c 64 6e 27 74 |line; I |couldn't|
|00001060| 20 66 69 6e 64 20 61 20 | 77 61 79 20 74 6f 20 73 | find a |way to s|
|00001070| 61 79 2c 0a 22 6d 61 6b | 65 20 74 68 65 20 6c 61 |ay,."mak|e the la|
|00001080| 73 74 20 77 69 6e 64 6f | 77 20 74 68 65 20 63 75 |st windo|w the cu|
|00001090| 72 72 65 6e 74 20 6f 6e | 65 2e 22 3b 20 6f 72 20 |rrent on|e."; or |
|000010a0| 61 74 20 6c 65 61 73 74 | 2c 20 6f 6e 65 20 74 68 |at least|, one th|
|000010b0| 61 74 20 49 20 63 6f 75 | 6c 64 20 67 65 74 0a 74 |at I cou|ld get.t|
|000010c0| 6f 20 77 6f 72 6b 20 69 | 6e 20 35 20 6d 69 6e 75 |o work i|n 5 minu|
|000010d0| 74 65 73 2e 2e 2e 20 20 | 54 6f 20 67 65 74 20 62 |tes... |To get b|
|000010e0| 61 63 6b 20 74 6f 20 79 | 6f 75 72 20 6e 6f 72 6d |ack to y|our norm|
|000010f0| 61 6c 20 77 69 6e 64 6f | 77 2c 20 6a 75 73 74 20 |al windo|w, just |
|00001100| 75 73 65 0a 53 75 73 70 | 65 6e 64 2f 52 65 73 75 |use.Susp|end/Resu|
|00001110| 6d 65 2e 0a 0a 4b 6e 6f | 77 6e 20 62 75 67 73 3a |me...Kno|wn bugs:|
|00001120| 20 20 45 76 65 72 79 20 | 6f 6e 63 65 20 69 6e 20 | Every |once in |
|00001130| 61 20 77 68 69 6c 65 2c | 20 6c 69 6b 65 20 69 66 |a while,| like if|
|00001140| 20 79 6f 75 20 6c 6f 67 | 20 6f 75 74 20 2a 6a 75 | you log| out *ju|
|00001150| 73 74 2a 20 61 73 20 74 | 68 65 20 64 69 73 70 6c |st* as t|he displ|
|00001160| 61 79 0a 69 73 20 75 70 | 64 61 74 69 6e 67 2c 20 |ay.is up|dating, |
|00001170| 69 74 20 67 65 74 73 20 | 63 6f 6e 66 75 73 65 64 |it gets |confused|
|00001180| 20 61 73 20 74 6f 20 77 | 68 61 74 20 77 69 6e 64 | as to w|hat wind|
|00001190| 6f 77 20 79 6f 75 27 72 | 65 20 72 65 61 6c 6c 79 |ow you'r|e really|
|000011a0| 20 69 6e 2e 20 20 49 74 | 20 68 61 73 20 65 76 65 | in. It| has eve|
|000011b0| 6e 0a 62 65 65 6e 20 6b | 6e 6f 77 6e 20 74 6f 20 |n.been k|nown to |
|000011c0| 64 69 73 70 6c 61 79 20 | 22 77 2d 31 22 20 28 77 |display |"w-1" (w|
|000011d0| 68 6f 20 6d 65 2c 20 63 | 68 65 63 6b 20 66 6f 72 |ho me, c|heck for|
|000011e0| 20 65 72 72 6f 72 73 20 | 6f 6e 20 61 20 73 79 73 | errors |on a sys|
|000011f0| 74 65 6d 20 63 61 6c 6c | 3f 29 2e 0a 41 6c 73 6f |tem call|?)..Also|
|00001200| 2c 20 74 68 65 20 70 72 | 6f 63 65 73 73 20 73 74 |, the pr|ocess st|
|00001210| 61 74 75 73 20 66 65 61 | 74 75 72 65 20 70 72 6f |atus fea|ture pro|
|00001220| 62 61 62 6c 79 20 63 6f | 75 6c 64 20 66 69 6e 64 |bably co|uld find|
|00001230| 20 61 20 62 65 74 74 65 | 72 20 77 61 79 20 74 6f | a bette|r way to|
|00001240| 20 64 65 74 65 72 6d 69 | 6e 65 0a 61 20 70 72 6f | determi|ne.a pro|
|00001250| 63 65 73 73 27 73 20 63 | 6f 6e 74 72 6f 6c 6c 69 |cess's c|ontrolli|
|00001260| 6e 67 20 74 65 72 6d 69 | 6e 61 6c 3b 20 69 74 20 |ng termi|nal; it |
|00001270| 68 61 73 20 61 20 74 65 | 6e 64 65 6e 63 79 20 74 |has a te|ndency t|
|00001280| 6f 20 63 6f 6d 65 20 75 | 70 20 77 69 74 68 20 74 |o come u|p with t|
|00001290| 68 69 6e 67 73 0a 6c 69 | 6b 65 20 2f 64 65 76 2f |hings.li|ke /dev/|
|000012a0| 6e 75 6c 6c 2e 0a 0a 50 | 6f 74 65 6e 74 69 61 6c |null...P|otential|
|000012b0| 20 62 75 67 73 3a 20 20 | 50 72 65 74 74 79 20 6d | bugs: |Pretty m|
|000012c0| 75 63 68 20 61 6c 6c 20 | 6f 66 20 74 68 65 20 65 |uch all |of the e|
|000012d0| 78 74 65 6e 64 65 64 2d | 73 74 61 74 75 73 20 72 |xtended-|status r|
|000012e0| 6f 75 74 69 6e 65 73 20 | 61 72 65 0a 69 6d 70 6c |outines |are.impl|
|000012f0| 65 6d 65 6e 74 65 64 20 | 77 69 74 68 6f 75 74 20 |emented |without |
|00001300| 61 6e 79 20 65 72 72 6f | 72 2d 63 68 65 63 6b 69 |any erro|r-checki|
|00001310| 6e 67 2e 2e 2e 0a 0a 4c | 61 73 74 20 6e 6f 74 65 |ng.....L|ast note|
|00001320| 3a 20 20 74 68 69 73 20 | 73 74 75 66 66 20 69 73 |: this |stuff is|
|00001330| 20 63 6f 70 79 72 69 67 | 68 74 65 64 20 77 69 74 | copyrig|hted wit|
|00001340| 68 20 66 72 65 65 20 72 | 65 64 69 73 74 72 69 62 |h free r|edistrib|
|00001350| 75 74 69 6f 6e 20 70 65 | 72 6d 69 74 74 65 64 2e |ution pe|rmitted.|
|00001360| 0a 49 20 64 6f 6e 27 74 | 20 72 65 61 6c 6c 79 20 |.I don't| really |
|00001370| 74 68 69 6e 6b 20 74 68 | 61 74 20 74 68 69 73 20 |think th|at this |
|00001380| 69 73 20 74 68 65 20 73 | 6f 72 74 20 6f 66 20 74 |is the s|ort of t|
|00001390| 68 69 6e 67 20 74 68 61 | 74 20 6e 65 65 64 73 20 |hing tha|t needs |
|000013a0| 6f 72 20 77 61 72 72 61 | 6e 74 73 0a 73 63 61 64 |or warra|nts.scad|
|000013b0| 73 20 6f 66 20 73 75 70 | 70 6f 72 74 2c 20 73 6f |s of sup|port, so|
|000013c0| 20 49 27 6d 20 6e 6f 74 | 20 70 72 6f 6d 69 73 69 | I'm not| promisi|
|000013d0| 6e 67 20 74 6f 20 64 6f | 20 73 6f 3b 20 68 6f 77 |ng to do| so; how|
|000013e0| 65 76 65 72 2c 20 49 20 | 77 6f 75 6c 64 20 6c 69 |ever, I |would li|
|000013f0| 6b 65 20 74 6f 0a 73 65 | 65 20 61 6e 79 20 63 68 |ke to.se|e any ch|
|00001400| 61 6e 67 65 73 20 74 68 | 61 74 20 61 6e 79 6f 6e |anges th|at anyon|
|00001410| 65 20 6d 61 6b 65 73 2e | 0a 0a 43 6f 6d 6d 65 6e |e makes.|..Commen|
|00001420| 74 73 20 77 65 6c 63 6f | 6d 65 2c 20 61 73 20 6c |ts welco|me, as l|
|00001430| 6f 6e 67 20 61 73 20 74 | 68 65 79 20 61 72 65 20 |ong as t|hey are |
|00001440| 6f 74 68 65 72 20 74 68 | 61 6e 2c 20 22 57 68 61 |other th|an, "Wha|
|00001450| 74 20 6b 69 6e 64 20 6f | 66 20 69 64 69 6f 74 0a |t kind o|f idiot.|
|00001460| 72 75 6e 73 20 77 69 74 | 68 6f 75 74 20 73 6d 67 |runs wit|hout smg|
|00001470| 72 2c 20 77 6d 67 72 20 | 61 6e 64 20 70 68 3f 22 |r, wmgr |and ph?"|
|00001480| 0a 0a 20 20 20 20 20 5c | 73 63 6f 74 74 0a 20 20 |.. \|scott. |
|00001490| 20 20 20 39 20 4a 61 6e | 20 31 39 38 38 0a 0a 53 | 9 Jan| 1988..S|
|000014a0| 48 41 52 5f 45 4f 46 0a | 66 69 20 23 20 65 6e 64 |HAR_EOF.|fi # end|
|000014b0| 20 6f 66 20 6f 76 65 72 | 77 72 69 74 69 6e 67 20 | of over|writing |
|000014c0| 63 68 65 63 6b 0a 69 66 | 20 74 65 73 74 20 2d 66 |check.if| test -f|
|000014d0| 20 27 4d 61 6b 65 66 69 | 6c 65 27 0a 74 68 65 6e | 'Makefi|le'.then|
|000014e0| 0a 20 20 20 20 20 20 20 | 65 63 68 6f 20 73 68 61 |. |echo sha|
|000014f0| 72 3a 20 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: will |not over|
|00001500| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00001510| 66 69 6c 65 20 22 27 4d | 61 6b 65 66 69 6c 65 27 |file "'M|akefile'|
|00001520| 22 0a 65 6c 73 65 0a 63 | 61 74 20 3c 3c 20 5c 53 |".else.c|at << \S|
|00001530| 48 41 52 5f 45 4f 46 20 | 3e 20 27 4d 61 6b 65 66 |HAR_EOF |> 'Makef|
|00001540| 69 6c 65 27 0a 4c 4f 43 | 41 4c 44 49 52 20 3d 20 |ile'.LOC|ALDIR = |
|00001550| 2f 75 73 72 2f 6c 6f 63 | 61 6c 0a 0a 61 6c 6c 3a |/usr/loc|al..all:|
|00001560| 20 6e 65 77 6d 67 72 20 | 73 74 61 72 74 6d 67 72 | newmgr |startmgr|
|00001570| 0a 0a 73 74 61 72 74 6d | 67 72 3a 20 73 74 61 72 |..startm|gr: star|
|00001580| 74 6d 67 72 2e 63 0a 09 | 63 63 20 2d 4f 20 2d 73 |tmgr.c..|cc -O -s|
|00001590| 20 73 74 61 72 74 6d 67 | 72 2e 63 20 2d 6f 20 73 | startmg|r.c -o s|
|000015a0| 74 61 72 74 6d 67 72 0a | 0a 6e 65 77 6d 67 72 3a |tartmgr.|.newmgr:|
|000015b0| 20 6e 65 77 6d 67 72 2e | 6f 20 6e 64 69 72 2e 6f | newmgr.|o ndir.o|
|000015c0| 0a 09 63 63 20 2d 4f 20 | 2d 73 20 6e 65 77 6d 67 |..cc -O |-s newmg|
|000015d0| 72 2e 6f 20 6e 64 69 72 | 2e 6f 20 2d 6f 20 6e 65 |r.o ndir|.o -o ne|
|000015e0| 77 6d 67 72 0a 0a 69 6e | 73 74 61 6c 6c 3a 20 6e |wmgr..in|stall: n|
|000015f0| 65 77 6d 67 72 20 73 74 | 61 72 74 6d 67 72 0a 09 |ewmgr st|artmgr..|
|00001600| 6d 76 20 6e 65 77 6d 67 | 72 20 4c 4f 43 41 4c 44 |mv newmg|r LOCALD|
|00001610| 49 52 0a 09 6d 76 20 73 | 74 61 72 74 6d 67 72 20 |IR..mv s|tartmgr |
|00001620| 2f 65 74 63 2f 64 61 65 | 6d 6f 6e 73 0a 0a 63 6c |/etc/dae|mons..cl|
|00001630| 65 61 6e 3a 0a 09 72 6d | 20 2d 66 20 2a 2e 6f 20 |ean:..rm| -f *.o |
|00001640| 73 74 61 72 74 6d 67 72 | 20 6e 65 77 6d 67 72 0a |startmgr| newmgr.|
|00001650| 53 48 41 52 5f 45 4f 46 | 0a 66 69 20 23 20 65 6e |SHAR_EOF|.fi # en|
|00001660| 64 20 6f 66 20 6f 76 65 | 72 77 72 69 74 69 6e 67 |d of ove|rwriting|
|00001670| 20 63 68 65 63 6b 0a 69 | 66 20 74 65 73 74 20 2d | check.i|f test -|
|00001680| 66 20 27 6e 65 77 6d 67 | 72 2e 63 27 0a 74 68 65 |f 'newmg|r.c'.the|
|00001690| 6e 0a 20 20 20 20 20 20 | 20 65 63 68 6f 20 73 68 |n. | echo sh|
|000016a0| 61 72 3a 20 77 69 6c 6c | 20 6e 6f 74 20 6f 76 65 |ar: will| not ove|
|000016b0| 72 2d 77 72 69 74 65 20 | 65 78 69 73 74 69 6e 67 |r-write |existing|
|000016c0| 20 66 69 6c 65 20 22 27 | 6e 65 77 6d 67 72 2e 63 | file "'|newmgr.c|
|000016d0| 27 22 0a 65 6c 73 65 0a | 63 61 74 20 3c 3c 20 5c |'".else.|cat << \|
|000016e0| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 6e 65 77 6d |SHAR_EOF| > 'newm|
|000016f0| 67 72 2e 63 27 0a 2f 2a | 09 6e 65 77 6d 67 72 3a |gr.c'./*|.newmgr:|
|00001700| 20 20 4c 6f 6f 70 20 66 | 6f 72 65 76 65 72 2c 20 | Loop f|orever, |
|00001710| 70 72 69 6e 74 69 6e 67 | 20 61 20 73 74 61 74 75 |printing| a statu|
|00001720| 73 20 64 69 73 70 6c 61 | 79 20 61 6e 64 20 63 68 |s displa|y and ch|
|00001730| 65 63 6b 69 6e 67 20 74 | 68 65 0a 09 53 75 73 70 |ecking t|he..Susp|
|00001740| 65 6e 64 2c 20 52 65 73 | 75 6d 65 20 61 6e 64 20 |end, Res|ume and |
|00001750| 73 68 69 66 74 65 64 20 | 46 75 6e 63 74 69 6f 6e |shifted |Function|
|00001760| 20 4b 65 79 73 2e 20 20 | 4d 65 61 6e 74 20 74 6f | Keys. |Meant to|
|00001770| 20 62 65 20 75 73 65 64 | 20 6f 6e 20 74 68 65 0a | be used| on the.|
|00001780| 09 74 6f 70 20 6c 69 6e | 65 20 6f 66 20 61 20 55 |.top lin|e of a U|
|00001790| 6e 69 78 2d 50 43 20 28 | 37 33 30 30 2f 33 42 31 |nix-PC (|7300/3B1|
|000017a0| 29 20 73 63 72 65 65 6e | 20 74 68 61 74 20 68 61 |) screen| that ha|
|000017b0| 73 20 68 61 64 20 74 68 | 65 20 50 68 6f 6e 65 20 |s had th|e Phone |
|000017c0| 4d 61 6e 61 67 65 72 2c | 0a 09 53 74 61 74 75 73 |Manager,|..Status|
|000017d0| 20 4d 61 6e 61 67 65 72 | 20 61 6e 64 20 57 69 6e | Manager| and Win|
|000017e0| 64 6f 77 20 4d 61 6e 61 | 67 65 72 20 64 69 73 61 |dow Mana|ger disa|
|000017f0| 62 6c 65 64 2e 20 20 57 | 68 61 74 20 69 74 20 73 |bled. W|hat it s|
|00001800| 68 6f 77 73 3a 0a 0a 09 | 2d 20 50 68 6f 6e 65 20 |hows:...|- Phone |
|00001810| 6c 69 6e 65 20 73 74 61 | 74 65 73 0a 09 09 6f 20 |line sta|tes...o |
|00001820| 49 64 6c 65 20 2d 20 63 | 6f 6d 70 6c 65 74 65 6c |Idle - c|ompletel|
|00001830| 79 20 66 72 65 65 20 6c | 69 6e 65 0a 09 09 6f 20 |y free l|ine...o |
|00001840| 41 6e 73 72 20 2d 20 63 | 6f 6d 70 75 74 65 72 20 |Ansr - c|omputer |
|00001850| 61 6e 73 77 65 72 69 6e | 67 20 6c 69 6e 65 20 28 |answerin|g line (|
|00001860| 67 65 74 74 79 20 6a 6f | 62 29 0a 09 09 6f 20 4d |getty jo|b)...o M|
|00001870| 61 63 68 20 2d 20 69 6e | 63 6f 6d 69 6e 67 20 6d |ach - in|coming m|
|00001880| 61 63 68 69 6e 65 0a 09 | 09 6f 20 55 73 65 72 20 |achine..|.o User |
|00001890| 2d 20 69 6e 63 6f 6d 69 | 6e 67 20 75 73 65 72 0a |- incomi|ng user.|
|000018a0| 09 09 6f 20 43 61 6c 6c | 20 2d 20 61 6e 79 20 6f |..o Call| - any o|
|000018b0| 75 74 62 6f 75 6e 64 0a | 09 2d 20 42 6f 6f 74 20 |utbound.|.- Boot |
|000018c0| 64 61 74 65 20 61 6e 64 | 20 74 69 6d 65 0a 09 2d |date and| time..-|
|000018d0| 20 43 75 72 72 65 6e 74 | 20 72 75 6e 20 6c 65 76 | Current| run lev|
|000018e0| 65 6c 0a 09 2d 20 43 75 | 72 72 65 6e 74 20 64 61 |el..- Cu|rrent da|
|000018f0| 74 65 20 61 6e 64 20 74 | 69 6d 65 0a 09 2d 20 4e |te and t|ime..- N|
|00001900| 75 6d 62 65 72 20 6f 66 | 20 75 73 65 72 73 0a 0a |umber of| users..|
|00001910| 09 57 68 65 6e 20 53 75 | 73 70 65 6e 64 20 69 73 |.When Su|spend is|
|00001920| 20 68 69 74 2c 20 69 74 | 20 6d 61 6b 65 73 20 74 | hit, it| makes t|
|00001930| 68 65 20 6e 65 78 74 20 | 77 69 6e 64 6f 77 20 63 |he next |window c|
|00001940| 75 72 72 65 6e 74 3b 20 | 52 65 73 75 6d 65 0a 09 |urrent; |Resume..|
|00001950| 6d 61 6b 65 73 20 74 68 | 65 20 6c 61 73 74 20 77 |makes th|e last w|
|00001960| 69 6e 64 6f 77 20 63 75 | 72 72 65 6e 74 2e 0a 0a |indow cu|rrent...|
|00001970| 09 54 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 66 |.The fol|lowing f|
|00001980| 75 6e 63 74 69 6f 6e 73 | 20 61 72 65 20 6d 61 70 |unctions| are map|
|00001990| 70 65 64 20 74 6f 20 74 | 68 65 20 66 75 6e 63 74 |ped to t|he funct|
|000019a0| 69 6f 6e 20 6b 65 79 73 | 3a 0a 0a 09 53 68 69 66 |ion keys|:...Shif|
|000019b0| 74 2d 46 31 3a 20 20 70 | 72 6f 63 65 73 73 20 64 |t-F1: p|rocess d|
|000019c0| 69 73 70 6c 61 79 2c 20 | 73 69 6d 69 6c 61 72 20 |isplay, |similar |
|000019d0| 74 6f 20 27 70 73 20 2d | 65 66 27 0a 09 53 68 69 |to 'ps -|ef'..Shi|
|000019e0| 66 74 2d 46 32 3a 20 20 | 75 74 6d 70 20 64 69 73 |ft-F2: |utmp dis|
|000019f0| 70 6c 61 79 2c 20 6c 69 | 6b 65 20 27 77 68 6f 27 |play, li|ke 'who'|
|00001a00| 0a 09 53 68 69 66 74 2d | 46 33 3a 20 20 6c 69 73 |..Shift-|F3: lis|
|00001a10| 74 73 20 55 55 43 50 20 | 4c 43 4b 2e 2e 20 66 69 |ts UUCP |LCK.. fi|
|00001a20| 6c 65 73 2c 20 69 66 20 | 61 6e 79 0a 09 53 68 69 |les, if |any..Shi|
|00001a30| 66 74 2d 46 34 3a 20 20 | 64 69 72 65 63 74 6f 72 |ft-F4: |director|
|00001a40| 79 20 6f 66 20 2f 75 73 | 72 2f 6d 61 69 6c 0a 09 |y of /us|r/mail..|
|00001a50| 53 68 69 66 74 2d 46 35 | 3a 20 20 52 6f 6f 74 20 |Shift-F5|: Root |
|00001a60| 66 69 6c 65 73 79 73 74 | 65 6d 20 66 72 65 65 73 |filesyst|em frees|
|00001a70| 70 61 63 65 20 61 6e 64 | 20 66 72 65 65 20 69 6e |pace and| free in|
|00001a80| 6f 64 65 73 0a 09 53 68 | 69 66 74 2d 46 36 3a 20 |odes..Sh|ift-F6: |
|00001a90| 20 6c 69 73 74 73 20 55 | 55 43 50 20 43 2e 20 66 | lists U|UCP C. f|
|00001aa0| 69 6c 65 73 2c 20 69 66 | 20 61 6e 79 0a 09 53 68 |iles, if| any..Sh|
|00001ab0| 69 66 74 2d 46 37 3a 20 | 20 6c 69 73 74 73 20 55 |ift-F7: | lists U|
|00001ac0| 55 43 50 20 58 2e 20 66 | 69 6c 65 73 2c 20 69 66 |UCP X. f|iles, if|
|00001ad0| 20 61 6e 79 0a 09 53 68 | 69 66 74 2d 46 38 3a 20 | any..Sh|ift-F8: |
|00001ae0| 20 64 69 72 65 63 74 6f | 72 79 20 6f 66 20 2f 75 | directo|ry of /u|
|00001af0| 73 72 2f 73 70 6f 6f 6c | 2f 75 75 63 70 0a 0a 09 |sr/spool|/uucp...|
|00001b00| 54 68 69 73 20 69 73 20 | 73 74 61 72 74 65 64 20 |This is |started |
|00001b10| 62 79 20 73 74 61 72 74 | 6d 67 72 20 28 77 68 69 |by start|mgr (whi|
|00001b20| 63 68 20 73 68 6f 75 6c | 64 20 62 65 20 69 6e 63 |ch shoul|d be inc|
|00001b30| 6c 75 64 65 64 20 69 6e | 20 61 6e 79 0a 09 64 69 |luded in| any..di|
|00001b40| 73 74 72 69 62 75 74 69 | 6f 6e 29 20 73 6f 20 74 |stributi|on) so t|
|00001b50| 68 61 74 20 74 68 65 20 | 66 6f 72 6b 2f 65 78 65 |hat the |fork/exe|
|00001b60| 63 2f 6f 70 65 6e 20 63 | 6f 64 65 20 64 6f 65 73 |c/open c|ode does|
|00001b70| 6e 27 74 20 68 61 76 65 | 20 74 6f 20 62 65 0a 09 |n't have| to be..|
|00001b80| 63 61 72 72 69 65 64 20 | 61 72 6f 75 6e 64 20 77 |carried |around w|
|00001b90| 69 74 68 20 74 68 69 73 | 20 70 72 6f 67 72 61 6d |ith this| program|
|00001ba0| 2e 0a 0a 09 54 68 65 20 | 70 72 6f 63 65 73 73 20 |....The |process |
|00001bb0| 74 61 62 6c 65 20 73 74 | 75 66 66 20 69 73 20 68 |table st|uff is h|
|00001bc0| 65 61 76 69 6c 79 20 69 | 6e 73 70 69 72 65 64 20 |eavily i|nspired |
|00001bd0| 62 79 20 74 68 65 20 27 | 66 75 73 65 72 2e 63 27 |by the '|fuser.c'|
|00001be0| 20 70 72 6f 67 72 61 6d | 0a 09 70 6f 73 74 65 64 | program|..posted|
|00001bf0| 20 74 6f 20 74 68 65 20 | 55 73 65 6e 65 74 20 62 | to the |Usenet b|
|00001c00| 79 20 4d 69 63 68 61 65 | 6c 20 27 46 6f 72 64 27 |y Michae|l 'Ford'|
|00001c10| 20 44 69 74 74 6f 2e 0a | 0a 09 54 68 69 73 20 73 | Ditto..|..This s|
|00001c20| 6f 66 74 77 61 72 65 20 | 69 73 20 43 6f 70 79 72 |oftware |is Copyr|
|00001c30| 69 67 68 74 20 28 63 29 | 20 31 39 38 37 20 62 79 |ight (c)| 1987 by|
|00001c40| 20 53 63 6f 74 74 20 48 | 61 7a 65 6e 20 4d 75 65 | Scott H|azen Mue|
|00001c50| 6c 6c 65 72 2e 0a 20 0a | 09 50 65 72 6d 69 73 73 |ller.. .|.Permiss|
|00001c60| 69 6f 6e 20 69 73 20 68 | 65 72 65 62 79 20 67 72 |ion is h|ereby gr|
|00001c70| 61 6e 74 65 64 20 74 6f | 20 63 6f 70 79 2c 20 72 |anted to| copy, r|
|00001c80| 65 70 72 6f 64 75 63 65 | 2c 20 72 65 64 69 73 74 |eproduce|, redist|
|00001c90| 72 69 62 75 74 65 20 6f | 72 0a 09 6f 74 68 65 72 |ribute o|r..other|
|00001ca0| 77 69 73 65 20 75 73 65 | 20 74 68 69 73 20 73 6f |wise use| this so|
|00001cb0| 66 74 77 61 72 65 20 61 | 73 20 6c 6f 6e 67 20 61 |ftware a|s long a|
|00001cc0| 73 3a 20 74 68 65 72 65 | 20 69 73 20 6e 6f 20 6d |s: there| is no m|
|00001cd0| 6f 6e 65 74 61 72 79 0a | 09 70 72 6f 66 69 74 20 |onetary.|.profit |
|00001ce0| 67 61 69 6e 65 64 20 73 | 70 65 63 69 66 69 63 61 |gained s|pecifica|
|00001cf0| 6c 6c 79 20 66 72 6f 6d | 20 74 68 65 20 75 73 65 |lly from| the use|
|00001d00| 20 6f 72 20 72 65 70 72 | 6f 64 75 63 74 69 6f 6e | or repr|oduction|
|00001d10| 20 6f 72 20 74 68 69 73 | 0a 09 73 6f 66 74 77 61 | or this|..softwa|
|00001d20| 72 65 2c 20 69 74 20 69 | 73 20 6e 6f 74 20 73 6f |re, it i|s not so|
|00001d30| 6c 64 2c 20 72 65 6e 74 | 65 64 2c 20 74 72 61 64 |ld, rent|ed, trad|
|00001d40| 65 64 20 6f 72 20 6f 74 | 68 65 72 77 69 73 65 20 |ed or ot|herwise |
|00001d50| 6d 61 72 6b 65 74 65 64 | 2c 20 61 6e 64 0a 09 74 |marketed|, and..t|
|00001d60| 68 69 73 20 63 6f 70 79 | 72 69 67 68 74 20 6e 6f |his copy|right no|
|00001d70| 74 69 63 65 20 69 73 20 | 69 6e 63 6c 75 64 65 64 |tice is |included|
|00001d80| 20 70 72 6f 6d 69 6e 65 | 6e 74 6c 79 20 69 6e 20 | promine|ntly in |
|00001d90| 61 6e 79 20 63 6f 70 79 | 0a 09 6d 61 64 65 2e 0a |any copy|..made..|
|00001da0| 0a 09 54 68 65 20 61 75 | 74 68 6f 72 20 6d 61 6b |..The au|thor mak|
|00001db0| 65 20 6e 6f 20 63 6c 61 | 69 6d 73 20 61 73 20 74 |e no cla|ims as t|
|00001dc0| 6f 20 74 68 65 20 66 69 | 74 6e 65 73 73 20 6f 72 |o the fi|tness or|
|00001dd0| 20 63 6f 72 72 65 63 74 | 6e 65 73 73 20 6f 66 0a | correct|ness of.|
|00001de0| 09 74 68 69 73 20 73 6f | 66 74 77 61 72 65 20 66 |.this so|ftware f|
|00001df0| 6f 72 20 61 6e 79 20 75 | 73 65 20 77 68 61 74 73 |or any u|se whats|
|00001e00| 6f 65 76 65 72 2c 20 61 | 6e 64 20 69 74 20 69 73 |oever, a|nd it is|
|00001e10| 20 70 72 6f 76 69 64 65 | 64 20 61 73 20 69 73 2e | provide|d as is.|
|00001e20| 20 0a 09 41 6e 79 20 75 | 73 65 20 6f 66 20 74 68 | ..Any u|se of th|
|00001e30| 69 73 20 73 6f 66 74 77 | 61 72 65 20 69 73 20 61 |is softw|are is a|
|00001e40| 74 20 74 68 65 20 75 73 | 65 72 27 73 20 6f 77 6e |t the us|er's own|
|00001e50| 20 72 69 73 6b 2e 0a 0a | 09 28 43 6f 70 79 72 69 | risk...|.(Copyri|
|00001e60| 67 68 74 20 6e 6f 74 69 | 63 65 20 63 6f 75 72 74 |ght noti|ce court|
|00001e70| 65 73 79 20 6f 66 20 4e | 65 77 73 20 32 2e 31 31 |esy of N|ews 2.11|
|00001e80| 20 3a 2d 29 0a 0a 09 41 | 64 64 69 74 69 6f 6e 61 | :-)...A|dditiona|
|00001e90| 6c 6c 79 3a 20 20 79 6f | 75 20 62 72 65 61 6b 20 |lly: yo|u break |
|00001ea0| 69 74 2c 20 79 6f 75 20 | 62 6f 75 67 68 74 20 69 |it, you |bought i|
|00001eb0| 74 2e 20 20 49 27 76 65 | 20 6c 69 73 74 65 64 20 |t. I've| listed |
|00001ec0| 74 68 65 20 70 72 6f 62 | 6c 65 6d 73 0a 09 74 68 |the prob|lems..th|
|00001ed0| 61 74 20 49 20 6b 6e 6f | 77 20 6f 66 20 69 6e 20 |at I kno|w of in |
|00001ee0| 63 6f 6d 6d 65 6e 74 73 | 20 69 6e 20 74 68 65 20 |comments| in the |
|00001ef0| 63 6f 64 65 3b 20 69 66 | 20 79 6f 75 20 63 6f 6d |code; if| you com|
|00001f00| 65 20 75 70 20 77 69 74 | 68 20 66 69 78 65 73 2c |e up wit|h fixes,|
|00001f10| 20 49 27 64 0a 09 6c 69 | 6b 65 20 74 6f 20 73 65 | I'd..li|ke to se|
|00001f20| 65 20 74 68 65 6d 2c 20 | 62 75 74 20 49 27 6d 20 |e them, |but I'm |
|00001f30| 6e 6f 74 20 70 6c 61 6e | 6e 69 6e 67 20 6f 6e 20 |not plan|ning on |
|00001f40| 73 75 70 70 6f 72 74 69 | 6e 67 20 61 6e 79 74 68 |supporti|ng anyth|
|00001f50| 69 6e 67 2e 20 20 49 74 | 27 73 0a 09 22 67 6f 6f |ing. It|'s.."goo|
|00001f60| 64 20 65 6e 6f 75 67 68 | 22 3b 20 74 68 61 74 27 |d enough|"; that'|
|00001f70| 73 20 61 6c 6c 20 74 68 | 61 74 20 49 27 6d 20 6c |s all th|at I'm l|
|00001f80| 6f 6f 6b 69 6e 67 20 66 | 6f 72 2e 09 2a 2f 0a 0a |ooking f|or..*/..|
|00001f90| 23 69 6e 63 6c 75 64 65 | 09 3c 73 74 64 69 6f 2e |#include|.<stdio.|
|00001fa0| 68 3e 0a 23 69 6e 63 6c | 75 64 65 09 3c 73 79 73 |h>.#incl|ude.<sys|
|00001fb0| 2f 74 79 70 65 73 2e 68 | 3e 0a 23 69 6e 63 6c 75 |/types.h|>.#inclu|
|00001fc0| 64 65 09 3c 73 79 73 2f | 70 68 6f 6e 65 2e 68 3e |de.<sys/|phone.h>|
|00001fd0| 0a 23 69 6e 63 6c 75 64 | 65 09 3c 73 79 73 2f 77 |.#includ|e.<sys/w|
|00001fe0| 69 6e 64 6f 77 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |indow.h>|.#includ|
|00001ff0| 65 09 3c 73 79 73 2f 73 | 69 67 6e 61 6c 2e 68 3e |e.<sys/s|ignal.h>|
|00002000| 0a 23 69 6e 63 6c 75 64 | 65 09 3c 73 79 73 2f 66 |.#includ|e.<sys/f|
|00002010| 69 6c 73 79 73 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |ilsys.h>|.#includ|
|00002020| 65 09 3c 73 79 73 2f 70 | 72 6f 63 2e 68 3e 0a 23 |e.<sys/p|roc.h>.#|
|00002030| 69 6e 63 6c 75 64 65 09 | 3c 73 79 73 2f 75 73 65 |include.|<sys/use|
|00002040| 72 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 09 3c 73 |r.h>.#in|clude.<s|
|00002050| 79 73 2f 73 79 73 6c 6f | 63 61 6c 2e 68 3e 0a 23 |ys/syslo|cal.h>.#|
|00002060| 69 6e 63 6c 75 64 65 09 | 3c 73 79 73 2f 74 75 6e |include.|<sys/tun|
|00002070| 65 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 09 3c 73 |e.h>.#in|clude.<s|
|00002080| 79 73 2f 73 74 61 74 2e | 68 3e 0a 23 69 6e 63 6c |ys/stat.|h>.#incl|
|00002090| 75 64 65 09 3c 66 63 6e | 74 6c 2e 68 3e 0a 23 69 |ude.<fcn|tl.h>.#i|
|000020a0| 6e 63 6c 75 64 65 09 3c | 74 69 6d 65 2e 68 3e 0a |nclude.<|time.h>.|
|000020b0| 23 69 6e 63 6c 75 64 65 | 09 3c 75 74 6d 70 2e 68 |#include|.<utmp.h|
|000020c0| 3e 0a 23 69 6e 63 6c 75 | 64 65 09 3c 6e 6c 69 73 |>.#inclu|de.<nlis|
|000020d0| 74 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 09 3c 70 |t.h>.#in|clude.<p|
|000020e0| 77 64 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 09 22 |wd.h>.#i|nclude."|
|000020f0| 6e 64 69 72 2e 68 22 0a | 0a 23 64 65 66 69 6e 65 |ndir.h".|.#define|
|00002100| 09 09 50 48 4f 4e 45 31 | 09 09 22 70 68 30 22 0a |..PHONE1|.."ph0".|
|00002110| 23 64 65 66 69 6e 65 09 | 09 50 48 4f 4e 45 32 09 |#define.|.PHONE2.|
|00002120| 09 22 70 68 31 22 0a 23 | 64 65 66 69 6e 65 09 09 |."ph1".#|define..|
|00002130| 49 44 4c 45 09 09 30 0a | 23 64 65 66 69 6e 65 09 |IDLE..0.|#define.|
|00002140| 09 41 4e 53 52 09 09 31 | 0a 23 64 65 66 69 6e 65 |.ANSR..1|.#define|
|00002150| 09 09 4d 41 43 48 09 09 | 32 0a 23 64 65 66 69 6e |..MACH..|2.#defin|
|00002160| 65 09 09 55 53 45 52 09 | 09 33 0a 23 64 65 66 69 |e..USER.|.3.#defi|
|00002170| 6e 65 09 09 43 41 4c 4c | 09 09 34 0a 23 64 65 66 |ne..CALL|..4.#def|
|00002180| 69 6e 65 09 09 42 41 52 | 46 4f 52 4d 09 09 22 25 |ine..BAR|FORM.."%|
|00002190| 73 31 20 25 73 32 20 7c | 20 55 70 20 53 69 6e 63 |s1 %s2 || Up Sinc|
|000021a0| 65 20 25 73 20 7c 20 25 | 73 20 7c 20 25 73 20 7c |e %s | %|s | %s ||
|000021b0| 20 25 64 20 55 73 65 72 | 73 20 7c 20 77 25 64 20 | %d User|s | w%d |
|000021c0| 5c 72 22 0a 23 64 65 66 | 69 6e 65 09 09 4d 41 43 |\r".#def|ine..MAC|
|000021d0| 48 4c 45 4e 09 09 31 35 | 0a 23 64 65 66 69 6e 65 |HLEN..15|.#define|
|000021e0| 09 09 4d 41 58 50 41 54 | 48 4c 45 4e 09 32 35 35 |..MAXPAT|HLEN.255|
|000021f0| 0a 23 64 65 66 69 6e 65 | 09 09 4c 4f 43 4b 44 49 |.#define|..LOCKDI|
|00002200| 52 09 09 22 2f 75 73 72 | 2f 73 70 6f 6f 6c 2f 75 |R.."/usr|/spool/u|
|00002210| 75 63 70 2f 22 0a 23 64 | 65 66 69 6e 65 09 09 4d |ucp/".#d|efine..M|
|00002220| 41 49 4c 44 49 52 09 09 | 22 2f 75 73 72 2f 6d 61 |AILDIR..|"/usr/ma|
|00002230| 69 6c 2f 22 0a 23 64 65 | 66 69 6e 65 09 09 44 45 |il/".#de|fine..DE|
|00002240| 56 44 49 52 09 09 22 2f | 64 65 76 2f 22 0a 23 64 |VDIR.."/|dev/".#d|
|00002250| 65 66 69 6e 65 09 09 4c | 4f 43 4b 50 52 45 46 49 |efine..L|OCKPREFI|
|00002260| 58 09 22 4c 43 4b 2e 2e | 22 0a 23 64 65 66 69 6e |X."LCK..|".#defin|
|00002270| 65 09 09 43 4f 4d 50 52 | 45 46 49 58 09 22 43 2e |e..COMPR|EFIX."C.|
|00002280| 22 0a 23 64 65 66 69 6e | 65 09 09 55 55 58 50 52 |".#defin|e..UUXPR|
|00002290| 45 46 49 58 09 22 58 2e | 22 0a 23 64 65 66 69 6e |EFIX."X.|".#defin|
|000022a0| 65 09 09 54 52 55 45 09 | 09 28 31 29 0a 23 64 65 |e..TRUE.|.(1).#de|
|000022b0| 66 69 6e 65 09 09 46 41 | 4c 53 45 09 09 28 30 29 |fine..FA|LSE..(0)|
|000022c0| 0a 23 64 65 66 69 6e 65 | 09 09 54 49 4d 45 46 4f |.#define|..TIMEFO|
|000022d0| 52 4d 09 22 25 2e 32 64 | 2f 25 2e 32 64 20 25 2e |RM."%.2d|/%.2d %.|
|000022e0| 32 64 3a 25 2e 32 64 22 | 0a 23 64 65 66 69 6e 65 |2d:%.2d"|.#define|
|000022f0| 09 09 54 49 43 4b 09 09 | 31 35 0a 23 64 65 66 69 |..TICK..|15.#defi|
|00002300| 6e 65 09 09 57 48 4f 53 | 4c 45 45 50 09 31 35 0a |ne..WHOS|LEEP.15.|
|00002310| 23 64 65 66 69 6e 65 09 | 09 4e 4f 57 48 45 52 45 |#define.|.NOWHERE|
|00002320| 09 09 30 0a 23 64 65 66 | 69 6e 65 09 09 46 4f 52 |..0.#def|ine..FOR|
|00002330| 57 41 52 44 09 09 31 0a | 23 64 65 66 69 6e 65 09 |WARD..1.|#define.|
|00002340| 09 42 41 43 4b 57 41 52 | 44 09 32 0a 23 64 65 66 |.BACKWAR|D.2.#def|
|00002350| 69 6e 65 09 09 48 45 52 | 45 09 09 33 0a 23 64 65 |ine..HER|E..3.#de|
|00002360| 66 69 6e 65 09 09 4d 49 | 4e 57 49 4e 09 09 31 0a |fine..MI|NWIN..1.|
|00002370| 23 64 65 66 69 6e 65 09 | 09 4d 41 58 57 49 4e 09 |#define.|.MAXWIN.|
|00002380| 09 31 32 0a 0a 63 68 61 | 72 09 2a 70 68 73 74 61 |.12..cha|r.*phsta|
|00002390| 74 5b 35 5d 20 3d 20 7b | 20 22 49 64 6c 65 22 2c |t[5] = {| "Idle",|
|000023a0| 20 22 41 6e 73 72 22 2c | 20 22 4d 61 63 68 22 2c | "Ansr",| "Mach",|
|000023b0| 20 22 55 73 65 72 22 2c | 20 22 43 61 6c 6c 22 20 | "User",| "Call" |
|000023c0| 7d 3b 0a 0a 6d 61 69 6e | 28 29 0a 7b 0a 69 6e 74 |};..main|().{.int|
|000023d0| 09 09 6e 75 73 65 72 73 | 3b 0a 63 68 61 72 09 63 |..nusers|;.char.c|
|000023e0| 75 72 74 69 6d 65 5b 32 | 36 5d 2c 20 62 6f 6f 74 |urtime[2|6], boot|
|000023f0| 74 69 6d 65 5b 32 36 5d | 2c 20 72 6c 5b 31 32 5d |time[26]|, rl[12]|
|00002400| 2c 20 6c 69 6e 65 5b 38 | 30 5d 2c 20 2a 66 6d 74 |, line[8|0], *fmt|
|00002410| 74 69 6d 65 28 29 3b 0a | 73 74 72 75 63 74 09 75 |time();.|struct.u|
|00002420| 74 6d 70 20 2a 75 74 2c | 20 2a 67 65 74 75 74 65 |tmp *ut,| *getute|
|00002430| 6e 74 28 29 3b 0a 6c 6f | 6e 67 09 74 65 6d 70 3b |nt();.lo|ng.temp;|
|00002440| 0a 0a 2f 2a 09 49 67 6e | 6f 72 65 20 6b 65 79 62 |../*.Ign|ore keyb|
|00002450| 6f 61 72 64 20 69 6e 74 | 65 72 72 75 70 74 20 73 |oard int|errupt s|
|00002460| 69 67 6e 61 6c 73 2e 09 | 2a 2f 0a 0a 73 69 67 6e |ignals..|*/..sign|
|00002470| 61 6c 28 20 53 49 47 49 | 4e 54 2c 20 53 49 47 5f |al( SIGI|NT, SIG_|
|00002480| 49 47 4e 20 29 3b 0a 73 | 69 67 6e 61 6c 28 20 53 |IGN );.s|ignal( S|
|00002490| 49 47 51 55 49 54 2c 20 | 53 49 47 5f 49 47 4e 20 |IGQUIT, |SIG_IGN |
|000024a0| 29 3b 0a 0a 2f 2a 09 4f | 70 65 6e 20 75 70 20 74 |);../*.O|pen up t|
|000024b0| 68 65 20 75 74 6d 70 20 | 66 69 6c 65 20 61 6e 64 |he utmp |file and|
|000024c0| 20 66 69 6e 64 20 74 68 | 65 20 62 6f 6f 74 20 74 | find th|e boot t|
|000024d0| 69 6d 65 3b 20 73 61 76 | 65 20 66 6f 72 20 64 69 |ime; sav|e for di|
|000024e0| 73 70 6c 61 79 2e 09 2a | 2f 0a 0a 77 68 69 6c 65 |splay..*|/..while|
|000024f0| 20 28 20 28 20 75 74 20 | 3d 20 67 65 74 75 74 65 | ( ( ut |= getute|
|00002500| 6e 74 28 29 20 29 20 21 | 3d 20 4e 55 4c 4c 20 29 |nt() ) !|= NULL )|
|00002510| 0a 09 69 66 20 28 20 28 | 69 6e 74 29 20 75 74 2d |..if ( (|int) ut-|
|00002520| 3e 75 74 5f 74 79 70 65 | 20 3d 3d 20 42 4f 4f 54 |>ut_type| == BOOT|
|00002530| 5f 54 49 4d 45 20 29 20 | 7b 0a 09 09 73 74 72 63 |_TIME ) |{...strc|
|00002540| 70 79 28 20 62 6f 6f 74 | 74 69 6d 65 2c 20 66 6d |py( boot|time, fm|
|00002550| 74 74 69 6d 65 28 20 6c | 6f 63 61 6c 74 69 6d 65 |ttime( l|ocaltime|
|00002560| 28 20 26 28 20 75 74 2d | 3e 75 74 5f 74 69 6d 65 |( &( ut-|>ut_time|
|00002570| 20 29 20 29 20 29 20 29 | 3b 0a 09 09 62 72 65 61 | ) ) ) )|;...brea|
|00002580| 6b 3b 0a 09 7d 0a 65 6e | 64 75 74 65 6e 74 28 29 |k;..}.en|dutent()|
|00002590| 3b 0a 0a 66 6f 72 20 28 | 3b 3b 29 20 7b 0a 0a 2f |;..for (|;;) {../|
|000025a0| 2a 09 53 63 61 6e 20 74 | 68 65 20 75 74 6d 70 20 |*.Scan t|he utmp |
|000025b0| 66 69 6c 65 2c 20 6e 6f | 74 69 6e 67 20 74 68 65 |file, no|ting the|
|000025c0| 20 72 75 6e 20 6c 65 76 | 65 6c 20 61 6e 64 20 74 | run lev|el and t|
|000025d0| 6f 74 74 69 6e 67 20 75 | 70 20 75 73 65 72 73 2e |otting u|p users.|
|000025e0| 09 2a 2f 0a 0a 09 6e 75 | 73 65 72 73 20 3d 20 30 |.*/...nu|sers = 0|
|000025f0| 3b 0a 09 77 68 69 6c 65 | 20 28 20 28 20 75 74 20 |;..while| ( ( ut |
|00002600| 3d 20 67 65 74 75 74 65 | 6e 74 28 29 20 29 20 21 |= getute|nt() ) !|
|00002610| 3d 20 4e 55 4c 4c 20 29 | 20 7b 0a 09 09 73 77 69 |= NULL )| {...swi|
|00002620| 74 63 68 20 28 20 28 69 | 6e 74 29 20 75 74 2d 3e |tch ( (i|nt) ut->|
|00002630| 75 74 5f 74 79 70 65 20 | 29 20 7b 0a 09 09 09 63 |ut_type |) {....c|
|00002640| 61 73 65 20 55 53 45 52 | 5f 50 52 4f 43 45 53 53 |ase USER|_PROCESS|
|00002650| 20 3a 20 6e 75 73 65 72 | 73 2b 2b 3b 20 62 72 65 | : nuser|s++; bre|
|00002660| 61 6b 3b 0a 09 09 09 63 | 61 73 65 20 52 55 4e 5f |ak;....c|ase RUN_|
|00002670| 4c 56 4c 20 3a 20 73 74 | 72 63 70 79 28 20 72 6c |LVL : st|rcpy( rl|
|00002680| 2c 20 75 74 2d 3e 75 74 | 5f 6c 69 6e 65 20 29 3b |, ut->ut|_line );|
|00002690| 20 62 72 65 61 6b 3b 0a | 09 09 09 64 65 66 61 75 | break;.|...defau|
|000026a0| 6c 74 20 3a 20 62 72 65 | 61 6b 3b 0a 09 09 09 7d |lt : bre|ak;....}|
|000026b0| 0a 09 09 7d 0a 09 65 6e | 64 75 74 65 6e 74 28 29 |...}..en|dutent()|
|000026c0| 3b 0a 0a 2f 2a 09 46 69 | 67 75 72 65 20 6f 75 74 |;../*.Fi|gure out|
|000026d0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 74 69 6d | the cur|rent tim|
|000026e0| 65 2e 20 20 54 65 6d 70 | 20 69 73 20 6e 65 65 64 |e. Temp| is need|
|000026f0| 65 64 20 27 63 61 75 73 | 65 20 6c 6f 63 61 6c 74 |ed 'caus|e localt|
|00002700| 69 6d 65 20 77 61 6e 74 | 73 0a 09 61 6e 20 61 64 |ime want|s..an ad|
|00002710| 64 72 65 73 73 2e 09 2a | 2f 0a 0a 09 74 65 6d 70 |dress..*|/...temp|
|00002720| 20 3d 20 74 69 6d 65 28 | 20 28 6c 6f 6e 67 20 2a | = time(| (long *|
|00002730| 29 20 30 20 29 3b 0a 09 | 73 74 72 63 70 79 28 20 |) 0 );..|strcpy( |
|00002740| 63 75 72 74 69 6d 65 2c | 20 66 6d 74 74 69 6d 65 |curtime,| fmttime|
|00002750| 28 20 6c 6f 63 61 6c 74 | 69 6d 65 28 20 26 74 65 |( localt|ime( &te|
|00002760| 6d 70 20 29 20 29 20 29 | 3b 0a 0a 2f 2a 09 46 6f |mp ) ) )|;../*.Fo|
|00002770| 72 6d 61 74 20 61 6e 64 | 20 70 72 69 6e 74 2e 20 |rmat and| print. |
|00002780| 20 46 6c 75 73 68 20 73 | 74 64 6f 75 74 20 74 6f | Flush s|tdout to|
|00002790| 20 6d 61 6b 65 20 69 74 | 20 72 65 61 6c 6c 79 20 | make it| really |
|000027a0| 67 65 74 20 70 72 69 6e | 74 65 64 2e 09 2a 2f 0a |get prin|ted..*/.|
|000027b0| 0a 09 73 70 72 69 6e 74 | 66 28 20 6c 69 6e 65 2c |..sprint|f( line,|
|000027c0| 20 42 41 52 46 4f 52 4d | 2c 20 70 68 73 74 61 74 | BARFORM|, phstat|
|000027d0| 5b 20 70 68 6f 6e 65 5f | 73 74 61 74 28 20 50 48 |[ phone_|stat( PH|
|000027e0| 4f 4e 45 31 20 29 20 5d | 2c 0a 09 09 70 68 73 74 |ONE1 ) ]|,...phst|
|000027f0| 61 74 5b 20 70 68 6f 6e | 65 5f 73 74 61 74 28 20 |at[ phon|e_stat( |
|00002800| 50 48 4f 4e 45 32 20 29 | 20 5d 2c 20 62 6f 6f 74 |PHONE2 )| ], boot|
|00002810| 74 69 6d 65 2c 20 72 6c | 2c 20 63 75 72 74 69 6d |time, rl|, curtim|
|00002820| 65 2c 20 6e 75 73 65 72 | 73 2c 0a 09 09 63 75 72 |e, nuser|s,...cur|
|00002830| 77 69 6e 6e 6f 28 29 20 | 29 3b 0a 09 70 72 69 6e |winno() |);..prin|
|00002840| 74 66 28 20 22 25 73 22 | 2c 20 6c 69 6e 65 20 29 |tf( "%s"|, line )|
|00002850| 3b 0a 09 66 66 6c 75 73 | 68 28 20 73 74 64 6f 75 |;..fflus|h( stdou|
|00002860| 74 20 29 3b 0a 0a 2f 2a | 20 20 54 61 6b 65 20 63 |t );../*| Take c|
|00002870| 61 72 65 20 6f 66 20 74 | 68 65 20 77 69 6e 64 6f |are of t|he windo|
|00002880| 77 20 6d 61 6e 61 67 65 | 6d 65 6e 74 20 73 74 75 |w manage|ment stu|
|00002890| 66 66 3b 20 61 6c 73 6f | 20 64 6f 20 73 6f 6d 65 |ff; also| do some|
|000028a0| 20 73 6c 65 65 70 69 6e | 67 20 64 6f 77 6e 0a 09 | sleepin|g down..|
|000028b0| 74 68 65 72 65 2e 09 2a | 2f 0a 0a 09 77 63 68 65 |there..*|/...wche|
|000028c0| 63 6b 7a 28 29 3b 0a 09 | 7d 0a 7d 0a 0a 63 68 61 |ckz();..|}.}..cha|
|000028d0| 72 20 2a 66 6d 74 74 69 | 6d 65 28 20 74 6d 20 29 |r *fmtti|me( tm )|
|000028e0| 0a 0a 2f 2a 09 46 6f 72 | 6d 61 74 20 61 20 74 69 |../*.For|mat a ti|
|000028f0| 6d 65 20 73 74 72 75 63 | 74 75 72 65 20 69 6e 74 |me struc|ture int|
|00002900| 6f 20 61 20 73 74 72 69 | 6e 67 20 74 68 65 20 77 |o a stri|ng the w|
|00002910| 61 79 20 2a 49 2a 20 77 | 61 6e 74 20 69 74 2e 09 |ay *I* w|ant it..|
|00002920| 2a 2f 0a 0a 73 74 72 75 | 63 74 20 74 6d 20 2a 74 |*/..stru|ct tm *t|
|00002930| 6d 3b 0a 7b 0a 63 68 61 | 72 20 20 61 62 75 66 5b |m;.{.cha|r abuf[|
|00002940| 32 36 5d 3b 0a 0a 73 70 | 72 69 6e 74 66 28 20 61 |26];..sp|rintf( a|
|00002950| 62 75 66 2c 20 54 49 4d | 45 46 4f 52 4d 2c 20 74 |buf, TIM|EFORM, t|
|00002960| 6d 2d 3e 74 6d 5f 6d 6f | 6e 2b 31 2c 20 74 6d 2d |m->tm_mo|n+1, tm-|
|00002970| 3e 74 6d 5f 6d 64 61 79 | 2c 20 74 6d 2d 3e 74 6d |>tm_mday|, tm->tm|
|00002980| 5f 68 6f 75 72 2c 20 74 | 6d 2d 3e 74 6d 5f 6d 69 |_hour, t|m->tm_mi|
|00002990| 6e 20 29 3b 0a 72 65 74 | 75 72 6e 28 20 61 62 75 |n );.ret|urn( abu|
|000029a0| 66 20 29 3b 0a 7d 0a 0a | 70 68 6f 6e 65 5f 73 74 |f );.}..|phone_st|
|000029b0| 61 74 28 20 70 68 6f 6e | 65 20 29 0a 63 68 61 72 |at( phon|e ).char|
|000029c0| 09 2a 70 68 6f 6e 65 3b | 0a 0a 2f 2a 09 46 69 67 |.*phone;|../*.Fig|
|000029d0| 75 72 65 20 6f 75 74 20 | 74 68 65 20 70 68 6f 6e |ure out |the phon|
|000029e0| 65 20 6c 69 6e 65 20 73 | 74 61 74 75 73 2e 20 20 |e line s|tatus. |
|000029f0| 54 68 65 72 65 20 61 72 | 65 20 66 69 76 65 20 70 |There ar|e five p|
|00002a00| 6f 73 73 69 62 6c 65 20 | 73 74 61 74 65 73 3a 0a |ossible |states:.|
|00002a10| 09 09 49 64 6c 65 20 2d | 20 63 6f 6d 70 6c 65 74 |..Idle -| complet|
|00002a20| 65 6c 79 20 66 72 65 65 | 20 6c 69 6e 65 0a 09 09 |ely free| line...|
|00002a30| 41 6e 73 72 20 2d 20 67 | 65 74 74 79 0a 09 09 4d |Ansr - g|etty...M|
|00002a40| 61 63 68 20 2d 20 69 6e | 63 6f 6d 69 6e 67 20 6d |ach - in|coming m|
|00002a50| 61 63 68 69 6e 65 0a 09 | 09 55 73 65 72 20 2d 20 |achine..|.User - |
|00002a60| 69 6e 63 6f 6d 69 6e 67 | 20 75 73 65 72 0a 09 09 |incoming| user...|
|00002a70| 43 61 6c 6c 20 2d 20 6f | 75 74 62 6f 75 6e 64 0a |Call - o|utbound.|
|00002a80| 0a 09 54 68 65 73 65 20 | 66 69 76 65 20 73 74 61 |..These |five sta|
|00002a90| 74 65 73 20 61 72 65 20 | 64 65 66 69 6e 65 64 20 |tes are |defined |
|00002aa0| 72 6f 75 67 68 6c 79 20 | 61 73 20 66 6f 6c 6c 6f |roughly |as follo|
|00002ab0| 77 73 3a 0a 0a 09 09 41 | 6e 73 72 20 2d 20 75 74 |ws:....A|nsr - ut|
|00002ac0| 6d 70 20 2d 3e 20 4c 4f | 47 49 4e 5f 50 52 4f 43 |mp -> LO|GIN_PROC|
|00002ad0| 45 53 53 2e 0a 09 09 4d | 61 63 68 20 2d 20 75 74 |ESS....M|ach - ut|
|00002ae0| 6d 70 20 2d 3e 20 55 53 | 45 52 5f 50 52 4f 43 45 |mp -> US|ER_PROCE|
|00002af0| 53 53 3b 20 45 20 4c 43 | 4b 2e 0a 09 09 55 73 65 |SS; E LC|K....Use|
|00002b00| 72 20 2d 20 75 74 6d 70 | 20 2d 3e 20 55 53 45 52 |r - utmp| -> USER|
|00002b10| 5f 50 52 4f 43 45 53 53 | 3b 20 7e 45 20 4c 43 4b |_PROCESS|; ~E LCK|
|00002b20| 2e 0a 09 09 43 61 6c 6c | 20 2d 20 75 74 6d 70 20 |....Call| - utmp |
|00002b30| 2d 3e 20 6e 6f 74 68 69 | 6e 67 3b 20 45 20 4c 43 |-> nothi|ng; E LC|
|00002b40| 4b 2e 0a 09 09 49 64 6c | 65 20 2d 20 75 74 6d 70 |K....Idl|e - utmp|
|00002b50| 20 2d 3e 20 6e 6f 74 68 | 69 6e 67 3b 20 7e 45 20 | -> noth|ing; ~E |
|00002b60| 4c 43 4b 2e 0a 0a 09 42 | 61 73 69 63 61 6c 6c 79 |LCK....B|asically|
|00002b70| 2c 20 77 65 20 64 65 63 | 69 64 65 20 77 68 61 74 |, we dec|ide what|
|00002b80| 20 77 65 20 68 61 76 65 | 20 62 79 20 61 20 70 72 | we have| by a pr|
|00002b90| 6f 63 65 73 73 20 6f 66 | 20 65 6c 69 6d 69 6e 61 |ocess of| elimina|
|00002ba0| 74 69 6f 6e 2e 0a 0a 09 | 4b 6e 6f 77 6e 20 62 75 |tion....|Known bu|
|00002bb0| 67 73 3a 20 20 54 68 69 | 73 20 6d 61 79 20 68 61 |gs: Thi|s may ha|
|00002bc0| 76 65 20 70 72 6f 62 6c | 65 6d 73 20 77 69 74 68 |ve probl|ems with|
|00002bd0| 20 48 44 42 20 55 55 43 | 50 2c 20 73 69 6e 63 65 | HDB UUC|P, since|
|00002be0| 20 49 27 76 65 20 67 6f | 74 20 6e 6f 0a 09 77 61 | I've go|t no..wa|
|00002bf0| 79 20 74 6f 20 74 65 73 | 74 20 61 67 61 69 6e 73 |y to tes|t agains|
|00002c00| 74 20 69 74 2e 20 20 4f | 6e 65 20 74 68 69 6e 67 |t it. O|ne thing|
|00002c10| 20 74 68 61 74 20 49 20 | 61 6d 20 73 75 72 65 20 | that I |am sure |
|00002c20| 6f 66 20 69 73 20 74 68 | 61 74 20 73 69 6e 63 65 |of is th|at since|
|00002c30| 20 49 0a 09 62 65 6c 69 | 65 76 65 20 74 68 61 74 | I..beli|eve that|
|00002c40| 20 75 75 67 65 74 74 79 | 20 63 72 65 61 74 65 73 | uugetty| creates|
|00002c50| 20 61 20 4c 43 4b 2e 2e | 64 65 76 69 63 65 20 66 | a LCK..|device f|
|00002c60| 69 6c 65 2c 20 74 68 69 | 73 20 72 6f 75 74 69 6e |ile, thi|s routin|
|00002c70| 65 20 77 69 6c 6c 0a 09 | 63 6f 6e 73 69 73 74 65 |e will..|consiste|
|00002c80| 6e 74 6c 79 20 6d 69 73 | 74 61 6b 65 20 75 73 65 |ntly mis|take use|
|00002c90| 72 73 20 6c 6f 67 67 65 | 64 20 69 6e 20 74 68 72 |rs logge|d in thr|
|00002ca0| 6f 75 67 68 20 75 75 67 | 65 74 74 79 20 66 6f 72 |ough uug|etty for|
|00002cb0| 20 6d 61 63 68 69 6e 65 | 73 0a 09 6c 6f 67 67 65 | machine|s..logge|
|00002cc0| 64 20 69 6e 74 6f 20 75 | 75 63 69 63 6f 2e 09 2a |d into u|ucico..*|
|00002cd0| 2f 0a 0a 7b 0a 73 74 72 | 75 63 74 20 75 74 6d 70 |/..{.str|uct utmp|
|00002ce0| 09 75 74 5f 74 72 79 2c | 20 2a 75 74 2c 20 2a 67 |.ut_try,| *ut, *g|
|00002cf0| 65 74 75 74 6c 69 6e 65 | 28 29 3b 0a 73 68 6f 72 |etutline|();.shor|
|00002d00| 74 09 75 74 6d 70 74 79 | 70 65 3b 0a 63 68 61 72 |t.utmpty|pe;.char|
|00002d10| 09 6d 61 63 68 69 6e 65 | 5b 4d 41 43 48 4c 45 4e |.machine|[MACHLEN|
|00002d20| 5d 3b 0a 0a 2f 2a 09 4c | 6f 6f 6b 20 66 6f 72 20 |];../*.L|ook for |
|00002d30| 74 68 65 20 70 68 6f 6e | 65 20 6c 69 6e 65 20 69 |the phon|e line i|
|00002d40| 6e 20 74 68 65 20 75 74 | 6d 70 20 66 69 6c 65 2e |n the ut|mp file.|
|00002d50| 20 20 67 65 74 75 74 6c | 69 6e 65 28 29 20 73 68 | getutl|ine() sh|
|00002d60| 6f 75 6c 64 20 72 65 74 | 75 72 6e 0a 09 6f 6e 6c |ould ret|urn..onl|
|00002d70| 79 20 4c 4f 47 49 4e 5f | 50 52 4f 43 45 53 53 2c |y LOGIN_|PROCESS,|
|00002d80| 20 55 53 45 52 5f 50 52 | 4f 43 45 53 53 2c 20 6f | USER_PR|OCESS, o|
|00002d90| 72 20 4e 55 4c 4c 20 28 | 66 6f 72 20 66 61 69 6c |r NULL (|for fail|
|00002da0| 75 72 65 29 2e 20 20 57 | 65 20 6e 65 65 64 20 74 |ure). W|e need t|
|00002db0| 6f 0a 09 73 61 76 65 20 | 73 6f 6d 65 20 76 61 6c |o..save |some val|
|00002dc0| 75 65 73 20 62 65 66 6f | 72 65 20 74 68 65 20 65 |ues befo|re the e|
|00002dd0| 6e 64 75 74 65 6e 74 28 | 29 20 63 61 6c 6c 20 62 |ndutent(|) call b|
|00002de0| 65 63 61 75 73 65 20 69 | 74 20 63 6c 65 61 72 73 |ecause i|t clears|
|00002df0| 20 6f 75 74 20 74 68 65 | 0a 09 73 74 61 74 69 63 | out the|..static|
|00002e00| 20 73 74 72 75 63 74 75 | 72 65 20 70 6f 69 6e 74 | structu|re point|
|00002e10| 65 64 20 74 6f 20 62 79 | 20 74 68 65 20 72 65 74 |ed to by| the ret|
|00002e20| 75 72 6e 20 76 61 6c 75 | 65 20 6f 66 20 67 65 74 |urn valu|e of get|
|00002e30| 75 74 6c 69 6e 65 28 29 | 2e 20 20 57 65 0a 09 73 |utline()|. We..s|
|00002e40| 61 76 65 20 74 68 65 20 | 75 74 5f 75 73 65 72 20 |ave the |ut_user |
|00002e50| 66 69 65 6c 64 20 62 65 | 63 61 75 73 65 20 75 75 |field be|cause uu|
|00002e60| 63 69 63 6f 20 63 72 65 | 61 74 65 73 20 61 20 6d |cico cre|ates a m|
|00002e70| 61 63 68 69 6e 65 20 4c | 43 4b 20 66 69 6c 65 20 |achine L|CK file |
|00002e80| 75 73 69 6e 67 0a 09 74 | 68 65 20 66 69 72 73 74 |using..t|he first|
|00002e90| 20 73 69 78 20 63 68 61 | 72 61 63 74 65 72 73 20 | six cha|racters |
|00002ea0| 6f 66 20 74 68 69 73 20 | 6e 61 6d 65 2e 09 2a 2f |of this |name..*/|
|00002eb0| 0a 0a 73 74 72 63 70 79 | 28 20 75 74 5f 74 72 79 |..strcpy|( ut_try|
|00002ec0| 2e 75 74 5f 6c 69 6e 65 | 2c 20 70 68 6f 6e 65 20 |.ut_line|, phone |
|00002ed0| 29 3b 0a 75 74 20 3d 20 | 67 65 74 75 74 6c 69 6e |);.ut = |getutlin|
|00002ee0| 65 28 20 26 75 74 5f 74 | 72 79 20 29 3b 0a 75 74 |e( &ut_t|ry );.ut|
|00002ef0| 6d 70 74 79 70 65 20 3d | 20 75 74 2d 3e 75 74 5f |mptype =| ut->ut_|
|00002f00| 74 79 70 65 3b 0a 73 74 | 72 63 70 79 28 20 6d 61 |type;.st|rcpy( ma|
|00002f10| 63 68 69 6e 65 2c 20 75 | 74 2d 3e 75 74 5f 75 73 |chine, u|t->ut_us|
|00002f20| 65 72 20 29 3b 0a 0a 2f | 2a 09 41 54 26 54 20 55 |er );../|*.AT&T U|
|00002f30| 55 43 50 20 73 70 65 63 | 69 66 69 65 73 20 61 20 |UCP spec|ifies a |
|00002f40| 6d 61 78 69 6d 75 6d 20 | 6c 65 6e 67 74 68 20 6f |maximum |length o|
|00002f50| 66 20 73 69 78 20 63 68 | 61 72 61 63 74 65 72 73 |f six ch|aracters|
|00002f60| 2e 20 20 52 65 6d 6f 76 | 65 20 74 68 69 73 0a 09 |. Remov|e this..|
|00002f70| 6c 69 6e 65 20 66 6f 72 | 20 6c 65 73 73 20 62 72 |line for| less br|
|00002f80| 61 69 6e 2d 64 61 6d 61 | 67 65 64 20 69 6d 70 6c |ain-dama|ged impl|
|00002f90| 65 6d 65 6e 74 61 74 69 | 6f 6e 73 2e 09 2a 2f 0a |ementati|ons..*/.|
|00002fa0| 0a 6d 61 63 68 69 6e 65 | 5b 36 5d 20 3d 20 27 5c |.machine|[6] = '\|
|00002fb0| 30 27 3b 0a 65 6e 64 75 | 74 65 6e 74 28 29 3b 0a |0';.endu|tent();.|
|00002fc0| 0a 2f 2a 09 46 69 72 73 | 74 20 63 6f 6e 64 69 74 |./*.Firs|t condit|
|00002fd0| 69 6f 6e 3a 20 20 77 61 | 73 20 74 68 65 72 65 20 |ion: wa|s there |
|00002fe0| 61 20 75 74 6d 70 20 65 | 6e 74 72 79 3f 09 2a 2f |a utmp e|ntry?.*/|
|00002ff0| 0a 0a 69 66 20 28 20 75 | 74 20 21 3d 20 4e 55 4c |..if ( u|t != NUL|
|00003000| 4c 20 29 0a 0a 2f 2a 09 | 54 68 65 72 65 20 77 61 |L )../*.|There wa|
|00003010| 73 2e 20 20 49 66 20 74 | 68 65 20 74 79 70 65 20 |s. If t|he type |
|00003020| 66 69 65 6c 64 20 69 73 | 20 4c 4f 47 49 4e 5f 50 |field is| LOGIN_P|
|00003030| 52 4f 43 45 53 53 2c 20 | 77 65 20 68 61 76 65 20 |ROCESS, |we have |
|00003040| 61 20 67 65 74 74 79 20 | 61 6e 64 20 63 61 6e 0a |a getty |and can.|
|00003050| 09 72 65 74 75 72 6e 20 | 74 68 65 20 61 70 70 72 |.return |the appr|
|00003060| 6f 70 72 69 61 74 65 20 | 76 61 6c 75 65 20 61 6e |opriate |value an|
|00003070| 64 20 71 75 69 74 2e 09 | 2a 2f 0a 0a 09 69 66 20 |d quit..|*/...if |
|00003080| 28 20 75 74 6d 70 74 79 | 70 65 20 3d 3d 20 4c 4f |( utmpty|pe == LO|
|00003090| 47 49 4e 5f 50 52 4f 43 | 45 53 53 20 29 0a 09 09 |GIN_PROC|ESS )...|
|000030a0| 72 65 74 75 72 6e 28 20 | 41 4e 53 52 20 29 3b 0a |return( |ANSR );.|
|000030b0| 09 65 6c 73 65 0a 0a 2f | 2a 09 41 20 55 53 45 52 |.else../|*.A USER|
|000030c0| 5f 50 52 4f 43 45 53 53 | 20 69 73 20 69 6e 63 6f |_PROCESS| is inco|
|000030d0| 6d 69 6e 67 20 61 6e 64 | 20 63 61 6e 20 62 65 20 |ming and| can be |
|000030e0| 65 69 74 68 65 72 20 61 | 20 75 73 65 72 20 6f 72 |either a| user or|
|000030f0| 20 61 20 75 75 63 69 63 | 6f 2e 20 20 41 6e 0a 09 | a uucic|o. An..|
|00003100| 69 6e 63 6f 6d 69 6e 67 | 20 75 75 63 69 63 6f 20 |incoming| uucico |
|00003110| 68 61 73 20 61 20 4c 43 | 4b 2e 2e 6d 61 63 68 69 |has a LC|K..machi|
|00003120| 6e 65 20 66 69 6c 65 2c | 20 73 6f 20 77 65 20 63 |ne file,| so we c|
|00003130| 68 65 63 6b 20 66 6f 72 | 20 74 68 61 74 2e 09 2a |heck for| that..*|
|00003140| 2f 0a 0a 09 09 72 65 74 | 75 72 6e 28 20 6c 6f 63 |/....ret|urn( loc|
|00003150| 6b 65 64 28 20 6d 61 63 | 68 69 6e 65 20 29 20 3f |ked( mac|hine ) ?|
|00003160| 20 4d 41 43 48 20 3a 20 | 55 53 45 52 20 29 3b 0a | MACH : |USER );.|
|00003170| 65 6c 73 65 0a 0a 2f 2a | 09 54 68 65 72 65 20 69 |else../*|.There i|
|00003180| 73 20 6e 6f 20 75 74 6d | 70 20 65 6e 74 72 79 2e |s no utm|p entry.|
|00003190| 20 20 54 68 65 72 65 20 | 61 72 65 20 6f 6e 6c 79 | There |are only|
|000031a0| 20 74 77 6f 20 70 6f 73 | 73 69 62 69 6c 69 74 69 | two pos|sibiliti|
|000031b0| 65 73 20 68 65 72 65 3b | 20 69 66 20 74 68 65 72 |es here;| if ther|
|000031c0| 65 0a 09 69 73 20 61 6e | 20 6f 75 74 67 6f 69 6e |e..is an| outgoin|
|000031d0| 67 20 63 61 6c 6c 20 6f | 66 20 73 6f 6d 65 20 73 |g call o|f some s|
|000031e0| 6f 72 74 2c 20 74 68 65 | 72 65 20 77 69 6c 6c 20 |ort, the|re will |
|000031f0| 62 65 20 61 20 4c 43 4b | 2e 2e 64 65 76 69 63 65 |be a LCK|..device|
|00003200| 20 66 69 6c 65 3b 20 69 | 66 0a 09 6e 6f 74 2c 20 | file; i|f..not, |
|00003210| 74 68 65 20 6c 69 6e 65 | 20 69 73 20 72 65 61 6c |the line| is real|
|00003220| 6c 79 20 69 64 6c 65 2e | 09 2a 2f 0a 0a 09 09 72 |ly idle.|.*/....r|
|00003230| 65 74 75 72 6e 28 20 6c | 6f 63 6b 65 64 28 20 70 |eturn( l|ocked( p|
|00003240| 68 6f 6e 65 20 29 20 3f | 20 43 41 4c 4c 20 3a 20 |hone ) ?| CALL : |
|00003250| 49 44 4c 45 20 29 3b 0a | 0a 2f 2a 09 53 68 6f 75 |IDLE );.|./*.Shou|
|00003260| 6c 64 6e 27 74 20 72 65 | 61 63 68 20 68 65 72 65 |ldn't re|ach here|
|00003270| 2e 09 2a 2f 0a 0a 7d 0a | 0a 6c 6f 63 6b 65 64 28 |..*/..}.|.locked(|
|00003280| 20 64 65 76 69 63 65 20 | 29 0a 63 68 61 72 09 2a | device |).char.*|
|00003290| 64 65 76 69 63 65 3b 0a | 0a 2f 2a 09 53 65 65 20 |device;.|./*.See |
|000032a0| 69 66 20 61 20 6c 6f 63 | 6b 20 66 69 6c 65 20 65 |if a loc|k file e|
|000032b0| 78 69 73 74 73 2e 09 2a | 2f 0a 0a 7b 0a 63 68 61 |xists..*|/..{.cha|
|000032c0| 72 09 74 65 6d 70 5b 4d | 41 58 50 41 54 48 4c 45 |r.temp[M|AXPATHLE|
|000032d0| 4e 5d 3b 0a 69 6e 74 09 | 09 66 64 3b 0a 0a 2f 2a |N];.int.|.fd;../*|
|000032e0| 09 4d 61 6b 65 20 75 70 | 20 74 68 65 20 66 75 6c |.Make up| the ful|
|000032f0| 6c 20 70 61 74 68 20 6e | 61 6d 65 2e 09 2a 2f 0a |l path n|ame..*/.|
|00003300| 0a 73 74 72 63 70 79 28 | 20 74 65 6d 70 2c 20 4c |.strcpy(| temp, L|
|00003310| 4f 43 4b 44 49 52 20 29 | 3b 0a 73 74 72 63 61 74 |OCKDIR )|;.strcat|
|00003320| 28 20 74 65 6d 70 2c 20 | 4c 4f 43 4b 50 52 45 46 |( temp, |LOCKPREF|
|00003330| 49 58 20 29 3b 0a 73 74 | 72 63 61 74 28 20 74 65 |IX );.st|rcat( te|
|00003340| 6d 70 2c 20 64 65 76 69 | 63 65 20 29 3b 0a 0a 2f |mp, devi|ce );../|
|00003350| 2a 09 41 74 74 65 6d 70 | 74 20 74 6f 20 6f 70 65 |*.Attemp|t to ope|
|00003360| 6e 20 74 68 65 20 6c 6f | 63 6b 20 66 69 6c 65 2e |n the lo|ck file.|
|00003370| 20 20 41 73 73 75 6d 65 | 20 74 68 61 74 20 69 66 | Assume| that if|
|00003380| 20 74 68 65 20 6f 70 65 | 6e 20 66 61 69 6c 73 20 | the ope|n fails |
|00003390| 74 68 65 20 6c 6f 63 6b | 0a 09 66 69 6c 65 20 64 |the lock|..file d|
|000033a0| 6f 65 73 20 6e 6f 74 20 | 65 78 69 73 74 2e 09 2a |oes not |exist..*|
|000033b0| 2f 0a 0a 66 64 20 3d 20 | 6f 70 65 6e 28 20 74 65 |/..fd = |open( te|
|000033c0| 6d 70 2c 20 4f 5f 52 44 | 4f 4e 4c 59 20 29 3b 0a |mp, O_RD|ONLY );.|
|000033d0| 69 66 20 28 20 66 64 20 | 3d 3d 20 2d 31 20 29 0a |if ( fd |== -1 ).|
|000033e0| 09 72 65 74 75 72 6e 28 | 20 46 41 4c 53 45 20 29 |.return(| FALSE )|
|000033f0| 3b 0a 63 6c 6f 73 65 28 | 20 66 64 20 29 3b 0a 72 |;.close(| fd );.r|
|00003400| 65 74 75 72 6e 28 20 54 | 52 55 45 20 29 3b 0a 7d |eturn( T|RUE );.}|
|00003410| 0a 0a 63 75 72 77 69 6e | 6e 6f 28 29 0a 0a 2f 2a |..curwin|no()../*|
|00003420| 09 46 69 67 75 72 65 20 | 6f 75 74 20 74 68 65 20 |.Figure |out the |
|00003430| 63 75 72 72 65 6e 74 20 | 77 69 6e 64 6f 77 3b 20 |current |window; |
|00003440| 77 65 20 6e 65 65 64 20 | 61 20 73 74 61 72 74 69 |we need |a starti|
|00003450| 6e 67 20 70 6f 69 6e 74 | 2c 20 61 66 74 65 72 20 |ng point|, after |
|00003460| 61 6c 6c 2e 0a 09 4b 6e | 6f 77 6e 20 62 75 67 3a |all...Kn|own bug:|
|00003470| 20 20 74 68 69 73 20 73 | 6f 6d 65 74 69 6d 65 73 | this s|ometimes|
|00003480| 20 72 65 74 75 72 6e 73 | 20 74 68 65 20 77 72 6f | returns| the wro|
|00003490| 6e 67 20 76 61 6c 75 65 | 20 69 66 20 69 74 20 67 |ng value| if it g|
|000034a0| 65 74 73 20 69 6e 74 6f | 20 61 0a 09 72 61 63 65 |ets into| a..race|
|000034b0| 20 63 6f 6e 64 69 74 69 | 6f 6e 20 77 69 74 68 20 | conditi|on with |
|000034c0| 61 20 74 65 72 6d 69 6e | 61 74 69 6e 67 2f 72 65 |a termin|ating/re|
|000034d0| 73 74 61 72 74 69 6e 67 | 20 28 65 67 2c 20 67 65 |starting| (eg, ge|
|000034e0| 74 74 79 29 20 6a 6f 62 | 2e 20 20 49 74 20 61 6c |tty) job|. It al|
|000034f0| 73 6f 0a 09 64 6f 65 73 | 6e 27 74 20 63 68 65 63 |so..does|n't chec|
|00003500| 6b 20 74 6f 20 73 65 65 | 20 69 66 20 74 68 65 20 |k to see| if the |
|00003510| 69 6f 63 74 6c 20 66 61 | 69 6c 73 2e 09 2a 2f 0a |ioctl fa|ils..*/.|
|00003520| 0a 7b 0a 69 6e 74 09 09 | 66 6f 6f 77 69 6e 2c 20 |.{.int..|foowin, |
|00003530| 64 75 6d 6d 79 2c 20 74 | 65 6d 70 3b 0a 0a 66 6f |dummy, t|emp;..fo|
|00003540| 6f 77 69 6e 20 3d 20 6f | 70 65 6e 28 20 22 2f 64 |owin = o|pen( "/d|
|00003550| 65 76 2f 77 69 6e 64 6f | 77 22 2c 20 4f 5f 52 44 |ev/windo|w", O_RD|
|00003560| 4f 4e 4c 59 20 29 3b 0a | 74 65 6d 70 20 3d 20 69 |ONLY );.|temp = i|
|00003570| 6f 63 74 6c 28 20 66 6f | 6f 77 69 6e 2c 20 57 49 |octl( fo|owin, WI|
|00003580| 4f 43 47 43 55 52 52 2c | 20 64 75 6d 6d 79 20 29 |OCGCURR,| dummy )|
|00003590| 3b 0a 63 6c 6f 73 65 28 | 20 66 6f 6f 77 69 6e 20 |;.close(| foowin |
|000035a0| 29 3b 0a 72 65 74 75 72 | 6e 28 20 74 65 6d 70 20 |);.retur|n( temp |
|000035b0| 29 3b 0a 7d 0a 0a 77 63 | 68 65 63 6b 7a 28 29 0a |);.}..wc|heckz().|
|000035c0| 0a 2f 2a 09 54 68 69 73 | 20 69 73 20 77 68 65 72 |./*.This| is wher|
|000035d0| 65 20 74 68 65 20 63 6f | 64 65 20 74 6f 20 63 68 |e the co|de to ch|
|000035e0| 65 63 6b 20 66 6f 72 20 | 63 68 61 6e 67 65 2d 77 |eck for |change-w|
|000035f0| 69 6e 64 6f 77 20 6b 65 | 79 73 20 6c 69 76 65 73 |indow ke|ys lives|
|00003600| 2e 20 20 41 6c 73 6f 2c | 0a 09 73 6c 65 65 70 20 |. Also,|..sleep |
|00003610| 66 6f 72 20 74 68 65 20 | 6d 61 69 6e 20 70 72 6f |for the |main pro|
|00003620| 67 72 61 6d 20 68 65 72 | 65 2e 20 20 49 74 20 73 |gram her|e. It s|
|00003630| 68 6f 75 6c 64 20 72 65 | 74 75 72 6e 20 61 62 6f |hould re|turn abo|
|00003640| 75 74 20 65 76 65 72 79 | 20 54 49 43 4b 0a 09 73 |ut every| TICK..s|
|00003650| 65 63 6f 6e 64 73 2e 09 | 2a 2f 0a 0a 7b 0a 69 6e |econds..|*/..{.in|
|00003660| 74 09 09 74 6f 63 6b 2c | 20 6e 65 77 77 69 6e 2c |t..tock,| newwin,|
|00003670| 20 64 69 72 3b 0a 0a 74 | 6f 63 6b 20 3d 20 30 3b | dir;..t|ock = 0;|
|00003680| 0a 0a 64 6f 20 7b 0a 2f | 2a 09 43 68 65 63 6b 20 |..do {./|*.Check |
|00003690| 66 6f 72 20 61 20 63 6f | 6d 6d 61 6e 64 20 6b 65 |for a co|mmand ke|
|000036a0| 79 2e 09 2a 2f 0a 0a 09 | 69 66 20 28 20 28 20 64 |y..*/...|if ( ( d|
|000036b0| 69 72 20 3d 20 63 68 65 | 63 6b 65 79 28 29 20 29 |ir = che|ckey() )|
|000036c0| 20 21 3d 20 4e 4f 57 48 | 45 52 45 20 29 20 7b 0a | != NOWH|ERE ) {.|
|000036d0| 0a 2f 2a 09 44 65 74 65 | 72 6d 69 6e 65 20 77 68 |./*.Dete|rmine wh|
|000036e0| 69 63 68 20 77 69 6e 64 | 6f 77 20 69 73 20 6e 65 |ich wind|ow is ne|
|000036f0| 78 74 20 61 6e 64 20 73 | 65 6c 65 63 74 20 69 74 |xt and s|elect it|
|00003700| 2e 09 2a 2f 0a 0a 09 09 | 69 66 20 28 20 64 69 72 |..*/....|if ( dir|
|00003710| 20 21 3d 20 48 45 52 45 | 20 29 20 7b 0a 09 09 09 | != HERE| ) {....|
|00003720| 6e 65 77 77 69 6e 20 3d | 20 6e 65 78 77 69 6e 28 |newwin =| nexwin(|
|00003730| 20 63 75 72 77 69 6e 6e | 6f 28 29 2c 20 64 69 72 | curwinn|o(), dir|
|00003740| 20 29 3b 0a 09 09 09 69 | 6f 63 74 6c 28 20 6e 65 | );....i|octl( ne|
|00003750| 77 77 69 6e 2c 20 57 49 | 4f 43 53 45 4c 45 43 54 |wwin, WI|OCSELECT|
|00003760| 20 29 3b 0a 09 09 09 63 | 6c 6f 73 65 28 20 6e 65 | );....c|lose( ne|
|00003770| 77 77 69 6e 20 29 3b 0a | 09 09 09 7d 0a 09 09 74 |wwin );.|...}...t|
|00003780| 6f 63 6b 20 3d 20 54 49 | 43 4b 3b 09 09 2f 2a 09 |ock = TI|CK;../*.|
|00003790| 4b 6c 75 64 67 65 20 74 | 6f 20 66 6f 72 63 65 20 |Kludge t|o force |
|000037a0| 72 65 74 75 72 6e 20 61 | 6e 64 20 72 65 64 69 73 |return a|nd redis|
|000037b0| 70 6c 61 79 2e 09 2a 2f | 0a 09 09 7d 0a 09 7d 0a |play..*/|...}..}.|
|000037c0| 0a 2f 2a 09 52 65 74 75 | 72 6e 20 61 66 74 65 72 |./*.Retu|rn after|
|000037d0| 20 54 49 43 4b 20 74 6f | 63 6b 73 2e 09 2a 2f 0a | TICK to|cks..*/.|
|000037e0| 0a 77 68 69 6c 65 20 28 | 20 74 6f 63 6b 2b 2b 20 |.while (| tock++ |
|000037f0| 3c 20 54 49 43 4b 20 29 | 3b 0a 7d 0a 0a 6a 75 73 |< TICK )|;.}..jus|
|00003800| 74 67 6f 6f 6e 28 29 0a | 0a 2f 2a 09 53 74 75 62 |tgoon().|./*.Stub|
|00003810| 20 72 6f 75 74 69 6e 65 | 20 74 6f 20 22 68 61 6e | routine| to "han|
|00003820| 64 6c 65 22 20 74 68 65 | 20 61 6c 61 72 6d 20 73 |dle" the| alarm s|
|00003830| 69 67 6e 61 6c 2e 20 20 | 44 6f 65 73 6e 27 74 20 |ignal. |Doesn't |
|00003840| 64 6f 20 61 20 6c 6f 74 | 2e 09 2a 2f 0a 0a 7b 0a |do a lot|..*/..{.|
|00003850| 72 65 74 75 72 6e 3b 0a | 7d 0a 0a 63 68 65 63 6b |return;.|}..check|
|00003860| 65 79 28 29 0a 0a 2f 2a | 09 43 68 65 63 6b 20 61 |ey()../*|.Check a|
|00003870| 6e 64 20 73 65 65 20 69 | 66 20 6f 6e 65 20 6f 66 |nd see i|f one of|
|00003880| 20 6f 75 72 20 6b 65 79 | 73 20 68 61 73 20 62 65 | our key|s has be|
|00003890| 65 6e 20 70 6f 6b 65 64 | 2e 20 20 54 68 65 20 6f |en poked|. The o|
|000038a0| 6e 6c 79 20 6b 65 79 73 | 20 74 68 69 73 20 77 69 |nly keys| this wi|
|000038b0| 6e 64 6f 77 0a 09 69 73 | 20 73 75 70 70 6f 73 65 |ndow..is| suppose|
|000038c0| 64 20 74 6f 20 72 65 73 | 70 6f 6e 64 20 74 6f 20 |d to res|pond to |
|000038d0| 61 6c 6c 20 67 65 6e 65 | 72 61 74 65 20 74 68 72 |all gene|rate thr|
|000038e0| 65 65 20 63 68 61 72 61 | 63 74 65 72 20 65 73 63 |ee chara|cter esc|
|000038f0| 61 70 65 20 73 65 71 75 | 65 6e 63 65 73 2e 0a 09 |ape sequ|ences...|
|00003900| 53 65 74 20 61 6e 64 20 | 63 61 74 63 68 20 61 6e |Set and |catch an|
|00003910| 20 61 6c 61 72 6d 20 73 | 69 67 6e 61 6c 20 74 6f | alarm s|ignal to|
|00003920| 20 6b 65 65 70 20 66 72 | 6f 6d 20 67 65 74 74 69 | keep fr|om getti|
|00003930| 6e 67 20 68 75 6e 67 20 | 69 6e 20 74 68 65 20 66 |ng hung |in the f|
|00003940| 72 65 61 64 28 29 3b 0a | 09 74 68 69 73 20 70 72 |read();.|.this pr|
|00003950| 6f 62 61 62 6c 79 20 63 | 6f 75 6c 64 20 62 65 20 |obably c|ould be |
|00003960| 64 6f 6e 65 20 6d 6f 72 | 65 20 6e 65 61 74 6c 79 |done mor|e neatly|
|00003970| 20 73 6f 6d 65 20 6f 74 | 68 65 72 20 77 61 79 2c | some ot|her way,|
|00003980| 20 62 75 74 2e 2e 2e 09 | 2a 2f 0a 0a 7b 0a 69 6e | but....|*/..{.in|
|00003990| 74 09 09 64 69 72 65 63 | 74 69 6f 6e 2c 20 69 3b |t..direc|tion, i;|
|000039a0| 0a 46 49 4c 45 09 2a 66 | 77 3b 0a 63 68 61 72 09 |.FILE.*f|w;.char.|
|000039b0| 6b 65 79 5b 33 5d 3b 0a | 0a 2f 2a 09 53 65 74 20 |key[3];.|./*.Set |
|000039c0| 74 68 65 20 61 6c 61 72 | 6d 20 73 69 67 6e 61 6c |the alar|m signal|
|000039d0| 2e 09 2a 2f 0a 0a 73 69 | 67 6e 61 6c 28 20 53 49 |..*/..si|gnal( SI|
|000039e0| 47 41 4c 52 4d 2c 20 6a | 75 73 74 67 6f 6f 6e 20 |GALRM, j|ustgoon |
|000039f0| 29 3b 0a 61 6c 61 72 6d | 28 20 31 20 29 3b 0a 69 |);.alarm|( 1 );.i|
|00003a00| 66 20 28 20 66 72 65 61 | 64 28 20 6b 65 79 2c 20 |f ( frea|d( key, |
|00003a10| 31 2c 20 33 2c 20 73 74 | 64 69 6e 20 29 20 3d 3d |1, 3, st|din ) ==|
|00003a20| 20 33 20 29 20 7b 0a 0a | 2f 2a 09 52 65 73 65 74 | 3 ) {..|/*.Reset|
|00003a30| 20 74 68 65 20 61 6c 61 | 72 6d 20 73 69 67 6e 61 | the ala|rm signa|
|00003a40| 6c 20 74 6f 20 62 65 20 | 69 67 6e 6f 72 65 64 2e |l to be |ignored.|
|00003a50| 09 2a 2f 0a 0a 09 73 69 | 67 6e 61 6c 28 20 53 49 |.*/...si|gnal( SI|
|00003a60| 47 41 4c 52 4d 2c 20 53 | 49 47 5f 49 47 4e 20 29 |GALRM, S|IG_IGN )|
|00003a70| 3b 0a 09 61 6c 61 72 6d | 28 20 30 20 29 3b 0a 0a |;..alarm|( 0 );..|
|00003a80| 2f 2a 09 50 69 63 6b 20 | 61 20 66 75 6e 63 74 69 |/*.Pick |a functi|
|00003a90| 6f 6e 2e 09 2a 2f 0a 0a | 09 73 77 69 74 63 68 20 |on..*/..|.switch |
|00003aa0| 28 20 6b 65 79 5b 32 5d | 20 29 20 7b 0a 09 09 63 |( key[2]| ) {...c|
|00003ab0| 61 73 65 20 27 43 27 20 | 3a 20 73 68 6f 77 70 72 |ase 'C' |: showpr|
|00003ac0| 6f 63 73 28 29 3b 20 64 | 69 72 65 63 74 69 6f 6e |ocs(); d|irection|
|00003ad0| 3d 48 45 52 45 3b 20 62 | 72 65 61 6b 3b 0a 09 09 |=HERE; b|reak;...|
|00003ae0| 63 61 73 65 20 27 44 27 | 20 3a 20 73 68 6f 77 75 |case 'D'| : showu|
|00003af0| 74 6d 70 28 29 3b 20 64 | 69 72 65 63 74 69 6f 6e |tmp(); d|irection|
|00003b00| 3d 48 45 52 45 3b 20 62 | 72 65 61 6b 3b 0a 09 09 |=HERE; b|reak;...|
|00003b10| 63 61 73 65 20 27 45 27 | 20 3a 20 73 68 6f 77 64 |case 'E'| : showd|
|00003b20| 69 72 28 20 4c 4f 43 4b | 44 49 52 2c 20 4c 4f 43 |ir( LOCK|DIR, LOC|
|00003b30| 4b 50 52 45 46 49 58 20 | 29 3b 20 64 69 72 65 63 |KPREFIX |); direc|
|00003b40| 74 69 6f 6e 3d 48 45 52 | 45 3b 20 62 72 65 61 6b |tion=HER|E; break|
|00003b50| 3b 0a 09 09 63 61 73 65 | 20 27 46 27 20 3a 20 73 |;...case| 'F' : s|
|00003b60| 68 6f 77 64 69 72 28 20 | 4d 41 49 4c 44 49 52 2c |howdir( |MAILDIR,|
|00003b70| 20 22 22 20 29 3b 20 64 | 69 72 65 63 74 69 6f 6e | "" ); d|irection|
|00003b80| 3d 48 45 52 45 3b 20 62 | 72 65 61 6b 3b 0a 09 09 |=HERE; b|reak;...|
|00003b90| 63 61 73 65 20 27 47 27 | 20 3a 20 73 68 6f 77 66 |case 'G'| : showf|
|00003ba0| 73 79 73 28 29 3b 20 64 | 69 72 65 63 74 69 6f 6e |sys(); d|irection|
|00003bb0| 3d 48 45 52 45 3b 20 62 | 72 65 61 6b 3b 0a 09 09 |=HERE; b|reak;...|
|00003bc0| 63 61 73 65 20 27 48 27 | 20 3a 20 73 68 6f 77 64 |case 'H'| : showd|
|00003bd0| 69 72 28 20 4c 4f 43 4b | 44 49 52 2c 20 43 4f 4d |ir( LOCK|DIR, COM|
|00003be0| 50 52 45 46 49 58 20 29 | 3b 20 64 69 72 65 63 74 |PREFIX )|; direct|
|00003bf0| 69 6f 6e 3d 48 45 52 45 | 3b 20 62 72 65 61 6b 3b |ion=HERE|; break;|
|00003c00| 0a 09 09 63 61 73 65 20 | 27 49 27 20 3a 20 73 68 |...case |'I' : sh|
|00003c10| 6f 77 64 69 72 28 20 4c | 4f 43 4b 44 49 52 2c 20 |owdir( L|OCKDIR, |
|00003c20| 55 55 58 50 52 45 46 49 | 58 20 29 3b 20 64 69 72 |UUXPREFI|X ); dir|
|00003c30| 65 63 74 69 6f 6e 3d 48 | 45 52 45 3b 20 62 72 65 |ection=H|ERE; bre|
|00003c40| 61 6b 3b 0a 09 09 63 61 | 73 65 20 27 4a 27 20 3a |ak;...ca|se 'J' :|
|00003c50| 20 73 68 6f 77 64 69 72 | 28 20 4c 4f 43 4b 44 49 | showdir|( LOCKDI|
|00003c60| 52 2c 20 22 22 20 29 3b | 20 64 69 72 65 63 74 69 |R, "" );| directi|
|00003c70| 6f 6e 3d 48 45 52 45 3b | 20 62 72 65 61 6b 3b 0a |on=HERE;| break;.|
|00003c80| 09 09 63 61 73 65 20 27 | 70 27 20 3a 20 0a 09 09 |..case '|p' : ...|
|00003c90| 63 61 73 65 20 27 50 27 | 20 3a 20 64 69 72 65 63 |case 'P'| : direc|
|00003ca0| 74 69 6f 6e 20 3d 20 46 | 4f 52 57 41 52 44 3b 20 |tion = F|ORWARD; |
|00003cb0| 62 72 65 61 6b 3b 0a 09 | 09 63 61 73 65 20 27 71 |break;..|.case 'q|
|00003cc0| 27 20 3a 0a 09 09 63 61 | 73 65 20 27 51 27 20 3a |' :...ca|se 'Q' :|
|00003cd0| 20 64 69 72 65 63 74 69 | 6f 6e 20 3d 20 42 41 43 | directi|on = BAC|
|00003ce0| 4b 57 41 52 44 3b 20 62 | 72 65 61 6b 3b 0a 09 09 |KWARD; b|reak;...|
|00003cf0| 63 61 73 65 20 27 5a 27 | 20 3a 20 68 65 6c 70 28 |case 'Z'| : help(|
|00003d00| 29 3b 20 64 69 72 65 63 | 74 69 6f 6e 20 3d 20 48 |); direc|tion = H|
|00003d10| 45 52 45 3b 20 62 72 65 | 61 6b 3b 0a 09 09 64 65 |ERE; bre|ak;...de|
|00003d20| 66 61 75 6c 74 20 3a 20 | 64 69 72 65 63 74 69 6f |fault : |directio|
|00003d30| 6e 20 3d 20 4e 4f 57 48 | 45 52 45 3b 20 62 72 65 |n = NOWH|ERE; bre|
|00003d40| 61 6b 3b 0a 09 09 7d 0a | 09 7d 0a 09 65 6c 73 65 |ak;...}.|.}..else|
|00003d50| 0a 09 09 64 69 72 65 63 | 74 69 6f 6e 20 3d 20 4e |...direc|tion = N|
|00003d60| 4f 57 48 45 52 45 3b 0a | 0a 2f 2a 09 52 65 73 65 |OWHERE;.|./*.Rese|
|00003d70| 74 20 74 68 65 20 61 6c | 61 72 6d 20 73 69 67 6e |t the al|arm sign|
|00003d80| 61 6c 20 74 6f 20 62 65 | 20 69 67 6e 6f 72 65 64 |al to be| ignored|
|00003d90| 2e 09 2a 2f 0a 0a 73 69 | 67 6e 61 6c 28 20 53 49 |..*/..si|gnal( SI|
|00003da0| 47 41 4c 52 4d 2c 20 53 | 49 47 5f 49 47 4e 20 29 |GALRM, S|IG_IGN )|
|00003db0| 3b 0a 61 6c 61 72 6d 28 | 20 30 20 29 3b 0a 72 65 |;.alarm(| 0 );.re|
|00003dc0| 74 75 72 6e 28 20 64 69 | 72 65 63 74 69 6f 6e 20 |turn( di|rection |
|00003dd0| 29 3b 0a 7d 0a 0a 6e 65 | 78 77 69 6e 28 20 77 69 |);.}..ne|xwin( wi|
|00003de0| 6e 6e 6f 2c 20 64 69 72 | 20 29 0a 69 6e 74 20 77 |nno, dir| ).int w|
|00003df0| 69 6e 6e 6f 2c 20 64 69 | 72 3b 0a 0a 2f 2a 09 44 |inno, di|r;../*.D|
|00003e00| 65 63 69 64 65 20 77 68 | 61 74 20 73 68 6f 75 6c |ecide wh|at shoul|
|00003e10| 64 20 62 65 20 74 68 65 | 20 6e 65 78 74 20 77 69 |d be the| next wi|
|00003e20| 6e 64 6f 77 2e 20 20 54 | 68 69 73 20 72 65 6c 69 |ndow. T|his reli|
|00003e30| 65 73 20 6f 6e 20 74 68 | 65 20 66 61 63 74 20 74 |es on th|e fact t|
|00003e40| 68 61 74 0a 09 77 68 65 | 6e 20 79 6f 75 20 6f 70 |hat..whe|n you op|
|00003e50| 65 6e 20 61 20 77 69 6e | 64 6f 77 20 64 65 76 69 |en a win|dow devi|
|00003e60| 63 65 20 64 69 72 65 63 | 74 6c 79 20 74 68 65 20 |ce direc|tly the |
|00003e70| 6f 70 65 6e 20 63 61 6c | 6c 20 77 69 6c 6c 20 66 |open cal|l will f|
|00003e80| 61 69 6c 20 69 66 20 69 | 74 20 68 61 73 0a 09 6e |ail if i|t has..n|
|00003e90| 6f 74 20 61 6c 72 65 61 | 64 79 20 62 65 65 6e 20 |ot alrea|dy been |
|00003ea0| 6f 70 65 6e 65 64 20 62 | 79 20 73 6f 6d 65 6f 6e |opened b|y someon|
|00003eb0| 65 20 65 6c 73 65 3b 20 | 74 68 69 73 20 69 73 20 |e else; |this is |
|00003ec0| 68 6f 77 20 77 65 20 66 | 69 6e 64 20 74 68 65 20 |how we f|ind the |
|00003ed0| 6f 70 65 6e 0a 09 77 69 | 6e 64 6f 77 73 2e 20 20 |open..wi|ndows. |
|00003ee0| 49 6e 76 69 73 69 62 6c | 65 20 77 69 6e 64 6f 77 |Invisibl|e window|
|00003ef0| 73 20 73 68 6f 75 6c 64 | 20 68 61 76 65 20 74 68 |s should| have th|
|00003f00| 65 69 72 20 75 73 65 72 | 2d 74 65 78 74 20 73 65 |eir user|-text se|
|00003f10| 74 20 74 6f 20 22 49 6e | 76 69 73 69 62 6c 65 22 |t to "In|visible"|
|00003f20| 0a 09 69 66 20 74 68 65 | 79 20 77 69 73 68 20 74 |..if the|y wish t|
|00003f30| 6f 20 62 65 20 69 67 6e | 6f 72 65 64 2e 09 2a 2f |o be ign|ored..*/|
|00003f40| 0a 0a 7b 0a 69 6e 74 09 | 09 77 64 3b 0a 63 68 61 |..{.int.|.wd;.cha|
|00003f50| 72 09 77 69 6e 64 65 78 | 5b 31 32 5d 3b 0a 73 74 |r.windex|[12];.st|
|00003f60| 72 75 63 74 09 75 74 64 | 61 74 61 09 77 69 6e 74 |ruct.utd|ata.wint|
|00003f70| 65 78 74 3b 0a 0a 2f 2a | 09 54 72 69 76 69 61 6c |ext;../*|.Trivial|
|00003f80| 20 6c 6f 6f 70 3b 20 61 | 74 20 77 6f 72 73 74 2c | loop; a|t worst,|
|00003f90| 20 77 65 27 6c 6c 20 77 | 69 6e 64 20 75 70 20 62 | we'll w|ind up b|
|00003fa0| 61 63 6b 20 77 68 65 72 | 65 20 77 65 20 73 74 61 |ack wher|e we sta|
|00003fb0| 72 74 65 64 2e 20 20 49 | 20 73 75 70 70 6f 73 65 |rted. I| suppose|
|00003fc0| 0a 09 69 74 27 73 20 70 | 6f 73 73 69 62 6c 65 20 |..it's p|ossible |
|00003fd0| 74 6f 20 68 61 76 65 20 | 61 20 73 79 73 74 65 6d |to have |a system|
|00003fe0| 20 77 69 74 68 20 6e 6f | 20 77 69 6e 64 6f 77 73 | with no| windows|
|00003ff0| 20 65 78 63 65 70 74 20 | 74 68 6f 73 65 20 6d 61 | except |those ma|
|00004000| 72 6b 65 64 20 61 73 0a | 09 22 49 6e 76 69 73 69 |rked as.|."Invisi|
|00004010| 62 6c 65 22 3b 20 69 74 | 20 64 6f 65 73 6e 27 74 |ble"; it| doesn't|
|00004020| 20 73 65 65 6d 20 74 6f | 6f 20 75 73 65 66 75 6c | seem to|o useful|
|00004030| 2c 20 74 68 6f 75 67 68 | 2e 09 2a 2f 0a 0a 77 68 |, though|..*/..wh|
|00004040| 69 6c 65 20 28 20 31 20 | 29 20 7b 0a 0a 2f 2a 09 |ile ( 1 |) {../*.|
|00004050| 46 6f 72 77 61 72 64 2f | 62 61 63 6b 77 61 72 64 |Forward/|backward|
|00004060| 20 73 6f 72 74 2d 6f 66 | 20 6d 6f 64 75 6c 6f 20 | sort-of| modulo |
|00004070| 61 72 69 74 68 6d 65 74 | 69 63 2e 20 20 52 65 61 |arithmet|ic. Rea|
|00004080| 6c 20 6d 6f 64 75 6c 6f | 20 61 72 69 74 68 6d 65 |l modulo| arithme|
|00004090| 74 69 63 0a 09 73 74 61 | 72 74 73 20 61 74 20 7a |tic..sta|rts at z|
|000040a0| 65 72 6f 2e 09 2a 2f 0a | 0a 09 77 69 6e 6e 6f 20 |ero..*/.|..winno |
|000040b0| 2b 3d 20 28 20 64 69 72 | 20 3d 3d 20 46 4f 52 57 |+= ( dir| == FORW|
|000040c0| 41 52 44 20 3f 20 31 20 | 3a 20 2d 31 20 29 3b 0a |ARD ? 1 |: -1 );.|
|000040d0| 09 69 66 20 28 20 77 69 | 6e 6e 6f 20 3e 20 4d 41 |.if ( wi|nno > MA|
|000040e0| 58 57 49 4e 20 29 0a 09 | 09 77 69 6e 6e 6f 20 3d |XWIN )..|.winno =|
|000040f0| 20 4d 49 4e 57 49 4e 3b | 0a 09 65 6c 73 65 20 69 | MINWIN;|..else i|
|00004100| 66 20 28 20 77 69 6e 6e | 6f 20 3c 20 4d 49 4e 57 |f ( winn|o < MINW|
|00004110| 49 4e 20 29 0a 09 09 77 | 69 6e 6e 6f 20 3d 20 4d |IN )...w|inno = M|
|00004120| 41 58 57 49 4e 3b 0a 0a | 2f 2a 09 47 65 6e 65 72 |AXWIN;..|/*.Gener|
|00004130| 61 74 65 20 61 20 77 69 | 6e 64 6f 77 20 6e 61 6d |ate a wi|ndow nam|
|00004140| 65 20 61 6e 64 20 74 65 | 73 74 20 66 6f 72 20 65 |e and te|st for e|
|00004150| 78 69 73 74 65 6e 63 65 | 2e 09 2a 2f 0a 09 73 70 |xistence|..*/..sp|
|00004160| 72 69 6e 74 66 28 20 77 | 69 6e 64 65 78 2c 20 22 |rintf( w|index, "|
|00004170| 2f 64 65 76 2f 77 25 64 | 22 2c 20 77 69 6e 6e 6f |/dev/w%d|", winno|
|00004180| 20 29 3b 0a 09 69 66 20 | 28 20 28 20 77 64 20 3d | );..if |( ( wd =|
|00004190| 20 6f 70 65 6e 28 20 77 | 69 6e 64 65 78 2c 20 4f | open( w|index, O|
|000041a0| 5f 52 44 4f 4e 4c 59 20 | 29 20 29 20 21 3d 20 2d |_RDONLY |) ) != -|
|000041b0| 31 20 29 20 7b 0a 0a 2f | 2a 09 49 74 20 65 78 69 |1 ) {../|*.It exi|
|000041c0| 73 74 73 2c 20 6e 6f 77 | 20 6c 6f 6f 6b 20 61 74 |sts, now| look at|
|000041d0| 20 69 74 73 20 75 73 65 | 72 20 74 65 78 74 20 69 | its use|r text i|
|000041e0| 6e 66 6f 2e 20 20 54 68 | 69 73 20 69 73 20 77 68 |nfo. Th|is is wh|
|000041f0| 65 72 65 20 22 49 6e 76 | 69 73 69 62 6c 65 22 0a |ere "Inv|isible".|
|00004200| 09 67 65 74 73 20 73 6b | 69 70 70 65 64 2e 09 2a |.gets sk|ipped..*|
|00004210| 2f 0a 0a 09 09 77 69 6e | 74 65 78 74 2e 75 74 5f |/....win|text.ut_|
|00004220| 6e 75 6d 20 3d 20 57 54 | 58 54 55 53 45 52 3b 0a |num = WT|XTUSER;.|
|00004230| 09 09 69 6f 63 74 6c 28 | 20 77 64 2c 20 57 49 4f |..ioctl(| wd, WIO|
|00004240| 43 47 45 54 54 45 58 54 | 2c 20 26 77 69 6e 74 65 |CGETTEXT|, &winte|
|00004250| 78 74 20 29 3b 0a 09 09 | 69 66 20 28 20 73 74 72 |xt );...|if ( str|
|00004260| 63 6d 70 28 20 77 69 6e | 74 65 78 74 2e 75 74 5f |cmp( win|text.ut_|
|00004270| 74 65 78 74 2c 20 22 49 | 6e 76 69 73 69 62 6c 65 |text, "I|nvisible|
|00004280| 22 20 29 20 29 0a 09 09 | 09 72 65 74 75 72 6e 28 |" ) )...|.return(|
|00004290| 20 77 64 20 29 3b 0a 09 | 09 65 6c 73 65 0a 09 09 | wd );..|.else...|
|000042a0| 09 63 6c 6f 73 65 28 20 | 77 64 20 29 3b 0a 09 09 |.close( |wd );...|
|000042b0| 7d 0a 09 7d 0a 7d 0a 0a | 73 68 6f 77 70 72 6f 63 |}..}.}..|showproc|
|000042c0| 73 28 29 0a 0a 2f 2a 09 | 46 69 6e 64 20 74 68 65 |s()../*.|Find the|
|000042d0| 20 70 72 6f 63 65 73 73 | 20 74 61 62 6c 65 3b 20 | process| table; |
|000042e0| 72 75 6e 20 74 68 72 6f | 75 67 68 20 69 74 2c 20 |run thro|ugh it, |
|000042f0| 6c 6f 6f 6b 69 6e 67 20 | 75 70 20 74 68 65 20 75 |looking |up the u|
|00004300| 73 65 72 20 61 72 65 61 | 73 20 61 6e 64 0a 09 70 |ser area|s and..p|
|00004310| 72 69 6e 74 69 6e 67 20 | 6f 75 74 20 73 6f 6d 65 |rinting |out some|
|00004320| 20 64 61 74 61 20 6f 6e | 20 65 61 63 68 20 6f 6e | data on| each on|
|00004330| 65 20 6f 6e 20 74 68 65 | 20 66 6c 79 2e 20 20 57 |e on the| fly. W|
|00004340| 6f 72 6b 73 20 6c 69 6b | 65 20 27 70 73 20 2d 65 |orks lik|e 'ps -e|
|00004350| 66 27 0a 09 63 6f 6d 6d | 61 6e 64 2e 09 2a 2f 0a |f'..comm|and..*/.|
|00004360| 0a 7b 0a 73 74 72 75 63 | 74 20 70 72 6f 63 09 2a |.{.struc|t proc.*|
|00004370| 70 70 74 3b 0a 73 74 61 | 74 69 63 20 73 74 72 75 |ppt;.sta|tic stru|
|00004380| 63 74 20 6e 6c 69 73 74 | 09 73 79 6d 5b 33 5d 20 |ct nlist|.sym[3] |
|00004390| 3d 20 7b 20 7b 20 22 74 | 75 68 69 22 2c 20 7d 2c |= { { "t|uhi", },|
|000043a0| 20 7b 20 22 70 72 6f 63 | 22 2c 20 7d 2c 20 7b 20 | { "proc|", }, { |
|000043b0| 28 63 68 61 72 20 2a 29 | 30 2c 20 7d 2c 20 7d 3b |(char *)|0, }, };|
|000043c0| 0a 73 74 72 75 63 74 20 | 74 75 6e 61 62 6c 65 09 |.struct |tunable.|
|000043d0| 74 75 6e 65 3b 0a 69 6e | 74 09 6d 65 6d 2c 20 6b |tune;.in|t.mem, k|
|000043e0| 6d 65 6d 3b 0a 46 49 4c | 45 09 2a 77 70 3b 0a 0a |mem;.FIL|E.*wp;..|
|000043f0| 73 69 67 6e 61 6c 28 20 | 53 49 47 41 4c 52 4d 2c |signal( |SIGALRM,|
|00004400| 20 6a 75 73 74 67 6f 6f | 6e 20 29 3b 0a 0a 2f 2a | justgoo|n );../*|
|00004410| 09 4f 70 65 6e 20 75 70 | 20 61 20 77 69 6e 64 6f |.Open up| a windo|
|00004420| 77 3b 20 61 6c 73 6f 20 | 6f 70 65 6e 20 74 68 65 |w; also |open the|
|00004430| 20 6d 65 6d 6f 72 79 20 | 64 65 76 69 63 65 73 20 | memory |devices |
|00004440| 66 6f 72 20 72 65 61 64 | 69 6e 67 2e 09 2a 2f 0a |for read|ing..*/.|
|00004450| 0a 77 70 20 3d 20 66 6f | 70 65 6e 28 20 22 2f 64 |.wp = fo|pen( "/d|
|00004460| 65 76 2f 77 69 6e 64 6f | 77 22 2c 20 22 77 22 20 |ev/windo|w", "w" |
|00004470| 29 3b 0a 6d 65 6d 20 3d | 20 6f 70 65 6e 28 20 22 |);.mem =| open( "|
|00004480| 2f 64 65 76 2f 6d 65 6d | 22 2c 20 4f 5f 52 44 4f |/dev/mem|", O_RDO|
|00004490| 4e 4c 59 20 29 3b 0a 6b | 6d 65 6d 20 3d 20 6f 70 |NLY );.k|mem = op|
|000044a0| 65 6e 28 20 22 2f 64 65 | 76 2f 6b 6d 65 6d 22 2c |en( "/de|v/kmem",|
|000044b0| 20 4f 5f 52 44 4f 4e 4c | 59 20 29 3b 0a 0a 2f 2a | O_RDONL|Y );../*|
|000044c0| 09 46 69 6e 64 20 74 68 | 65 20 74 75 6e 61 62 6c |.Find th|e tunabl|
|000044d0| 65 20 70 61 72 61 6d 65 | 74 65 72 73 2c 20 74 6f |e parame|ters, to|
|000044e0| 20 67 65 74 20 74 68 65 | 20 6d 61 78 69 6d 75 6d | get the| maximum|
|000044f0| 20 6e 75 6d 62 65 72 20 | 6f 66 20 70 72 6f 63 65 | number |of proce|
|00004500| 73 73 65 73 3b 20 61 6e | 64 0a 09 74 68 65 20 70 |sses; an|d..the p|
|00004510| 72 6f 63 65 73 73 20 74 | 61 62 6c 65 2e 09 2a 2f |rocess t|able..*/|
|00004520| 0a 0a 6e 6c 69 73 74 28 | 20 22 2f 75 6e 69 78 22 |..nlist(| "/unix"|
|00004530| 2c 20 73 79 6d 20 29 3b | 0a 64 6d 65 6d 63 6f 70 |, sym );|.dmemcop|
|00004540| 79 28 20 6b 6d 65 6d 2c | 20 28 63 68 61 72 20 2a |y( kmem,| (char *|
|00004550| 29 26 74 75 6e 65 2c 20 | 28 6c 6f 6e 67 29 28 73 |)&tune, |(long)(s|
|00004560| 79 6d 5b 30 5d 2e 6e 5f | 76 61 6c 75 65 29 2c 20 |ym[0].n_|value), |
|00004570| 28 6c 6f 6e 67 29 73 69 | 7a 65 6f 66 28 20 74 75 |(long)si|zeof( tu|
|00004580| 6e 65 20 29 20 29 3b 0a | 64 6d 65 6d 63 6f 70 79 |ne ) );.|dmemcopy|
|00004590| 28 20 6b 6d 65 6d 2c 20 | 28 63 68 61 72 20 2a 29 |( kmem, |(char *)|
|000045a0| 26 70 70 74 2c 20 28 6c | 6f 6e 67 29 28 73 79 6d |&ppt, (l|ong)(sym|
|000045b0| 5b 31 5d 2e 6e 5f 76 61 | 6c 75 65 29 2c 20 28 6c |[1].n_va|lue), (l|
|000045c0| 6f 6e 67 29 73 69 7a 65 | 6f 66 28 20 70 70 74 20 |ong)size|of( ppt |
|000045d0| 29 20 29 3b 0a 0a 2f 2a | 09 52 75 6e 20 74 68 72 |) );../*|.Run thr|
|000045e0| 6f 75 67 68 20 74 68 65 | 20 70 72 6f 63 65 73 73 |ough the| process|
|000045f0| 20 74 61 62 6c 65 2e 09 | 2a 2f 0a 0a 66 70 72 69 | table..|*/..fpri|
|00004600| 6e 74 66 28 20 77 70 2c | 20 22 52 45 41 4c 20 55 |ntf( wp,| "REAL U|
|00004610| 49 44 20 45 46 45 43 54 | 20 49 44 20 20 50 49 44 |ID EFECT| ID PID|
|00004620| 20 20 20 50 50 49 44 20 | 53 54 41 52 54 20 54 49 | PPID |START TI|
|00004630| 4d 45 20 20 20 20 54 54 | 59 20 20 43 4f 4d 4d 41 |ME TT|Y COMMA|
|00004640| 4e 44 5c 6e 22 20 29 3b | 0a 77 68 69 6c 65 20 28 |ND\n" );|.while (|
|00004650| 20 74 75 6e 65 2e 6e 70 | 72 6f 63 2d 2d 20 29 0a | tune.np|roc-- ).|
|00004660| 09 70 72 69 6e 74 70 72 | 6f 63 28 20 77 70 2c 20 |.printpr|oc( wp, |
|00004670| 6b 6d 65 6d 2c 20 6d 65 | 6d 2c 20 70 70 74 2b 2b |kmem, me|m, ppt++|
|00004680| 20 29 3b 0a 0a 2f 2a 09 | 45 6d 70 74 79 20 74 68 | );../*.|Empty th|
|00004690| 65 20 6f 75 74 70 75 74 | 20 62 75 66 66 65 72 2c |e output| buffer,|
|000046a0| 20 73 6c 65 65 70 20 74 | 6f 20 61 6c 6c 6f 77 20 | sleep t|o allow |
|000046b0| 69 74 20 74 6f 20 62 65 | 20 72 65 61 64 2c 20 61 |it to be| read, a|
|000046c0| 6e 64 20 63 6c 6f 73 65 | 20 75 70 20 74 68 65 0a |nd close| up the.|
|000046d0| 09 65 78 74 72 61 20 77 | 69 6e 64 6f 77 20 61 6e |.extra w|indow an|
|000046e0| 64 20 72 65 74 75 72 6e | 2e 09 2a 2f 0a 0a 66 66 |d return|..*/..ff|
|000046f0| 6c 75 73 68 28 20 77 70 | 20 29 3b 0a 73 6c 65 65 |lush( wp| );.slee|
|00004700| 70 28 20 57 48 4f 53 4c | 45 45 50 20 29 3b 0a 66 |p( WHOSL|EEP );.f|
|00004710| 63 6c 6f 73 65 28 20 77 | 70 20 29 3b 0a 73 69 67 |close( w|p );.sig|
|00004720| 6e 61 6c 28 20 53 49 47 | 41 4c 52 4d 2c 20 53 49 |nal( SIG|ALRM, SI|
|00004730| 47 5f 49 47 4e 20 29 3b | 0a 7d 0a 0a 73 68 6f 77 |G_IGN );|.}..show|
|00004740| 75 74 6d 70 28 29 0a 0a | 2f 2a 09 52 75 6e 20 74 |utmp()..|/*.Run t|
|00004750| 68 72 6f 75 67 68 20 74 | 68 65 20 75 74 6d 70 20 |hrough t|he utmp |
|00004760| 66 69 6c 65 2e 20 20 55 | 73 65 64 20 74 6f 20 67 |file. U|sed to g|
|00004770| 69 76 65 20 61 6e 20 69 | 64 65 61 20 6f 66 20 73 |ive an i|dea of s|
|00004780| 79 73 74 65 6d 20 61 63 | 74 69 76 69 74 79 2e 09 |ystem ac|tivity..|
|00004790| 2a 2f 0a 0a 7b 0a 73 74 | 72 75 63 74 09 75 74 6d |*/..{.st|ruct.utm|
|000047a0| 70 20 2a 75 74 2c 20 2a | 67 65 74 75 74 65 6e 74 |p *ut, *|getutent|
|000047b0| 28 29 3b 0a 46 49 4c 45 | 09 2a 77 70 3b 0a 0a 73 |();.FILE|.*wp;..s|
|000047c0| 69 67 6e 61 6c 28 20 53 | 49 47 41 4c 52 4d 2c 20 |ignal( S|IGALRM, |
|000047d0| 6a 75 73 74 67 6f 6f 6e | 20 29 3b 0a 77 70 20 3d |justgoon| );.wp =|
|000047e0| 20 66 6f 70 65 6e 28 20 | 22 2f 64 65 76 2f 77 69 | fopen( |"/dev/wi|
|000047f0| 6e 64 6f 77 22 2c 20 22 | 77 22 20 29 3b 0a 0a 2f |ndow", "|w" );../|
|00004800| 2a 09 47 6f 20 74 68 72 | 6f 75 67 68 20 75 74 6d |*.Go thr|ough utm|
|00004810| 70 2e 20 20 53 68 6f 77 | 20 6c 6f 67 69 6e 20 61 |p. Show| login a|
|00004820| 6e 64 20 75 73 65 72 20 | 70 72 6f 63 65 73 73 65 |nd user |processe|
|00004830| 73 2e 09 2a 2f 0a 0a 77 | 68 69 6c 65 20 28 20 28 |s..*/..w|hile ( (|
|00004840| 20 75 74 20 3d 20 67 65 | 74 75 74 65 6e 74 28 29 | ut = ge|tutent()|
|00004850| 20 29 20 21 3d 20 4e 55 | 4c 4c 20 29 20 7b 0a 09 | ) != NU|LL ) {..|
|00004860| 73 77 69 74 63 68 20 28 | 20 28 69 6e 74 29 20 75 |switch (| (int) u|
|00004870| 74 2d 3e 75 74 5f 74 79 | 70 65 20 29 20 7b 0a 09 |t->ut_ty|pe ) {..|
|00004880| 09 63 61 73 65 20 55 53 | 45 52 5f 50 52 4f 43 45 |.case US|ER_PROCE|
|00004890| 53 53 20 3a 20 0a 09 09 | 63 61 73 65 20 4c 4f 47 |SS : ...|case LOG|
|000048a0| 49 4e 5f 50 52 4f 43 45 | 53 53 20 3a 20 73 68 6f |IN_PROCE|SS : sho|
|000048b0| 77 75 74 65 6e 74 28 20 | 77 70 2c 20 75 74 20 29 |wutent( |wp, ut )|
|000048c0| 3b 0a 09 09 64 65 66 61 | 75 6c 74 20 3a 20 62 72 |;...defa|ult : br|
|000048d0| 65 61 6b 3b 0a 09 09 7d | 0a 09 7d 0a 65 6e 64 75 |eak;...}|..}.endu|
|000048e0| 74 65 6e 74 28 29 3b 0a | 66 70 72 69 6e 74 66 28 |tent();.|fprintf(|
|000048f0| 20 77 70 2c 20 22 5c 6e | 22 20 29 3b 0a 66 66 6c | wp, "\n|" );.ffl|
|00004900| 75 73 68 28 20 77 70 20 | 29 3b 0a 73 6c 65 65 70 |ush( wp |);.sleep|
|00004910| 28 20 57 48 4f 53 4c 45 | 45 50 20 29 3b 0a 66 63 |( WHOSLE|EP );.fc|
|00004920| 6c 6f 73 65 28 20 77 70 | 20 29 3b 0a 73 69 67 6e |lose( wp| );.sign|
|00004930| 61 6c 28 20 53 49 47 41 | 4c 52 4d 2c 20 53 49 47 |al( SIGA|LRM, SIG|
|00004940| 5f 49 47 4e 20 29 3b 0a | 7d 0a 0a 73 68 6f 77 64 |_IGN );.|}..showd|
|00004950| 69 72 28 20 64 69 72 6e | 61 6d 65 2c 20 6d 61 73 |ir( dirn|ame, mas|
|00004960| 6b 20 29 0a 63 68 61 72 | 09 2a 64 69 72 6e 61 6d |k ).char|.*dirnam|
|00004970| 65 2c 20 2a 6d 61 73 6b | 3b 0a 0a 2f 2a 09 44 69 |e, *mask|;../*.Di|
|00004980| 73 70 6c 61 79 20 74 68 | 65 20 63 6f 6e 74 65 6e |splay th|e conten|
|00004990| 74 73 20 6f 66 20 61 20 | 64 69 72 65 63 74 6f 72 |ts of a |director|
|000049a0| 79 2e 20 20 55 73 65 20 | 27 6d 61 73 6b 27 20 74 |y. Use |'mask' t|
|000049b0| 6f 20 73 70 65 63 69 66 | 79 20 61 20 66 69 6c 65 |o specif|y a file|
|000049c0| 20 70 72 65 66 69 78 0a | 09 73 74 72 69 6e 67 20 | prefix.|.string |
|000049d0| 74 6f 20 6c 6f 6f 6b 20 | 66 6f 72 3b 20 75 73 65 |to look |for; use|
|000049e0| 66 75 6c 20 66 6f 72 20 | 66 69 6e 64 69 6e 67 20 |ful for |finding |
|000049f0| 27 4c 43 4b 2e 2e 27 20 | 66 69 6c 65 73 2e 09 2a |'LCK..' |files..*|
|00004a00| 2f 0a 0a 7b 0a 44 49 52 | 09 2a 64 69 72 70 3b 0a |/..{.DIR|.*dirp;.|
|00004a10| 73 74 72 75 63 74 09 64 | 69 72 65 63 74 79 20 2a |struct.d|irecty *|
|00004a20| 64 69 72 3b 0a 46 49 4c | 45 09 2a 77 70 3b 0a 69 |dir;.FIL|E.*wp;.i|
|00004a30| 6e 74 09 6d 6c 65 6e 3b | 0a 0a 73 69 67 6e 61 6c |nt.mlen;|..signal|
|00004a40| 28 20 53 49 47 41 4c 52 | 4d 2c 20 6a 75 73 74 67 |( SIGALR|M, justg|
|00004a50| 6f 6f 6e 20 29 3b 0a 77 | 70 20 3d 20 66 6f 70 65 |oon );.w|p = fope|
|00004a60| 6e 28 20 22 2f 64 65 76 | 2f 77 69 6e 64 6f 77 22 |n( "/dev|/window"|
|00004a70| 2c 20 22 77 22 20 29 3b | 0a 64 69 72 70 20 3d 20 |, "w" );|.dirp = |
|00004a80| 6f 70 65 6e 64 69 72 28 | 20 64 69 72 6e 61 6d 65 |opendir(| dirname|
|00004a90| 20 29 3b 0a 6d 6c 65 6e | 20 3d 20 73 74 72 6c 65 | );.mlen| = strle|
|00004aa0| 6e 28 20 6d 61 73 6b 20 | 29 3b 0a 77 68 69 6c 65 |n( mask |);.while|
|00004ab0| 20 28 20 28 20 64 69 72 | 20 3d 20 72 65 61 64 64 | ( ( dir| = readd|
|00004ac0| 69 72 28 20 64 69 72 70 | 20 29 20 29 20 21 3d 20 |ir( dirp| ) ) != |
|00004ad0| 4e 55 4c 4c 20 29 20 7b | 0a 09 69 66 20 28 20 28 |NULL ) {|..if ( (|
|00004ae0| 20 64 69 72 2d 3e 64 5f | 6e 61 6d 65 5b 30 5d 20 | dir->d_|name[0] |
|00004af0| 21 3d 20 27 2e 27 20 29 | 20 26 26 20 28 20 21 73 |!= '.' )| && ( !s|
|00004b00| 74 72 6e 63 6d 70 28 20 | 64 69 72 2d 3e 64 5f 6e |trncmp( |dir->d_n|
|00004b10| 61 6d 65 2c 20 6d 61 73 | 6b 2c 20 6d 6c 65 6e 20 |ame, mas|k, mlen |
|00004b20| 29 20 29 20 29 7b 0a 09 | 09 66 70 72 69 6e 74 66 |) ) ){..|.fprintf|
|00004b30| 28 20 77 70 2c 20 22 5c | 6e 25 73 25 73 22 2c 20 |( wp, "\|n%s%s", |
|00004b40| 64 69 72 6e 61 6d 65 2c | 20 64 69 72 2d 3e 64 5f |dirname,| dir->d_|
|00004b50| 6e 61 6d 65 20 29 3b 0a | 09 09 7d 0a 09 7d 0a 63 |name );.|..}..}.c|
|00004b60| 6c 6f 73 65 64 69 72 28 | 20 64 69 72 70 20 29 3b |losedir(| dirp );|
|00004b70| 0a 66 70 72 69 6e 74 66 | 28 20 77 70 2c 20 22 5c |.fprintf|( wp, "\|
|00004b80| 6e 22 20 29 3b 0a 66 66 | 6c 75 73 68 28 20 77 70 |n" );.ff|lush( wp|
|00004b90| 20 29 3b 0a 73 6c 65 65 | 70 28 20 57 48 4f 53 4c | );.slee|p( WHOSL|
|00004ba0| 45 45 50 20 29 3b 0a 66 | 63 6c 6f 73 65 28 20 77 |EEP );.f|close( w|
|00004bb0| 70 20 29 3b 0a 73 69 67 | 6e 61 6c 28 20 53 49 47 |p );.sig|nal( SIG|
|00004bc0| 41 4c 52 4d 2c 20 53 49 | 47 5f 49 47 4e 20 29 3b |ALRM, SI|G_IGN );|
|00004bd0| 0a 7d 0a 0a 73 68 6f 77 | 66 73 79 73 28 29 0a 0a |.}..show|fsys()..|
|00004be0| 2f 2a 09 53 68 6f 77 20 | 74 68 65 20 72 6f 6f 74 |/*.Show |the root|
|00004bf0| 20 66 69 6c 65 20 73 79 | 73 74 65 6d 20 73 74 61 | file sy|stem sta|
|00004c00| 74 69 73 74 69 63 73 2e | 20 20 52 65 61 64 20 74 |tistics.| Read t|
|00004c10| 68 65 20 73 75 70 65 72 | 62 6c 6f 63 6b 20 69 6e |he super|block in|
|00004c20| 20 61 6e 64 20 67 65 74 | 0a 09 66 72 65 65 20 62 | and get|..free b|
|00004c30| 6c 6f 63 6b 73 2c 20 74 | 6f 74 61 6c 20 62 6c 6f |locks, t|otal blo|
|00004c40| 63 6b 73 2c 20 61 6e 64 | 20 66 72 65 65 20 69 6e |cks, and| free in|
|00004c50| 6f 64 65 73 20 66 72 6f | 6d 20 69 74 2e 20 20 41 |odes fro|m it. A|
|00004c60| 6c 73 6f 20 64 69 73 70 | 6c 61 79 20 74 68 65 0a |lso disp|lay the.|
|00004c70| 09 66 72 65 65 73 70 61 | 63 65 20 61 73 20 61 20 |.freespa|ce as a |
|00004c80| 70 65 72 63 65 6e 74 61 | 67 65 2e 09 2a 2f 0a 0a |percenta|ge..*/..|
|00004c90| 7b 0a 69 6e 74 20 72 70 | 3b 0a 73 74 72 75 63 74 |{.int rp|;.struct|
|00004ca0| 20 66 69 6c 73 79 73 20 | 66 73 3b 0a 0a 73 69 67 | filsys |fs;..sig|
|00004cb0| 6e 61 6c 28 20 53 49 47 | 41 4c 52 4d 2c 20 6a 75 |nal( SIG|ALRM, ju|
|00004cc0| 73 74 67 6f 6f 6e 20 29 | 3b 0a 72 70 20 3d 20 6f |stgoon )|;.rp = o|
|00004cd0| 70 65 6e 28 20 22 2f 64 | 65 76 2f 72 66 70 30 30 |pen( "/d|ev/rfp00|
|00004ce0| 32 22 2c 20 4f 5f 52 44 | 4f 4e 4c 59 20 29 3b 0a |2", O_RD|ONLY );.|
|00004cf0| 6c 73 65 65 6b 28 20 72 | 70 2c 20 35 31 32 2c 20 |lseek( r|p, 512, |
|00004d00| 30 20 29 3b 0a 72 65 61 | 64 28 20 72 70 2c 20 26 |0 );.rea|d( rp, &|
|00004d10| 66 73 2c 20 73 69 7a 65 | 6f 66 28 20 66 73 20 29 |fs, size|of( fs )|
|00004d20| 20 29 3b 0a 63 6c 6f 73 | 65 28 20 72 70 20 29 3b | );.clos|e( rp );|
|00004d30| 0a 70 72 69 6e 74 66 28 | 20 22 5c 6e 52 6f 6f 74 |.printf(| "\nRoot|
|00004d40| 3a 20 25 6c 64 4b 20 66 | 72 65 65 20 25 6c 64 4b |: %ldK f|ree %ldK|
|00004d50| 20 74 6f 74 61 6c 20 25 | 64 25 25 20 66 72 65 65 | total %|d%% free|
|00004d60| 20 25 64 20 69 6e 6f 64 | 65 73 22 2c 20 66 73 2e | %d inod|es", fs.|
|00004d70| 73 5f 74 66 72 65 65 2c | 0a 09 66 73 2e 73 5f 66 |s_tfree,|..fs.s_f|
|00004d80| 73 69 7a 65 2c 20 28 69 | 6e 74 29 28 31 30 30 2e |size, (i|nt)(100.|
|00004d90| 30 2a 28 66 6c 6f 61 74 | 29 28 66 73 2e 73 5f 74 |0*(float|)(fs.s_t|
|00004da0| 66 72 65 65 29 2f 28 66 | 6c 6f 61 74 29 28 66 73 |free)/(f|loat)(fs|
|00004db0| 2e 73 5f 66 73 69 7a 65 | 29 29 2c 0a 09 66 73 2e |.s_fsize|)),..fs.|
|00004dc0| 73 5f 74 69 6e 6f 64 65 | 20 29 3b 0a 66 66 6c 75 |s_tinode| );.fflu|
|00004dd0| 73 68 28 20 73 74 64 6f | 75 74 20 29 3b 0a 73 6c |sh( stdo|ut );.sl|
|00004de0| 65 65 70 28 20 35 20 29 | 3b 0a 70 72 69 6e 74 66 |eep( 5 )|;.printf|
|00004df0| 28 20 22 5c 6e 22 20 29 | 3b 0a 73 69 67 6e 61 6c |( "\n" )|;.signal|
|00004e00| 28 20 53 49 47 41 4c 52 | 4d 2c 20 53 49 47 5f 49 |( SIGALR|M, SIG_I|
|00004e10| 47 4e 20 29 3b 0a 7d 0a | 0a 68 65 6c 70 28 29 0a |GN );.}.|.help().|
|00004e20| 0a 2f 2a 09 50 72 69 6e | 74 20 61 20 68 65 6c 70 |./*.Prin|t a help|
|00004e30| 20 6d 65 73 73 61 67 65 | 20 6f 6e 20 6b 65 79 20 | message| on key |
|00004e40| 75 73 61 67 65 2e 09 2a | 2f 0a 0a 7b 0a 46 49 4c |usage..*|/..{.FIL|
|00004e50| 45 09 2a 77 70 3b 0a 0a | 73 69 67 6e 61 6c 28 20 |E.*wp;..|signal( |
|00004e60| 53 49 47 41 4c 52 4d 2c | 20 6a 75 73 74 67 6f 6f |SIGALRM,| justgoo|
|00004e70| 6e 20 29 3b 0a 77 70 20 | 3d 20 66 6f 70 65 6e 28 |n );.wp |= fopen(|
|00004e80| 20 22 2f 64 65 76 2f 77 | 69 6e 64 6f 77 22 2c 20 | "/dev/w|indow", |
|00004e90| 22 77 22 20 29 3b 0a 66 | 70 72 69 6e 74 66 28 20 |"w" );.f|printf( |
|00004ea0| 77 70 2c 20 22 5c 74 2d | 20 50 68 6f 6e 65 20 6c |wp, "\t-| Phone l|
|00004eb0| 69 6e 65 20 73 74 61 74 | 65 73 5c 6e 5c 74 5c 74 |ine stat|es\n\t\t|
|00004ec0| 6f 20 49 64 6c 65 20 2d | 20 63 6f 6d 70 6c 65 74 |o Idle -| complet|
|00004ed0| 65 6c 79 20 66 72 65 65 | 20 6c 69 6e 65 5c 6e 22 |ely free| line\n"|
|00004ee0| 20 29 3b 0a 66 70 72 69 | 6e 74 66 28 20 77 70 2c | );.fpri|ntf( wp,|
|00004ef0| 20 22 5c 74 5c 74 6f 20 | 41 6e 73 72 20 2d 20 63 | "\t\to |Ansr - c|
|00004f00| 6f 6d 70 75 74 65 72 20 | 61 6e 73 77 65 72 69 6e |omputer |answerin|
|00004f10| 67 20 6c 69 6e 65 20 28 | 67 65 74 74 79 20 6a 6f |g line (|getty jo|
|00004f20| 62 29 5c 6e 22 20 29 3b | 0a 66 70 72 69 6e 74 66 |b)\n" );|.fprintf|
|00004f30| 28 20 77 70 2c 20 22 5c | 74 5c 74 6f 20 4d 61 63 |( wp, "\|t\to Mac|
|00004f40| 68 20 2d 20 69 6e 63 6f | 6d 69 6e 67 20 6d 61 63 |h - inco|ming mac|
|00004f50| 68 69 6e 65 5c 6e 5c 74 | 5c 74 6f 20 55 73 65 72 |hine\n\t|\to User|
|00004f60| 20 2d 20 69 6e 63 6f 6d | 69 6e 67 20 75 73 65 72 | - incom|ing user|
|00004f70| 5c 6e 22 20 29 3b 0a 66 | 70 72 69 6e 74 66 28 20 |\n" );.f|printf( |
|00004f80| 77 70 2c 20 22 5c 74 5c | 74 6f 20 43 61 6c 6c 20 |wp, "\t\|to Call |
|00004f90| 2d 20 61 6e 79 20 6f 75 | 74 62 6f 75 6e 64 5c 6e |- any ou|tbound\n|
|00004fa0| 5c 74 2d 20 42 6f 6f 74 | 20 64 61 74 65 20 61 6e |\t- Boot| date an|
|00004fb0| 64 20 74 69 6d 65 5c 6e | 22 20 29 3b 0a 66 70 72 |d time\n|" );.fpr|
|00004fc0| 69 6e 74 66 28 20 77 70 | 2c 20 22 5c 74 2d 20 43 |intf( wp|, "\t- C|
|00004fd0| 75 72 72 65 6e 74 20 72 | 75 6e 20 6c 65 76 65 6c |urrent r|un level|
|00004fe0| 5c 6e 5c 74 2d 20 43 75 | 72 72 65 6e 74 20 64 61 |\n\t- Cu|rrent da|
|00004ff0| 74 65 20 61 6e 64 20 74 | 69 6d 65 5c 6e 5c 74 2d |te and t|ime\n\t-|
|00005000| 20 4e 75 6d 62 65 72 20 | 6f 66 20 75 73 65 72 73 | Number |of users|
|00005010| 5c 6e 22 20 29 3b 0a 66 | 70 72 69 6e 74 66 28 20 |\n" );.f|printf( |
|00005020| 77 70 2c 20 22 5c 74 57 | 68 65 6e 20 53 75 73 70 |wp, "\tW|hen Susp|
|00005030| 65 6e 64 20 69 73 20 68 | 69 74 2c 20 69 74 20 6d |end is h|it, it m|
|00005040| 61 6b 65 73 20 74 68 65 | 20 6e 65 78 74 20 77 69 |akes the| next wi|
|00005050| 6e 64 6f 77 20 63 75 72 | 72 65 6e 74 3b 20 52 65 |ndow cur|rent; Re|
|00005060| 73 75 6d 65 5c 6e 22 20 | 29 3b 0a 66 70 72 69 6e |sume\n" |);.fprin|
|00005070| 74 66 28 20 77 70 2c 20 | 22 5c 74 6d 61 6b 65 73 |tf( wp, |"\tmakes|
|00005080| 20 74 68 65 20 6c 61 73 | 74 20 77 69 6e 64 6f 77 | the las|t window|
|00005090| 20 63 75 72 72 65 6e 74 | 2e 5c 6e 5c 6e 22 20 29 | current|.\n\n" )|
|000050a0| 3b 0a 66 70 72 69 6e 74 | 66 28 20 77 70 2c 20 22 |;.fprint|f( wp, "|
|000050b0| 5c 74 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |\tThe fo|llowing |
|000050c0| 66 75 6e 63 74 69 6f 6e | 73 20 61 72 65 20 6d 61 |function|s are ma|
|000050d0| 70 70 65 64 20 74 6f 20 | 74 68 65 20 66 75 6e 63 |pped to |the func|
|000050e0| 74 69 6f 6e 20 6b 65 79 | 73 3a 5c 6e 22 20 29 3b |tion key|s:\n" );|
|000050f0| 0a 66 70 72 69 6e 74 66 | 28 20 77 70 2c 20 22 5c |.fprintf|( wp, "\|
|00005100| 74 53 68 69 66 74 2d 46 | 31 3a 20 20 70 72 6f 63 |tShift-F|1: proc|
|00005110| 65 73 73 20 64 69 73 70 | 6c 61 79 2c 20 73 69 6d |ess disp|lay, sim|
|00005120| 69 6c 61 72 20 74 6f 20 | 27 70 73 20 2d 65 66 27 |ilar to |'ps -ef'|
|00005130| 5c 6e 22 20 29 3b 0a 66 | 70 72 69 6e 74 66 28 20 |\n" );.f|printf( |
|00005140| 77 70 2c 20 22 5c 74 53 | 68 69 66 74 2d 46 32 3a |wp, "\tS|hift-F2:|
|00005150| 20 20 75 74 6d 70 20 64 | 69 73 70 6c 61 79 2c 20 | utmp d|isplay, |
|00005160| 6c 69 6b 65 20 27 77 68 | 6f 27 5c 6e 22 20 29 3b |like 'wh|o'\n" );|
|00005170| 0a 66 70 72 69 6e 74 66 | 28 20 77 70 2c 20 22 5c |.fprintf|( wp, "\|
|00005180| 74 53 68 69 66 74 2d 46 | 33 3a 20 20 6c 69 73 74 |tShift-F|3: list|
|00005190| 73 20 55 55 43 50 20 4c | 43 4b 2e 2e 20 66 69 6c |s UUCP L|CK.. fil|
|000051a0| 65 73 2c 20 69 66 20 61 | 6e 79 5c 6e 22 20 29 3b |es, if a|ny\n" );|
|000051b0| 0a 66 70 72 69 6e 74 66 | 28 20 77 70 2c 20 22 5c |.fprintf|( wp, "\|
|000051c0| 74 53 68 69 66 74 2d 46 | 34 3a 20 20 64 69 72 65 |tShift-F|4: dire|
|000051d0| 63 74 6f 72 79 20 6f 66 | 20 2f 75 73 72 2f 6d 61 |ctory of| /usr/ma|
|000051e0| 69 6c 5c 6e 22 20 29 3b | 0a 66 70 72 69 6e 74 66 |il\n" );|.fprintf|
|000051f0| 28 20 77 70 2c 20 22 5c | 74 53 68 69 66 74 2d 46 |( wp, "\|tShift-F|
|00005200| 35 3a 20 20 52 6f 6f 74 | 20 66 69 6c 65 73 79 73 |5: Root| filesys|
|00005210| 74 65 6d 20 66 72 65 65 | 73 70 61 63 65 20 61 6e |tem free|space an|
|00005220| 64 20 66 72 65 65 20 69 | 6e 6f 64 65 73 5c 6e 22 |d free i|nodes\n"|
|00005230| 20 29 3b 0a 66 70 72 69 | 6e 74 66 28 20 77 70 2c | );.fpri|ntf( wp,|
|00005240| 20 22 5c 74 53 68 69 66 | 74 2d 46 36 3a 20 20 6c | "\tShif|t-F6: l|
|00005250| 69 73 74 73 20 55 55 43 | 50 20 43 2e 20 66 69 6c |ists UUC|P C. fil|
|00005260| 65 73 2c 20 69 66 20 61 | 6e 79 5c 6e 22 20 29 3b |es, if a|ny\n" );|
|00005270| 0a 66 70 72 69 6e 74 66 | 28 20 77 70 2c 20 22 5c |.fprintf|( wp, "\|
|00005280| 74 53 68 69 66 74 2d 46 | 37 3a 20 20 6c 69 73 74 |tShift-F|7: list|
|00005290| 73 20 55 55 43 50 20 58 | 2e 20 66 69 6c 65 73 2c |s UUCP X|. files,|
|000052a0| 20 69 66 20 61 6e 79 5c | 6e 22 20 29 3b 0a 66 70 | if any\|n" );.fp|
|000052b0| 72 69 6e 74 66 28 20 77 | 70 2c 20 22 5c 74 53 68 |rintf( w|p, "\tSh|
|000052c0| 69 66 74 2d 46 38 3a 20 | 20 64 69 72 65 63 74 6f |ift-F8: | directo|
|000052d0| 72 79 20 6f 66 20 2f 75 | 73 72 2f 73 70 6f 6f 6c |ry of /u|sr/spool|
|000052e0| 2f 75 75 63 70 5c 6e 22 | 20 29 3b 0a 66 70 72 69 |/uucp\n"| );.fpri|
|000052f0| 6e 74 66 28 20 77 70 2c | 20 22 5c 74 53 68 69 66 |ntf( wp,| "\tShif|
|00005300| 74 2d 50 72 69 6e 74 3a | 20 20 64 69 73 70 6c 61 |t-Print:| displa|
|00005310| 79 20 74 68 69 73 20 6c | 69 73 74 22 20 29 3b 0a |y this l|ist" );.|
|00005320| 66 66 6c 75 73 68 28 20 | 77 70 20 29 3b 0a 73 6c |fflush( |wp );.sl|
|00005330| 65 65 70 28 20 57 48 4f | 53 4c 45 45 50 20 29 3b |eep( WHO|SLEEP );|
|00005340| 0a 66 63 6c 6f 73 65 28 | 20 77 70 20 29 3b 0a 73 |.fclose(| wp );.s|
|00005350| 69 67 6e 61 6c 28 20 53 | 49 47 41 4c 52 4d 2c 20 |ignal( S|IGALRM, |
|00005360| 53 49 47 5f 49 47 4e 20 | 29 3b 0a 7d 0a 0a 64 6d |SIG_IGN |);.}..dm|
|00005370| 65 6d 63 6f 70 79 28 20 | 64 65 76 6d 65 6d 2c 20 |emcopy( |devmem, |
|00005380| 62 75 66 2c 20 6d 65 6d | 6c 6f 63 2c 20 6e 62 79 |buf, mem|loc, nby|
|00005390| 74 65 73 20 29 0a 69 6e | 74 09 64 65 76 6d 65 6d |tes ).in|t.devmem|
|000053a0| 3b 0a 63 68 61 72 09 2a | 62 75 66 3b 0a 6c 6f 6e |;.char.*|buf;.lon|
|000053b0| 67 09 6d 65 6d 6c 6f 63 | 2c 20 6e 62 79 74 65 73 |g.memloc|, nbytes|
|000053c0| 3b 0a 0a 2f 2a 09 52 65 | 61 64 20 66 72 6f 6d 20 |;../*.Re|ad from |
|000053d0| 61 20 6d 65 6d 6f 72 79 | 20 64 65 76 69 63 65 20 |a memory| device |
|000053e0| 69 6e 74 6f 20 61 20 6c | 6f 63 61 6c 20 62 75 66 |into a l|ocal buf|
|000053f0| 66 65 72 2e 09 2a 2f 0a | 0a 7b 0a 6c 73 65 65 6b |fer..*/.|.{.lseek|
|00005400| 28 20 64 65 76 6d 65 6d | 2c 20 6d 65 6d 6c 6f 63 |( devmem|, memloc|
|00005410| 2c 20 30 20 29 3b 0a 72 | 65 61 64 28 20 64 65 76 |, 0 );.r|ead( dev|
|00005420| 6d 65 6d 2c 20 62 75 66 | 2c 20 28 75 6e 73 69 67 |mem, buf|, (unsig|
|00005430| 6e 65 64 29 6e 62 79 74 | 65 73 20 29 3b 20 0a 7d |ned)nbyt|es ); .}|
|00005440| 0a 0a 70 72 69 6e 74 70 | 72 6f 63 28 20 77 70 2c |..printp|roc( wp,|
|00005450| 20 6b 6d 65 6d 2c 20 6d | 65 6d 2c 20 70 70 74 20 | kmem, m|em, ppt |
|00005460| 29 0a 46 49 4c 45 09 2a | 77 70 3b 0a 69 6e 74 09 |).FILE.*|wp;.int.|
|00005470| 6b 6d 65 6d 2c 20 6d 65 | 6d 3b 0a 73 74 72 75 63 |kmem, me|m;.struc|
|00005480| 74 20 70 72 6f 63 09 2a | 70 70 74 3b 0a 0a 2f 2a |t proc.*|ppt;../*|
|00005490| 09 47 65 74 20 61 20 70 | 72 6f 63 65 73 73 20 74 |.Get a p|rocess t|
|000054a0| 61 62 6c 65 20 65 6e 74 | 72 79 20 61 6e 64 20 70 |able ent|ry and p|
|000054b0| 72 69 6e 74 20 73 6f 6d | 65 20 6f 66 20 74 68 65 |rint som|e of the|
|000054c0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 66 72 6f | informa|tion fro|
|000054d0| 6d 20 69 74 2e 09 2a 2f | 0a 0a 7b 0a 73 74 72 75 |m it..*/|..{.stru|
|000054e0| 63 74 20 70 72 6f 63 20 | 70 3b 0a 73 74 72 75 63 |ct proc |p;.struc|
|000054f0| 74 20 75 73 65 72 09 75 | 3b 0a 73 74 72 75 63 74 |t user.u|;.struct|
|00005500| 20 70 61 73 73 77 64 09 | 2a 70 77 64 2c 20 2a 67 | passwd.|*pwd, *g|
|00005510| 65 74 70 77 75 69 64 28 | 29 3b 0a 63 68 61 72 09 |etpwuid(|);.char.|
|00005520| 63 75 72 74 69 6d 65 5b | 32 36 5d 2c 20 70 74 74 |curtime[|26], ptt|
|00005530| 79 5b 37 5d 2c 20 2a 67 | 65 74 70 74 74 79 28 29 |y[7], *g|etptty()|
|00005540| 3b 0a 0a 64 6d 65 6d 63 | 6f 70 79 28 20 6b 6d 65 |;..dmemc|opy( kme|
|00005550| 6d 2c 20 28 63 68 61 72 | 20 2a 29 26 70 2c 20 28 |m, (char| *)&p, (|
|00005560| 6c 6f 6e 67 29 70 70 74 | 2c 20 28 6c 6f 6e 67 29 |long)ppt|, (long)|
|00005570| 73 69 7a 65 6f 66 28 20 | 73 74 72 75 63 74 20 70 |sizeof( |struct p|
|00005580| 72 6f 63 20 29 20 29 3b | 0a 69 66 20 28 20 70 2e |roc ) );|.if ( p.|
|00005590| 70 5f 66 6c 61 67 20 26 | 20 53 4c 4f 41 44 20 29 |p_flag &| SLOAD )|
|000055a0| 20 7b 0a 09 64 6d 65 6d | 63 6f 70 79 28 20 6d 65 | {..dmem|copy( me|
|000055b0| 6d 2c 20 28 63 68 61 72 | 20 2a 29 26 75 2c 20 28 |m, (char| *)&u, (|
|000055c0| 6c 6f 6e 67 29 28 20 63 | 74 6f 62 28 20 70 2e 70 |long)( c|tob( p.p|
|000055d0| 5f 61 64 64 72 5b 30 5d | 20 29 2b 55 5f 4f 46 46 |_addr[0]| )+U_OFF|
|000055e0| 53 45 54 20 29 2c 0a 09 | 09 28 6c 6f 6e 67 29 73 |SET ),..|.(long)s|
|000055f0| 69 7a 65 6f 66 28 20 73 | 74 72 75 63 74 20 75 73 |izeof( s|truct us|
|00005600| 65 72 20 29 20 29 3b 0a | 09 70 77 64 20 3d 20 67 |er ) );.|.pwd = g|
|00005610| 65 74 70 77 75 69 64 28 | 20 70 2e 70 5f 75 69 64 |etpwuid(| p.p_uid|
|00005620| 20 29 3b 0a 09 66 70 72 | 69 6e 74 66 28 20 77 70 | );..fpr|intf( wp|
|00005630| 2c 20 22 25 38 73 20 22 | 2c 20 70 77 64 2d 3e 70 |, "%8s "|, pwd->p|
|00005640| 77 5f 6e 61 6d 65 20 29 | 3b 0a 09 70 77 64 20 3d |w_name )|;..pwd =|
|00005650| 20 67 65 74 70 77 75 69 | 64 28 20 70 2e 70 5f 73 | getpwui|d( p.p_s|
|00005660| 75 69 64 20 29 3b 0a 09 | 66 70 72 69 6e 74 66 28 |uid );..|fprintf(|
|00005670| 20 77 70 2c 20 22 25 38 | 73 20 25 35 64 20 25 35 | wp, "%8|s %5d %5|
|00005680| 64 20 22 2c 20 70 77 64 | 2d 3e 70 77 5f 6e 61 6d |d ", pwd|->pw_nam|
|00005690| 65 2c 20 70 2e 70 5f 70 | 69 64 2c 20 70 2e 70 5f |e, p.p_p|id, p.p_|
|000056a0| 70 70 69 64 20 29 3b 0a | 09 73 74 72 63 70 79 28 |ppid );.|.strcpy(|
|000056b0| 20 63 75 72 74 69 6d 65 | 2c 20 66 6d 74 74 69 6d | curtime|, fmttim|
|000056c0| 65 28 20 6c 6f 63 61 6c | 74 69 6d 65 28 20 26 75 |e( local|time( &u|
|000056d0| 2e 75 5f 73 74 61 72 74 | 20 29 20 29 20 29 3b 0a |.u_start| ) ) );.|
|000056e0| 09 73 74 72 63 70 79 28 | 20 70 74 74 79 2c 20 67 |.strcpy(| ptty, g|
|000056f0| 65 74 70 74 74 79 28 20 | 75 2e 75 5f 74 74 79 64 |etptty( |u.u_ttyd|
|00005700| 20 29 20 29 3b 0a 09 66 | 70 72 69 6e 74 66 28 20 | ) );..f|printf( |
|00005710| 77 70 2c 20 22 25 31 31 | 73 20 25 36 73 20 25 73 |wp, "%11|s %6s %s|
|00005720| 5c 6e 22 2c 20 63 75 72 | 74 69 6d 65 2c 20 70 74 |\n", cur|time, pt|
|00005730| 74 79 2c 20 75 2e 75 5f | 63 6f 6d 6d 20 29 3b 0a |ty, u.u_|comm );.|
|00005740| 09 66 66 6c 75 73 68 28 | 20 77 70 20 29 3b 0a 09 |.fflush(| wp );..|
|00005750| 7d 0a 7d 0a 0a 63 68 61 | 72 09 2a 67 65 74 70 74 |}.}..cha|r.*getpt|
|00005760| 74 79 28 20 64 65 76 6e | 6f 20 29 0a 64 65 76 5f |ty( devn|o ).dev_|
|00005770| 74 09 64 65 76 6e 6f 3b | 0a 0a 2f 2a 09 47 6f 20 |t.devno;|../*.Go |
|00005780| 66 72 6f 6d 20 61 20 64 | 65 76 69 63 65 20 6e 75 |from a d|evice nu|
|00005790| 6d 62 65 72 20 74 6f 20 | 61 20 64 65 76 69 63 65 |mber to |a device|
|000057a0| 20 6e 61 6d 65 2e 09 2a | 2f 0a 0a 7b 0a 44 49 52 | name..*|/..{.DIR|
|000057b0| 09 2a 64 69 72 70 3b 0a | 73 74 72 75 63 74 20 64 |.*dirp;.|struct d|
|000057c0| 69 72 65 63 74 79 09 2a | 64 69 72 3b 0a 73 74 72 |irecty.*|dir;.str|
|000057d0| 75 63 74 20 73 74 61 74 | 09 73 62 75 66 3b 0a 63 |uct stat|.sbuf;.c|
|000057e0| 68 61 72 09 6e 61 6d 65 | 5b 31 34 5d 3b 0a 73 74 |har.name|[14];.st|
|000057f0| 61 74 69 63 20 63 68 61 | 72 09 74 6e 61 6d 65 5b |atic cha|r.tname[|
|00005800| 37 5d 3b 0a 0a 73 74 72 | 63 70 79 28 20 74 6e 61 |7];..str|cpy( tna|
|00005810| 6d 65 2c 20 22 6e 6f 6e | 65 22 20 29 3b 0a 69 66 |me, "non|e" );.if|
|00005820| 20 28 20 21 64 65 76 6e | 6f 20 29 0a 09 72 65 74 | ( !devn|o )..ret|
|00005830| 75 72 6e 28 20 74 6e 61 | 6d 65 20 29 3b 0a 64 69 |urn( tna|me );.di|
|00005840| 72 70 20 3d 20 6f 70 65 | 6e 64 69 72 28 20 44 45 |rp = ope|ndir( DE|
|00005850| 56 44 49 52 20 29 3b 0a | 77 68 69 6c 65 20 28 20 |VDIR );.|while ( |
|00005860| 28 20 64 69 72 20 3d 20 | 72 65 61 64 64 69 72 28 |( dir = |readdir(|
|00005870| 20 64 69 72 70 20 29 20 | 29 20 21 3d 20 4e 55 4c | dirp ) |) != NUL|
|00005880| 4c 20 29 20 7b 0a 09 69 | 66 20 28 20 64 69 72 2d |L ) {..i|f ( dir-|
|00005890| 3e 64 5f 6e 61 6d 65 5b | 30 5d 20 21 3d 20 27 2e |>d_name[|0] != '.|
|000058a0| 27 20 29 20 7b 0a 09 09 | 73 74 72 63 70 79 28 20 |' ) {...|strcpy( |
|000058b0| 6e 61 6d 65 2c 20 44 45 | 56 44 49 52 20 29 3b 0a |name, DE|VDIR );.|
|000058c0| 09 09 73 74 72 63 61 74 | 28 20 6e 61 6d 65 2c 20 |..strcat|( name, |
|000058d0| 64 69 72 2d 3e 64 5f 6e | 61 6d 65 20 29 3b 0a 09 |dir->d_n|ame );..|
|000058e0| 09 73 74 61 74 28 20 6e | 61 6d 65 2c 20 26 73 62 |.stat( n|ame, &sb|
|000058f0| 75 66 20 29 3b 0a 09 09 | 69 66 20 28 20 64 65 76 |uf );...|if ( dev|
|00005900| 6e 6f 20 3d 3d 20 73 62 | 75 66 2e 73 74 5f 72 64 |no == sb|uf.st_rd|
|00005910| 65 76 20 29 20 7b 0a 09 | 09 09 63 6c 6f 73 65 64 |ev ) {..|..closed|
|00005920| 69 72 28 20 64 69 72 70 | 20 29 3b 0a 09 09 09 73 |ir( dirp| );....s|
|00005930| 74 72 63 70 79 28 20 74 | 6e 61 6d 65 2c 20 64 69 |trcpy( t|name, di|
|00005940| 72 2d 3e 64 5f 6e 61 6d | 65 20 29 3b 0a 09 09 09 |r->d_nam|e );....|
|00005950| 72 65 74 75 72 6e 28 20 | 74 6e 61 6d 65 20 29 3b |return( |tname );|
|00005960| 0a 09 09 09 7d 0a 09 09 | 7d 0a 09 7d 0a 63 6c 6f |....}...|}..}.clo|
|00005970| 73 65 64 69 72 28 20 64 | 69 72 70 20 29 3b 0a 72 |sedir( d|irp );.r|
|00005980| 65 74 75 72 6e 28 20 74 | 6e 61 6d 65 20 29 3b 0a |eturn( t|name );.|
|00005990| 7d 0a 0a 73 68 6f 77 75 | 74 65 6e 74 28 20 66 70 |}..showu|tent( fp|
|000059a0| 2c 20 75 20 29 0a 46 49 | 4c 45 09 2a 66 70 3b 0a |, u ).FI|LE.*fp;.|
|000059b0| 73 74 72 75 63 74 09 75 | 74 6d 70 20 2a 75 3b 0a |struct.u|tmp *u;.|
|000059c0| 0a 2f 2a 09 50 72 69 6e | 74 20 61 20 66 6f 72 6d |./*.Prin|t a form|
|000059d0| 61 74 74 65 64 20 75 74 | 6d 70 20 65 6e 74 72 79 |atted ut|mp entry|
|000059e0| 2e 09 2a 2f 0a 0a 7b 0a | 63 68 61 72 09 63 75 72 |..*/..{.|char.cur|
|000059f0| 74 69 6d 65 5b 32 36 5d | 2c 20 2a 66 6d 74 74 69 |time[26]|, *fmtti|
|00005a00| 6d 65 28 29 3b 0a 0a 73 | 74 72 63 70 79 28 20 63 |me();..s|trcpy( c|
|00005a10| 75 72 74 69 6d 65 2c 20 | 66 6d 74 74 69 6d 65 28 |urtime, |fmttime(|
|00005a20| 20 6c 6f 63 61 6c 74 69 | 6d 65 28 20 26 28 20 75 | localti|me( &( u|
|00005a30| 2d 3e 75 74 5f 74 69 6d | 65 20 29 20 29 20 29 20 |->ut_tim|e ) ) ) |
|00005a40| 29 3b 0a 66 70 72 69 6e | 74 66 28 20 66 70 2c 20 |);.fprin|tf( fp, |
|00005a50| 22 25 38 73 20 25 31 34 | 73 20 25 31 31 73 20 25 |"%8s %14|s %11s %|
|00005a60| 35 64 5c 6e 22 2c 20 75 | 2d 3e 75 74 5f 75 73 65 |5d\n", u|->ut_use|
|00005a70| 72 2c 20 75 2d 3e 75 74 | 5f 6c 69 6e 65 2c 20 63 |r, u->ut|_line, c|
|00005a80| 75 72 74 69 6d 65 2c 20 | 75 2d 3e 75 74 5f 70 69 |urtime, |u->ut_pi|
|00005a90| 64 20 29 3b 0a 7d 0a 0a | 53 48 41 52 5f 45 4f 46 |d );.}..|SHAR_EOF|
|00005aa0| 0a 66 69 20 23 20 65 6e | 64 20 6f 66 20 6f 76 65 |.fi # en|d of ove|
|00005ab0| 72 77 72 69 74 69 6e 67 | 20 63 68 65 63 6b 0a 69 |rwriting| check.i|
|00005ac0| 66 20 74 65 73 74 20 2d | 66 20 27 73 74 61 72 74 |f test -|f 'start|
|00005ad0| 6d 67 72 2e 63 27 0a 74 | 68 65 6e 0a 20 20 20 20 |mgr.c'.t|hen. |
|00005ae0| 20 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 77 69 | echo |shar: wi|
|00005af0| 6c 6c 20 6e 6f 74 20 6f | 76 65 72 2d 77 72 69 74 |ll not o|ver-writ|
|00005b00| 65 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |e existi|ng file |
|00005b10| 22 27 73 74 61 72 74 6d | 67 72 2e 63 27 22 0a 65 |"'startm|gr.c'".e|
|00005b20| 6c 73 65 0a 63 61 74 20 | 3c 3c 20 5c 53 48 41 52 |lse.cat |<< \SHAR|
|00005b30| 5f 45 4f 46 20 3e 20 27 | 73 74 61 72 74 6d 67 72 |_EOF > '|startmgr|
|00005b40| 2e 63 27 0a 2f 2a 09 73 | 74 61 72 74 6d 67 72 3a |.c'./*.s|tartmgr:|
|00005b50| 20 20 43 72 65 61 74 65 | 20 61 20 6f 6e 65 2d 6c | Create| a one-l|
|00005b60| 69 6e 65 20 77 69 6e 64 | 6f 77 20 6f 6e 20 74 68 |ine wind|ow on th|
|00005b70| 65 20 74 6f 70 20 6c 69 | 6e 65 20 6f 66 20 74 68 |e top li|ne of th|
|00005b80| 65 20 55 6e 69 78 2d 50 | 43 0a 09 28 37 33 30 30 |e Unix-P|C..(7300|
|00005b90| 2f 33 42 31 29 20 73 63 | 72 65 65 6e 20 61 6e 64 |/3B1) sc|reen and|
|00005ba0| 20 73 74 61 72 74 20 61 | 20 70 72 6f 67 72 61 6d | start a| program|
|00005bb0| 20 72 75 6e 6e 69 6e 67 | 20 69 6e 20 74 68 61 74 | running| in that|
|00005bc0| 20 77 69 6e 64 6f 77 2e | 0a 09 44 65 63 6c 61 72 | window.|..Declar|
|00005bd0| 65 20 74 68 69 73 20 77 | 69 6e 64 6f 77 20 74 6f |e this w|indow to|
|00005be0| 20 62 65 20 74 68 65 20 | 57 69 6e 64 6f 77 20 4d | be the |Window M|
|00005bf0| 61 6e 61 67 65 72 2c 20 | 77 68 69 63 68 20 67 69 |anager, |which gi|
|00005c00| 76 65 73 20 69 74 20 63 | 6f 6e 74 72 6f 6c 0a 09 |ves it c|ontrol..|
|00005c10| 6f 76 65 72 20 74 68 65 | 20 53 75 73 70 65 6e 64 |over the| Suspend|
|00005c20| 2c 20 52 65 73 75 6d 65 | 20 61 6e 64 20 50 72 69 |, Resume| and Pri|
|00005c30| 6e 74 20 6b 65 79 73 2e | 20 20 54 68 69 73 20 69 |nt keys.| This i|
|00005c40| 73 20 6d 65 61 6e 74 20 | 74 6f 20 62 65 20 75 73 |s meant |to be us|
|00005c50| 65 64 20 74 6f 0a 09 73 | 74 61 72 74 20 6e 65 77 |ed to..s|tart new|
|00005c60| 6d 67 72 2c 20 62 75 74 | 20 63 61 6e 20 70 72 6f |mgr, but| can pro|
|00005c70| 62 61 62 6c 79 20 62 65 | 20 61 64 61 70 74 65 64 |bably be| adapted|
|00005c80| 20 74 6f 20 62 65 20 61 | 20 66 61 69 72 6c 79 20 | to be a| fairly |
|00005c90| 67 65 6e 65 72 69 63 20 | 70 72 6f 67 72 61 6d 0a |generic |program.|
|00005ca0| 09 73 74 61 72 74 65 72 | 2e 20 20 49 74 20 77 61 |.starter|. It wa|
|00005cb0| 73 20 64 65 73 69 67 6e | 65 64 20 74 6f 20 6d 69 |s design|ed to mi|
|00005cc0| 6d 69 63 20 74 68 65 20 | 6f 62 73 65 72 76 65 64 |mic the |observed|
|00005cd0| 20 6f 70 65 72 61 74 69 | 6f 6e 20 6f 66 20 74 68 | operati|on of th|
|00005ce0| 69 6e 67 73 20 6c 69 6b | 65 0a 09 63 72 6f 6e 2c |ings lik|e..cron,|
|00005cf0| 20 73 6d 67 72 2c 20 65 | 74 63 2e 0a 0a 09 54 68 | smgr, e|tc....Th|
|00005d00| 69 73 20 73 6f 66 74 77 | 61 72 65 20 69 73 20 43 |is softw|are is C|
|00005d10| 6f 70 79 72 69 67 68 74 | 20 28 63 29 20 31 39 38 |opyright| (c) 198|
|00005d20| 37 20 62 79 20 53 63 6f | 74 74 20 48 61 7a 65 6e |7 by Sco|tt Hazen|
|00005d30| 20 4d 75 65 6c 6c 65 72 | 2e 0a 20 0a 09 50 65 72 | Mueller|.. ..Per|
|00005d40| 6d 69 73 73 69 6f 6e 20 | 69 73 20 68 65 72 65 62 |mission |is hereb|
|00005d50| 79 20 67 72 61 6e 74 65 | 64 20 74 6f 20 63 6f 70 |y grante|d to cop|
|00005d60| 79 2c 20 72 65 70 72 6f | 64 75 63 65 2c 20 72 65 |y, repro|duce, re|
|00005d70| 64 69 73 74 72 69 62 75 | 74 65 20 6f 72 0a 09 6f |distribu|te or..o|
|00005d80| 74 68 65 72 77 69 73 65 | 20 75 73 65 20 74 68 69 |therwise| use thi|
|00005d90| 73 20 73 6f 66 74 77 61 | 72 65 20 61 73 20 6c 6f |s softwa|re as lo|
|00005da0| 6e 67 20 61 73 3a 20 74 | 68 65 72 65 20 69 73 20 |ng as: t|here is |
|00005db0| 6e 6f 20 6d 6f 6e 65 74 | 61 72 79 0a 09 70 72 6f |no monet|ary..pro|
|00005dc0| 66 69 74 20 67 61 69 6e | 65 64 20 73 70 65 63 69 |fit gain|ed speci|
|00005dd0| 66 69 63 61 6c 6c 79 20 | 66 72 6f 6d 20 74 68 65 |fically |from the|
|00005de0| 20 75 73 65 20 6f 72 20 | 72 65 70 72 6f 64 75 63 | use or |reproduc|
|00005df0| 74 69 6f 6e 20 6f 72 20 | 74 68 69 73 0a 09 73 6f |tion or |this..so|
|00005e00| 66 74 77 61 72 65 2c 20 | 69 74 20 69 73 20 6e 6f |ftware, |it is no|
|00005e10| 74 20 73 6f 6c 64 2c 20 | 72 65 6e 74 65 64 2c 20 |t sold, |rented, |
|00005e20| 74 72 61 64 65 64 20 6f | 72 20 6f 74 68 65 72 77 |traded o|r otherw|
|00005e30| 69 73 65 20 6d 61 72 6b | 65 74 65 64 2c 20 61 6e |ise mark|eted, an|
|00005e40| 64 0a 09 74 68 69 73 20 | 63 6f 70 79 72 69 67 68 |d..this |copyrigh|
|00005e50| 74 20 6e 6f 74 69 63 65 | 20 69 73 20 69 6e 63 6c |t notice| is incl|
|00005e60| 75 64 65 64 20 70 72 6f | 6d 69 6e 65 6e 74 6c 79 |uded pro|minently|
|00005e70| 20 69 6e 20 61 6e 79 20 | 63 6f 70 79 0a 09 6d 61 | in any |copy..ma|
|00005e80| 64 65 2e 0a 0a 09 54 68 | 65 20 61 75 74 68 6f 72 |de....Th|e author|
|00005e90| 20 6d 61 6b 65 20 6e 6f | 20 63 6c 61 69 6d 73 20 | make no| claims |
|00005ea0| 61 73 20 74 6f 20 74 68 | 65 20 66 69 74 6e 65 73 |as to th|e fitnes|
|00005eb0| 73 20 6f 72 20 63 6f 72 | 72 65 63 74 6e 65 73 73 |s or cor|rectness|
|00005ec0| 20 6f 66 0a 09 74 68 69 | 73 20 73 6f 66 74 77 61 | of..thi|s softwa|
|00005ed0| 72 65 20 66 6f 72 20 61 | 6e 79 20 75 73 65 20 77 |re for a|ny use w|
|00005ee0| 68 61 74 73 6f 65 76 65 | 72 2c 20 61 6e 64 20 69 |hatsoeve|r, and i|
|00005ef0| 74 20 69 73 20 70 72 6f | 76 69 64 65 64 20 61 73 |t is pro|vided as|
|00005f00| 20 69 73 2e 20 0a 09 41 | 6e 79 20 75 73 65 20 6f | is. ..A|ny use o|
|00005f10| 66 20 74 68 69 73 20 73 | 6f 66 74 77 61 72 65 20 |f this s|oftware |
|00005f20| 69 73 20 61 74 20 74 68 | 65 20 75 73 65 72 27 73 |is at th|e user's|
|00005f30| 20 6f 77 6e 20 72 69 73 | 6b 2e 0a 0a 09 28 43 6f | own ris|k....(Co|
|00005f40| 70 79 72 69 67 68 74 20 | 6e 6f 74 69 63 65 20 63 |pyright |notice c|
|00005f50| 6f 75 72 74 65 73 79 20 | 6f 66 20 4e 65 77 73 20 |ourtesy |of News |
|00005f60| 32 2e 31 31 20 3a 2d 29 | 0a 0a 09 41 64 64 69 74 |2.11 :-)|...Addit|
|00005f70| 69 6f 6e 61 6c 6c 79 3a | 20 20 79 6f 75 20 62 72 |ionally:| you br|
|00005f80| 65 61 6b 20 69 74 2c 20 | 79 6f 75 20 62 6f 75 67 |eak it, |you boug|
|00005f90| 68 74 20 69 74 2e 20 20 | 49 27 76 65 20 6c 69 73 |ht it. |I've lis|
|00005fa0| 74 65 64 20 74 68 65 20 | 70 72 6f 62 6c 65 6d 73 |ted the |problems|
|00005fb0| 0a 09 74 68 61 74 20 49 | 20 6b 6e 6f 77 20 6f 66 |..that I| know of|
|00005fc0| 20 69 6e 20 63 6f 6d 6d | 65 6e 74 73 20 69 6e 20 | in comm|ents in |
|00005fd0| 74 68 65 20 63 6f 64 65 | 3b 20 69 66 20 79 6f 75 |the code|; if you|
|00005fe0| 20 63 6f 6d 65 20 75 70 | 20 77 69 74 68 20 66 69 | come up| with fi|
|00005ff0| 78 65 73 2c 20 49 27 64 | 0a 09 6c 69 6b 65 20 74 |xes, I'd|..like t|
|00006000| 6f 20 73 65 65 20 74 68 | 65 6d 2c 20 62 75 74 20 |o see th|em, but |
|00006010| 49 27 6d 20 6e 6f 74 20 | 70 6c 61 6e 6e 69 6e 67 |I'm not |planning|
|00006020| 20 6f 6e 20 73 75 70 70 | 6f 72 74 69 6e 67 20 61 | on supp|orting a|
|00006030| 6e 79 74 68 69 6e 67 2e | 20 20 49 74 27 73 0a 09 |nything.| It's..|
|00006040| 22 67 6f 6f 64 20 65 6e | 6f 75 67 68 22 3b 20 74 |"good en|ough"; t|
|00006050| 68 61 74 27 73 20 61 6c | 6c 20 74 68 61 74 20 49 |hat's al|l that I|
|00006060| 27 6d 20 6c 6f 6f 6b 69 | 6e 67 20 66 6f 72 2e 09 |'m looki|ng for..|
|00006070| 2a 2f 0a 0a 23 69 6e 63 | 6c 75 64 65 09 3c 73 74 |*/..#inc|lude.<st|
|00006080| 64 69 6f 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 09 |dio.h>.#|include.|
|00006090| 3c 73 79 73 2f 74 79 70 | 65 73 2e 68 3e 0a 23 69 |<sys/typ|es.h>.#i|
|000060a0| 6e 63 6c 75 64 65 09 3c | 77 69 6e 64 2e 68 3e 0a |nclude.<|wind.h>.|
|000060b0| 23 69 6e 63 6c 75 64 65 | 09 3c 73 79 73 2f 77 69 |#include|.<sys/wi|
|000060c0| 6e 64 6f 77 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |ndow.h>.|#include|
|000060d0| 09 3c 66 63 6e 74 6c 2e | 68 3e 0a 23 69 6e 63 6c |.<fcntl.|h>.#incl|
|000060e0| 75 64 65 09 3c 74 65 72 | 6d 69 6f 2e 68 3e 0a 0a |ude.<ter|mio.h>..|
|000060f0| 2f 2a 09 50 61 72 61 6d | 65 74 65 72 73 20 64 65 |/*.Param|eters de|
|00006100| 66 69 6e 69 6e 67 20 74 | 68 65 20 77 69 6e 64 6f |fining t|he windo|
|00006110| 77 20 61 6e 64 20 74 68 | 65 20 70 72 6f 67 72 61 |w and th|e progra|
|00006120| 6d 20 66 6f 72 20 74 68 | 61 74 20 77 69 6e 64 6f |m for th|at windo|
|00006130| 77 2e 20 20 59 6f 75 27 | 6c 6c 0a 09 61 6c 6d 6f |w. You'|ll..almo|
|00006140| 73 74 20 63 65 72 74 61 | 69 6e 6c 79 20 68 61 76 |st certa|inly hav|
|00006150| 65 20 74 6f 20 63 68 61 | 6e 67 65 20 62 61 72 70 |e to cha|nge barp|
|00006160| 72 6f 67 20 74 6f 20 63 | 6f 72 72 65 73 70 6f 6e |rog to c|orrespon|
|00006170| 64 20 77 69 74 68 20 77 | 68 61 74 65 76 65 72 0a |d with w|hatever.|
|00006180| 09 64 69 72 65 63 74 6f | 72 79 20 79 6f 75 20 75 |.directo|ry you u|
|00006190| 73 65 20 66 6f 72 20 79 | 6f 75 72 20 6c 6f 63 61 |se for y|our loca|
|000061a0| 6c 20 73 74 75 66 66 2e | 0a 0a 09 4e 6f 74 65 3a |l stuff.|...Note:|
|000061b0| 20 20 57 46 4c 41 47 53 | 20 77 61 73 20 64 65 74 | WFLAGS| was det|
|000061c0| 65 72 6d 69 6e 65 64 20 | 65 6d 70 69 72 69 63 61 |ermined |empirica|
|000061d0| 6c 6c 79 2c 20 62 79 20 | 6c 6f 6f 6b 69 6e 67 20 |lly, by |looking |
|000061e0| 61 74 20 74 68 65 20 66 | 6c 61 67 73 20 66 6f 72 |at the f|lags for|
|000061f0| 0a 09 74 68 65 20 41 54 | 26 54 2d 73 75 70 70 6c |..the AT|&T-suppl|
|00006200| 69 65 64 20 73 6d 67 72 | 20 77 69 6e 64 6f 77 2e |ied smgr| window.|
|00006210| 20 20 4e 6f 20 67 75 61 | 72 61 6e 74 65 65 73 20 | No gua|rantees |
|00006220| 68 65 72 65 2e 09 2a 2f | 0a 0a 23 64 65 66 69 6e |here..*/|..#defin|
|00006230| 65 09 09 42 41 52 50 52 | 4f 47 09 09 22 2f 75 73 |e..BARPR|OG.."/us|
|00006240| 72 2f 6c 6f 63 61 6c 2f | 6e 65 77 6d 67 72 22 0a |r/local/|newmgr".|
|00006250| 23 64 65 66 69 6e 65 09 | 09 57 58 53 54 41 52 54 |#define.|.WXSTART|
|00006260| 09 09 30 0a 23 64 65 66 | 69 6e 65 09 09 57 59 53 |..0.#def|ine..WYS|
|00006270| 54 41 52 54 09 09 30 0a | 23 64 65 66 69 6e 65 09 |TART..0.|#define.|
|00006280| 09 57 57 49 44 54 48 09 | 09 37 32 30 0a 23 64 65 |.WWIDTH.|.720.#de|
|00006290| 66 69 6e 65 09 09 57 48 | 45 49 47 48 54 09 09 31 |fine..WH|EIGHT..1|
|000062a0| 32 0a 23 64 65 66 69 6e | 65 09 09 57 46 4c 41 47 |2.#defin|e..WFLAG|
|000062b0| 53 09 09 32 35 37 0a 0a | 6d 61 69 6e 28 29 0a 7b |S..257..|main().{|
|000062c0| 0a 69 6e 74 09 77 64 2c | 20 64 75 6d 6d 79 3b 0a |.int.wd,| dummy;.|
|000062d0| 73 74 72 75 63 74 20 75 | 77 64 61 74 61 20 77 69 |struct u|wdata wi|
|000062e0| 6e 62 61 72 3b 0a 73 74 | 72 75 63 74 20 75 74 64 |nbar;.st|ruct utd|
|000062f0| 61 74 61 20 77 69 6e 6e | 61 6d 65 3b 0a 73 74 72 |ata winn|ame;.str|
|00006300| 75 63 74 20 74 65 72 6d | 69 6f 20 62 61 72 74 74 |uct term|io bartt|
|00006310| 79 3b 0a 0a 77 69 6e 62 | 61 72 2e 75 77 5f 78 20 |y;..winb|ar.uw_x |
|00006320| 3d 20 57 58 53 54 41 52 | 54 3b 0a 77 69 6e 62 61 |= WXSTAR|T;.winba|
|00006330| 72 2e 75 77 5f 79 20 3d | 20 57 59 53 54 41 52 54 |r.uw_y =| WYSTART|
|00006340| 3b 0a 77 69 6e 62 61 72 | 2e 75 77 5f 77 69 64 74 |;.winbar|.uw_widt|
|00006350| 68 20 3d 20 57 57 49 44 | 54 48 3b 0a 77 69 6e 62 |h = WWID|TH;.winb|
|00006360| 61 72 2e 75 77 5f 68 65 | 69 67 68 74 20 3d 20 57 |ar.uw_he|ight = W|
|00006370| 48 45 49 47 48 54 3b 0a | 77 69 6e 62 61 72 2e 75 |HEIGHT;.|winbar.u|
|00006380| 77 5f 75 66 6c 61 67 73 | 20 3d 20 57 46 4c 41 47 |w_uflags| = WFLAG|
|00006390| 53 3b 0a 77 69 6e 6e 61 | 6d 65 2e 75 74 5f 6e 75 |S;.winna|me.ut_nu|
|000063a0| 6d 20 3d 20 57 54 58 54 | 55 53 45 52 3b 0a 0a 73 |m = WTXT|USER;..s|
|000063b0| 74 72 63 70 79 28 20 77 | 69 6e 6e 61 6d 65 2e 75 |trcpy( w|inname.u|
|000063c0| 74 5f 74 65 78 74 2c 20 | 22 49 6e 76 69 73 69 62 |t_text, |"Invisib|
|000063d0| 6c 65 22 20 29 3b 0a 69 | 66 20 28 20 66 6f 72 6b |le" );.i|f ( fork|
|000063e0| 28 29 20 29 0a 09 65 78 | 69 74 28 20 30 20 29 3b |() )..ex|it( 0 );|
|000063f0| 0a 65 6c 73 65 20 7b 0a | 0a 2f 2a 09 53 65 74 70 |.else {.|./*.Setp|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.