home *** CD-ROM | disk | FTP | other *** search
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: 3b1-status-line
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news or mail text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| makefile script, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/rfc822
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 73 63 | 6f 74 74 40 7a 6f 72 63 |From: sc|ott@zorc|
|00000010| 68 2e 55 55 43 50 20 28 | 53 63 6f 74 74 20 48 61 |h.UUCP (|Scott Ha|
|00000020| 7a 65 6e 20 4d 75 65 6c | 6c 65 72 29 0a 4e 65 77 |zen Muel|ler).New|
|00000030| 73 67 72 6f 75 70 73 3a | 20 63 6f 6d 70 2e 73 6f |sgroups:| comp.so|
|00000040| 75 72 63 65 73 2e 6d 69 | 73 63 0a 53 75 62 6a 65 |urces.mi|sc.Subje|
|00000050| 63 74 3a 20 76 30 32 69 | 30 30 34 3a 20 33 42 31 |ct: v02i|004: 3B1|
|00000060| 20 73 74 61 74 75 73 20 | 62 61 72 20 72 65 64 75 | status |bar redu|
|00000070| 78 0a 4d 65 73 73 61 67 | 65 2d 49 44 3a 20 3c 37 |x.Messag|e-ID: <7|
|00000080| 30 37 38 40 6e 63 6f 61 | 73 74 2e 55 55 43 50 3e |078@ncoa|st.UUCP>|
|00000090| 0a 44 61 74 65 3a 20 31 | 35 20 4a 61 6e 20 38 38 |.Date: 1|5 Jan 88|
|000000a0| 20 30 30 3a 32 38 3a 33 | 37 20 47 4d 54 0a 41 70 | 00:28:3|7 GMT.Ap|
|000000b0| 70 72 6f 76 65 64 3a 20 | 61 6c 6c 62 65 72 79 40 |proved: |allbery@|
|000000c0| 6e 63 6f 61 73 74 2e 55 | 55 43 50 0a 0a 43 6f 6d |ncoast.U|UCP..Com|
|000000d0| 70 2e 53 6f 75 72 63 65 | 73 2e 4d 69 73 63 3a 20 |p.Source|s.Misc: |
|000000e0| 56 6f 6c 75 6d 65 20 32 | 2c 20 49 73 73 75 65 20 |Volume 2|, Issue |
|000000f0| 34 0a 53 75 62 6d 69 74 | 74 65 64 2d 42 79 3a 20 |4.Submit|ted-By: |
|00000100| 53 63 6f 74 74 20 48 61 | 7a 65 6e 20 4d 75 65 6c |Scott Ha|zen Muel|
|00000110| 6c 65 72 20 3c 73 63 6f | 74 74 40 7a 6f 72 63 68 |ler <sco|tt@zorch|
|00000120| 2e 75 75 63 70 3e 0a 41 | 72 63 68 69 76 65 2d 4e |.uucp>.A|rchive-N|
|00000130| 61 6d 65 3a 20 33 62 31 | 2d 73 74 61 74 75 73 2d |ame: 3b1|-status-|
|00000140| 6c 69 6e 65 0a 0a 54 68 | 69 73 20 69 73 20 61 20 |line..Th|is is a |
|00000150| 63 6f 6e 73 69 64 65 72 | 61 62 6c 65 20 65 6e 68 |consider|able enh|
|00000160| 61 6e 63 65 64 20 28 65 | 6e 68 61 63 6b 65 64 3f |anced (e|nhacked?|
|00000170| 29 20 76 65 72 73 69 6f | 6e 20 6f 66 20 74 68 65 |) versio|n of the|
|00000180| 20 33 42 31 20 73 74 61 | 74 75 73 20 62 61 72 0a | 3B1 sta|tus bar.|
|00000190| 70 72 6f 67 72 61 6d 20 | 74 68 61 74 20 49 20 70 |program |that I p|
|000001a0| 6f 73 74 65 64 20 74 6f | 20 63 6f 6d 70 2e 73 6f |osted to| comp.so|
|000001b0| 75 72 63 65 73 2e 6d 69 | 73 63 20 61 72 6f 75 6e |urces.mi|sc aroun|
|000001c0| 64 20 6c 61 73 74 20 4f | 63 74 6f 62 65 72 2e 20 |d last O|ctober. |
|000001d0| 20 54 68 69 73 20 76 65 | 72 73 69 6f 6e 0a 69 73 | This ve|rsion.is|
|000001e0| 20 6e 6f 74 20 71 75 69 | 74 65 20 73 6f 20 6d 69 | not qui|te so mi|
|000001f0| 6e 69 6d 61 6c 2e 20 20 | 49 6e 20 61 64 64 69 74 |nimal. |In addit|
|00000200| 69 6f 6e 20 74 6f 20 64 | 69 73 70 6c 61 79 69 6e |ion to d|isplayin|
|00000210| 67 20 61 20 73 74 61 74 | 75 73 20 6c 69 6e 65 20 |g a stat|us line |
|00000220| 61 63 72 6f 73 73 20 74 | 68 65 0a 74 6f 70 20 6f |across t|he.top o|
|00000230| 66 20 74 68 65 20 73 63 | 72 65 65 6e 2c 20 69 74 |f the sc|reen, it|
|00000240| 20 75 73 65 73 20 74 68 | 65 20 53 75 73 70 65 6e | uses th|e Suspen|
|00000250| 64 20 61 6e 64 20 52 65 | 73 75 6d 65 20 6b 65 79 |d and Re|sume key|
|00000260| 73 20 74 6f 20 73 77 69 | 74 63 68 20 74 6f 20 74 |s to swi|tch to t|
|00000270| 68 65 20 6e 65 78 74 0a | 61 6e 64 20 70 72 65 76 |he next.|and prev|
|00000280| 69 6f 75 73 20 77 69 6e | 64 6f 77 73 3b 20 63 6f |ious win|dows; co|
|00000290| 6d 62 69 6e 65 64 20 77 | 69 74 68 20 6d 75 6c 74 |mbined w|ith mult|
|000002a0| 69 70 6c 65 20 63 6f 6e | 73 6f 6c 65 20 67 65 74 |iple con|sole get|
|000002b0| 74 79 73 20 69 74 20 67 | 69 76 65 73 20 62 65 68 |tys it g|ives beh|
|000002c0| 61 76 69 6f 72 0a 72 61 | 74 68 65 72 20 6c 69 6b |avior.ra|ther lik|
|000002d0| 65 20 74 68 61 74 20 6f | 66 20 38 30 78 38 36 2d |e that o|f 80x86-|
|000002e0| 62 61 73 65 64 20 55 6e | 69 63 65 73 20 77 69 74 |based Un|ices wit|
|000002f0| 68 20 76 69 72 74 75 61 | 6c 20 63 6f 6e 73 6f 6c |h virtua|l consol|
|00000300| 65 73 2e 20 20 41 6c 73 | 6f 2c 20 69 74 20 6d 61 |es. Als|o, it ma|
|00000310| 70 73 0a 61 20 62 75 6e | 63 68 20 6f 66 20 27 65 |ps.a bun|ch of 'e|
|00000320| 78 74 65 6e 64 65 64 2d | 73 74 61 74 75 73 27 20 |xtended-|status' |
|00000330| 66 75 6e 63 74 69 6f 6e | 73 20 74 6f 20 74 68 65 |function|s to the|
|00000340| 20 73 68 69 66 74 65 64 | 20 46 75 6e 63 74 69 6f | shifted| Functio|
|00000350| 6e 20 6b 65 79 73 20 6f | 6e 20 74 68 65 0a 63 6f |n keys o|n the.co|
|00000360| 6e 73 6f 6c 65 20 6b 65 | 79 62 6f 61 72 64 20 28 |nsole ke|yboard (|
|00000370| 61 6e 64 20 61 20 68 65 | 6c 70 20 66 75 6e 63 74 |and a he|lp funct|
|00000380| 69 6f 6e 20 74 6f 20 73 | 68 69 66 74 2d 50 72 69 |ion to s|hift-Pri|
|00000390| 6e 74 29 2e 0a 0a 23 21 | 20 2f 62 69 6e 2f 73 68 |nt)...#!| /bin/sh|
|000003a0| 0a 23 20 54 68 69 73 20 | 69 73 20 61 20 73 68 65 |.# This |is a she|
|000003b0| 6c 6c 20 61 72 63 68 69 | 76 65 2c 20 6d 65 61 6e |ll archi|ve, mean|
|000003c0| 69 6e 67 3a 0a 23 20 31 | 2e 20 52 65 6d 6f 76 65 |ing:.# 1|. Remove|
|000003d0| 20 65 76 65 72 79 74 68 | 69 6e 67 20 61 62 6f 76 | everyth|ing abov|
|000003e0| 65 20 74 68 65 20 23 21 | 20 2f 62 69 6e 2f 73 68 |e the #!| /bin/sh|
|000003f0| 20 6c 69 6e 65 2e 0a 23 | 20 32 2e 20 53 61 76 65 | line..#| 2. Save|
|00000400| 20 74 68 65 20 72 65 73 | 75 6c 74 69 6e 67 20 74 | the res|ulting t|
|00000410| 65 78 74 20 69 6e 20 61 | 20 66 69 6c 65 2e 0a 23 |ext in a| file..#|
|00000420| 20 33 2e 20 45 78 65 63 | 75 74 65 20 74 68 65 20 | 3. Exec|ute the |
|00000430| 66 69 6c 65 20 77 69 74 | 68 20 2f 62 69 6e 2f 73 |file wit|h /bin/s|
|00000440| 68 20 28 6e 6f 74 20 63 | 73 68 29 20 74 6f 20 63 |h (not c|sh) to c|
|00000450| 72 65 61 74 65 20 74 68 | 65 20 66 69 6c 65 73 3a |reate th|e files:|
|00000460| 0a 23 09 52 65 61 64 4d | 65 0a 23 09 4d 61 6b 65 |.#.ReadM|e.#.Make|
|00000470| 66 69 6c 65 0a 23 09 6e | 65 77 6d 67 72 2e 63 0a |file.#.n|ewmgr.c.|
|00000480| 23 09 73 74 61 72 74 6d | 67 72 2e 63 0a 23 09 6e |#.startm|gr.c.#.n|
|00000490| 64 69 72 2e 63 0a 23 09 | 6e 64 69 72 2e 68 0a 23 |dir.c.#.|ndir.h.#|
|000004a0| 20 54 68 69 73 20 61 72 | 63 68 69 76 65 20 63 72 | This ar|chive cr|
|000004b0| 65 61 74 65 64 3a 20 53 | 61 74 20 4a 61 6e 20 20 |eated: S|at Jan |
|000004c0| 39 20 32 31 3a 31 35 3a | 31 34 20 31 39 38 38 0a |9 21:15:|14 1988.|
|000004d0| 65 78 70 6f 72 74 20 50 | 41 54 48 3b 20 50 41 54 |export P|ATH; PAT|
|000004e0| 48 3d 2f 62 69 6e 3a 24 | 50 41 54 48 0a 69 66 20 |H=/bin:$|PATH.if |
|000004f0| 74 65 73 74 20 2d 66 20 | 27 52 65 61 64 4d 65 27 |test -f |'ReadMe'|
|00000500| 0a 74 68 65 6e 0a 20 20 | 20 20 20 20 20 65 63 68 |.then. | ech|
|00000510| 6f 20 73 68 61 72 3a 20 | 77 69 6c 6c 20 6e 6f 74 |o shar: |will not|
|00000520| 20 6f 76 65 72 2d 77 72 | 69 74 65 20 65 78 69 73 | over-wr|ite exis|
|00000530| 74 69 6e 67 20 66 69 6c | 65 20 22 27 52 65 61 64 |ting fil|e "'Read|
|00000540| 4d 65 27 22 0a 65 6c 73 | 65 0a 63 61 74 20 3c 3c |Me'".els|e.cat <<|
|00000550| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 52 65 | \SHAR_E|OF > 'Re|
|00000560| 61 64 4d 65 27 0a 0a 52 | 65 61 64 4d 65 20 66 6f |adMe'..R|eadMe fo|
|00000570| 72 20 39 20 4a 61 6e 20 | 31 39 38 38 20 76 65 72 |r 9 Jan |1988 ver|
|00000580| 73 69 6f 6e 20 6f 66 20 | 73 74 61 72 74 6d 67 72 |sion of |startmgr|
|00000590| 20 61 6e 64 20 6e 65 77 | 6d 67 72 0a 0a 54 68 65 | and new|mgr..The|
|000005a0| 73 65 20 74 77 6f 20 70 | 72 6f 67 72 61 6d 73 20 |se two p|rograms |
|000005b0| 69 6d 70 6c 65 6d 65 6e | 74 20 61 20 72 65 70 6c |implemen|t a repl|
|000005c0| 61 63 65 6d 65 6e 74 20 | 66 6f 72 20 73 6d 67 72 |acement |for smgr|
|000005d0| 2c 20 77 6d 67 72 20 61 | 6e 64 20 70 68 2e 20 20 |, wmgr a|nd ph. |
|000005e0| 54 68 65 79 20 64 6f 6e | 27 74 0a 64 6f 20 74 68 |They don|'t.do th|
|000005f0| 65 20 63 72 6f 6e 20 73 | 74 75 66 66 3b 20 75 73 |e cron s|tuff; us|
|00000600| 65 20 63 72 6f 6e 20 66 | 6f 72 20 74 68 61 74 2e |e cron f|or that.|
|00000610| 20 20 54 68 65 79 20 64 | 6f 6e 27 74 20 64 6f 20 | They d|on't do |
|00000620| 6d 61 69 6c 2c 20 61 6e | 64 20 49 20 64 6f 6e 27 |mail, an|d I don'|
|00000630| 74 20 63 61 72 65 2c 0a | 62 65 63 61 75 73 65 20 |t care,.|because |
|00000640| 49 20 64 6f 6e 27 74 20 | 75 73 65 20 2f 62 69 6e |I don't |use /bin|
|00000650| 2f 6d 61 69 6c 20 61 6e | 79 77 61 79 2e 20 20 4c |/mail an|yway. L|
|00000660| 69 6b 65 77 69 73 65 2c | 20 74 68 65 79 20 6b 6e |ikewise,| they kn|
|00000670| 6f 77 20 6e 6f 74 68 69 | 6e 67 20 61 62 6f 75 74 |ow nothi|ng about|
|00000680| 0a 63 61 6c 65 6e 64 61 | 72 73 20 6f 72 20 6d 65 |.calenda|rs or me|
|00000690| 6d 6f 73 2e 20 20 41 64 | 64 69 74 69 6f 6e 61 6c |mos. Ad|ditional|
|000006a0| 6c 79 2c 20 74 68 65 20 | 77 6d 67 72 20 66 75 6e |ly, the |wmgr fun|
|000006b0| 63 74 69 6f 6e 20 64 6f | 65 73 6e 27 74 20 62 72 |ction do|esn't br|
|000006c0| 69 6e 67 20 75 70 20 61 | 20 6d 65 6e 75 3b 0a 69 |ing up a| menu;.i|
|000006d0| 74 20 6a 75 73 74 20 73 | 77 69 74 63 68 65 73 20 |t just s|witches |
|000006e0| 79 6f 75 20 62 65 74 77 | 65 65 6e 20 77 69 6e 64 |you betw|een wind|
|000006f0| 6f 77 73 2e 0a 0a 57 68 | 61 74 20 73 74 61 72 74 |ows...Wh|at start|
|00000700| 6d 67 72 20 64 6f 65 73 | 20 69 73 20 73 74 61 72 |mgr does| is star|
|00000710| 74 20 6e 65 77 6d 67 72 | 2e 20 20 49 74 20 73 74 |t newmgr|. It st|
|00000720| 61 72 74 73 20 69 74 20 | 69 6e 20 61 20 77 69 6e |arts it |in a win|
|00000730| 64 6f 77 20 61 63 72 6f | 73 73 20 74 68 65 0a 74 |dow acro|ss the.t|
|00000740| 6f 70 20 6f 66 20 74 68 | 65 20 73 63 72 65 65 6e |op of th|e screen|
|00000750| 2c 20 69 6e 20 74 68 65 | 20 70 6c 61 63 65 73 20 |, in the| places |
|00000760| 77 68 65 72 65 20 74 68 | 65 20 50 68 6f 6e 65 20 |where th|e Phone |
|00000770| 4d 61 6e 61 67 65 72 2c | 20 74 68 65 20 53 74 61 |Manager,| the Sta|
|00000780| 74 75 73 20 4d 61 6e 61 | 67 65 72 0a 61 6e 64 20 |tus Mana|ger.and |
|00000790| 74 68 65 20 57 69 6e 64 | 6f 77 20 4d 61 6e 61 67 |the Wind|ow Manag|
|000007a0| 65 72 20 6c 69 76 65 20 | 28 49 20 64 6f 6e 27 74 |er live |(I don't|
|000007b0| 20 75 73 65 20 74 68 65 | 20 50 4d 20 65 69 74 68 | use the| PM eith|
|000007c0| 65 72 2e 2e 2e 29 2e 20 | 20 49 74 20 74 68 65 6e |er...). | It then|
|000007d0| 20 72 65 74 75 72 6e 73 | 2c 0a 73 6f 20 61 6c 6c | returns|,.so all|
|000007e0| 20 79 6f 75 20 6e 65 65 | 64 20 74 6f 20 64 6f 20 | you nee|d to do |
|000007f0| 69 73 20 73 74 61 72 74 | 6d 67 72 2e 20 20 49 74 |is start|mgr. It|
|00000800| 20 70 72 6f 62 61 62 6c | 79 20 63 61 6e 20 62 65 | probabl|y can be|
|00000810| 20 74 75 72 6e 65 64 20 | 69 6e 74 6f 20 61 20 66 | turned |into a f|
|00000820| 61 69 72 6c 79 0a 67 65 | 6e 65 72 61 6c 20 70 72 |airly.ge|neral pr|
|00000830| 6f 63 65 73 73 20 73 74 | 61 72 74 65 72 2c 20 62 |ocess st|arter, b|
|00000840| 75 74 20 49 20 64 6f 6e | 27 74 20 68 61 76 65 20 |ut I don|'t have |
|00000850| 74 68 65 20 74 69 6d 65 | 2c 20 77 68 61 74 20 77 |the time|, what w|
|00000860| 69 74 68 20 61 6c 6c 20 | 6f 66 20 74 68 65 0a 73 |ith all |of the.s|
|00000870| 74 75 66 66 20 74 68 61 | 74 20 49 27 76 65 20 67 |tuff tha|t I've g|
|00000880| 6f 74 20 70 69 6c 65 64 | 20 75 70 20 74 6f 20 6c |ot piled| up to l|
|00000890| 6f 6f 6b 20 61 74 2e 0a | 0a 4e 65 77 6d 67 72 20 |ook at..|.Newmgr |
|000008a0| 69 73 20 6a 75 73 74 20 | 61 20 66 6f 72 65 76 65 |is just |a foreve|
|000008b0| 72 20 6c 6f 6f 70 20 74 | 68 61 74 20 64 69 73 70 |r loop t|hat disp|
|000008c0| 6c 61 79 73 20 73 6f 6d | 65 20 73 74 61 74 75 73 |lays som|e status|
|000008d0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 74 6f 0a | informa|tion to.|
|000008e0| 73 74 64 6f 75 74 20 61 | 6e 64 20 70 65 65 6b 73 |stdout a|nd peeks|
|000008f0| 20 61 74 20 74 68 65 20 | 53 75 73 70 65 6e 64 2c | at the |Suspend,|
|00000900| 20 52 65 73 75 6d 65 20 | 53 68 69 66 74 2d 50 72 | Resume |Shift-Pr|
|00000910| 69 6e 74 20 61 6e 64 20 | 53 68 69 66 74 2d 46 75 |int and |Shift-Fu|
|00000920| 6e 63 74 69 6f 6e 20 4b | 65 79 73 2e 0a 54 68 65 |nction K|eys..The|
|00000930| 20 53 68 69 66 74 2d 46 | 75 6e 63 74 69 6f 6e 20 | Shift-F|unction |
|00000940| 6b 65 79 73 20 64 69 73 | 70 6c 61 79 20 61 6c 6c |keys dis|play all|
|00000950| 20 73 6f 72 74 73 20 6f | 66 20 61 64 64 69 74 69 | sorts o|f additi|
|00000960| 6f 6e 61 6c 20 73 74 61 | 74 75 73 20 69 6e 66 6f |onal sta|tus info|
|00000970| 72 6d 61 74 69 6f 6e 3b | 0a 73 69 6e 63 65 20 49 |rmation;|.since I|
|00000980| 20 75 73 65 20 55 55 43 | 50 20 61 20 6c 6f 74 2c | use UUC|P a lot,|
|00000990| 20 66 6f 75 72 20 6f 66 | 20 74 68 65 20 6b 65 79 | four of| the key|
|000009a0| 73 20 73 68 6f 77 20 55 | 55 43 50 2d 72 65 6c 61 |s show U|UCP-rela|
|000009b0| 74 65 64 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |ted info|rmation |
|000009c0| 28 4c 43 4b 2c 0a 43 2e | 20 61 6e 64 20 44 2e 20 |(LCK,.C.| and D. |
|000009d0| 20 66 69 6c 65 73 20 61 | 6e 64 20 61 6c 6c 20 6f | files a|nd all o|
|000009e0| 66 20 2f 75 73 72 2f 73 | 70 6f 6f 6c 2f 75 75 63 |f /usr/s|pool/uuc|
|000009f0| 70 29 20 61 6e 64 20 74 | 68 65 20 6f 74 68 65 72 |p) and t|he other|
|00000a00| 20 66 6f 75 72 20 73 68 | 6f 77 20 70 72 6f 63 65 | four sh|ow proce|
|00000a10| 73 73 0a 73 74 61 74 75 | 73 2c 20 75 74 6d 70 20 |ss.statu|s, utmp |
|00000a20| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 2c 20 74 68 65 |informat|ion, the|
|00000a30| 20 6d 61 69 6c 20 64 69 | 72 65 63 74 6f 72 79 2c | mail di|rectory,|
|00000a40| 20 61 6e 64 20 72 6f 6f | 74 20 64 69 73 6b 20 73 | and roo|t disk s|
|00000a50| 74 61 74 73 2e 20 20 46 | 65 65 6c 20 66 72 65 65 |tats. F|eel free|
|00000a60| 0a 74 6f 20 68 61 63 6b | 20 69 74 3b 20 49 20 6a |.to hack| it; I j|
|00000a70| 75 73 74 20 70 75 74 20 | 75 70 20 77 68 61 74 20 |ust put |up what |
|00000a80| 49 20 63 6f 75 6c 64 20 | 74 68 69 6e 6b 20 6f 66 |I could |think of|
|00000a90| 20 74 68 61 74 27 73 20 | 69 6e 74 65 72 65 73 74 | that's |interest|
|00000aa0| 69 6e 67 20 74 6f 20 6d | 65 2e 20 20 4c 6f 61 64 |ing to m|e. Load|
|00000ab0| 0a 61 76 65 72 61 67 65 | 73 20 77 6f 75 6c 64 20 |.average|s would |
|00000ac0| 62 65 20 6e 69 63 65 2c | 20 62 75 74 20 49 20 63 |be nice,| but I c|
|00000ad0| 6f 75 6c 64 6e 27 74 20 | 66 69 6e 64 20 61 6e 79 |ouldn't |find any|
|00000ae0| 20 6f 62 76 69 6f 75 73 | 20 68 6f 6f 6b 73 20 69 | obvious| hooks i|
|00000af0| 6e 20 2f 75 6e 69 78 20 | 66 6f 72 20 74 68 61 74 |n /unix |for that|
|00000b00| 2e 0a 0a 43 6f 6d 70 69 | 6c 69 6e 67 3a 20 20 6a |...Compi|ling: j|
|00000b10| 75 73 74 20 74 79 70 65 | 20 6d 61 6b 65 2e 20 20 |ust type| make. |
|00000b20| 55 73 65 20 6d 61 6b 65 | 20 69 6e 73 74 61 6c 6c |Use make| install|
|00000b30| 20 74 6f 20 6d 6f 76 65 | 20 74 68 65 20 65 78 65 | to move| the exe|
|00000b40| 63 75 74 61 62 6c 65 73 | 20 74 6f 20 74 68 65 0a |cutables| to the.|
|00000b50| 64 65 66 61 75 6c 74 20 | 6c 6f 63 61 74 69 6f 6e |default |location|
|00000b60| 73 2e 20 20 4d 6f 64 69 | 66 79 20 74 68 65 20 4d |s. Modi|fy the M|
|00000b70| 61 6b 65 66 69 6c 65 20 | 61 6e 64 20 74 68 65 20 |akefile |and the |
|00000b80| 23 64 65 66 69 6e 65 20 | 42 41 52 50 52 4f 47 20 |#define |BARPROG |
|00000b90| 66 6f 72 20 79 6f 75 72 | 20 73 69 74 65 2e 0a 49 |for your| site..I|
|00000ba0| 20 75 73 65 20 74 68 65 | 20 6e 64 69 72 20 73 74 | use the| ndir st|
|00000bb0| 75 66 66 20 28 49 20 67 | 6f 74 20 69 74 20 66 72 |uff (I g|ot it fr|
|00000bc0| 6f 6d 20 4e 65 77 73 2c | 20 49 20 64 6f 6e 27 74 |om News,| I don't|
|00000bd0| 20 6b 6e 6f 77 20 77 68 | 6f 20 64 69 64 20 69 74 | know wh|o did it|
|00000be0| 20 6f 72 69 67 69 6e 61 | 6c 6c 79 29 0a 74 6f 20 | origina|lly).to |
|00000bf0| 64 6f 20 64 69 72 65 63 | 74 6f 72 79 20 73 63 61 |do direc|tory sca|
|00000c00| 6e 6e 69 6e 67 3b 20 69 | 74 20 73 68 6f 75 6c 64 |nning; i|t should|
|00000c10| 20 62 65 20 69 6e 20 74 | 68 65 20 64 69 73 74 72 | be in t|he distr|
|00000c20| 69 62 75 74 69 6f 6e 2e | 0a 0a 48 6f 77 20 74 6f |ibution.|..How to|
|00000c30| 20 75 73 65 3a 20 20 73 | 74 61 72 74 6d 67 72 20 | use: s|tartmgr |
|00000c40| 67 6f 65 73 20 69 6e 20 | 2f 65 74 63 2f 64 61 65 |goes in |/etc/dae|
|00000c50| 6d 6f 6e 73 20 61 6e 64 | 20 6e 65 77 6d 67 72 20 |mons and| newmgr |
|00000c60| 67 6f 65 73 20 69 6e 74 | 6f 20 79 6f 75 72 0a 6c |goes int|o your.l|
|00000c70| 6f 63 61 6c 20 65 78 65 | 63 75 74 61 62 6c 65 20 |ocal exe|cutable |
|00000c80| 64 69 72 65 63 74 6f 72 | 79 20 28 63 68 61 6e 67 |director|y (chang|
|00000c90| 65 20 61 20 23 64 65 66 | 69 6e 65 20 69 6e 20 73 |e a #def|ine in s|
|00000ca0| 74 61 72 74 6d 67 72 20 | 69 66 20 79 6f 75 20 64 |tartmgr |if you d|
|00000cb0| 6f 6e 27 74 0a 75 73 65 | 20 2f 75 73 72 2f 6c 6f |on't.use| /usr/lo|
|00000cc0| 63 61 6c 29 2e 20 20 59 | 6f 75 27 76 65 20 74 68 |cal). Y|ou've th|
|00000cd0| 65 6e 20 65 69 74 68 65 | 72 20 67 6f 74 20 74 6f |en eithe|r got to|
|00000ce0| 20 63 68 61 6e 67 65 20 | 2f 65 74 63 2f 72 63 20 | change |/etc/rc |
|00000cf0| 28 73 6f 20 69 74 20 64 | 6f 65 73 6e 27 74 0a 73 |(so it d|oesn't.s|
|00000d00| 74 61 72 74 20 73 6d 67 | 72 2c 77 6d 67 72 20 61 |tart smg|r,wmgr a|
|00000d10| 6e 64 20 70 68 29 20 6f | 72 20 70 75 74 20 61 20 |nd ph) o|r put a |
|00000d20| 73 63 72 69 70 74 20 69 | 6e 20 2f 65 74 63 2f 64 |script i|n /etc/d|
|00000d30| 61 65 6d 6f 6e 73 20 74 | 6f 20 6b 69 6c 6c 20 74 |aemons t|o kill t|
|00000d40| 68 65 6d 20 6f 66 66 2e | 0a 49 66 20 79 6f 75 20 |hem off.|.If you |
|00000d50| 64 6f 6e 27 74 20 6b 6e | 6f 77 20 61 62 6f 75 74 |don't kn|ow about|
|00000d60| 20 2f 65 74 63 2f 72 63 | 20 61 6e 64 20 2f 65 74 | /etc/rc| and /et|
|00000d70| 63 2f 64 61 65 6d 6f 6e | 73 2c 20 6d 61 79 62 65 |c/daemon|s, maybe|
|00000d80| 20 79 6f 75 20 73 68 6f | 75 6c 64 6e 27 74 0a 62 | you sho|uldn't.b|
|00000d90| 65 20 64 6f 69 6e 67 20 | 74 68 69 73 2e 2e 2e 20 |e doing |this... |
|00000da0| 3a 2d 29 0a 0a 55 73 65 | 20 74 68 65 20 53 68 69 |:-)..Use| the Shi|
|00000db0| 66 74 2d 50 72 69 6e 74 | 20 6b 65 79 20 74 6f 20 |ft-Print| key to |
|00000dc0| 64 69 73 70 6c 61 79 20 | 74 68 65 20 6c 69 73 74 |display |the list|
|00000dd0| 20 6f 66 20 6b 65 79 20 | 6d 61 70 70 69 6e 67 73 | of key |mappings|
|00000de0| 2c 20 6f 6e 63 65 20 74 | 68 65 20 70 72 6f 67 72 |, once t|he progr|
|00000df0| 61 6d 0a 69 73 20 73 74 | 61 72 74 65 64 2e 0a 0a |am.is st|arted...|
|00000e00| 4f 70 74 69 6f 6e 61 6c | 6c 79 2c 20 79 6f 75 20 |Optional|ly, you |
|00000e10| 2a 63 61 6e 2a 20 72 75 | 6e 20 73 74 61 72 74 6d |*can* ru|n startm|
|00000e20| 67 72 20 62 79 20 68 61 | 6e 64 3b 20 49 20 64 69 |gr by ha|nd; I di|
|00000e30| 64 20 66 6f 72 20 74 65 | 73 74 69 6e 67 2e 20 20 |d for te|sting. |
|00000e40| 54 68 65 20 6f 6e 6c 79 | 0a 74 68 69 6e 67 20 74 |The only|.thing t|
|00000e50| 6f 20 6e 6f 74 65 20 68 | 65 72 65 20 69 73 20 74 |o note h|ere is t|
|00000e60| 68 61 74 20 79 6f 75 72 | 20 63 75 72 72 65 6e 74 |hat your| current|
|00000e70| 20 77 69 6e 64 6f 77 20 | 77 69 6e 64 73 20 75 70 | window |winds up|
|00000e80| 20 62 65 69 6e 67 20 74 | 68 65 20 6f 6e 65 0a 74 | being t|he one.t|
|00000e90| 68 61 74 20 73 74 61 72 | 74 6d 67 72 20 63 72 65 |hat star|tmgr cre|
|00000ea0| 61 74 65 73 20 66 6f 72 | 20 74 68 65 20 73 74 61 |ates for| the sta|
|00000eb0| 74 75 73 20 6c 69 6e 65 | 3b 20 49 20 63 6f 75 6c |tus line|; I coul|
|00000ec0| 64 6e 27 74 20 66 69 6e | 64 20 61 20 77 61 79 20 |dn't fin|d a way |
|00000ed0| 74 6f 20 73 61 79 2c 0a | 22 6d 61 6b 65 20 74 68 |to say,.|"make th|
|00000ee0| 65 20 6c 61 73 74 20 77 | 69 6e 64 6f 77 20 74 68 |e last w|indow th|
|00000ef0| 65 20 63 75 72 72 65 6e | 74 20 6f 6e 65 2e 22 3b |e curren|t one.";|
|00000f00| 20 6f 72 20 61 74 20 6c | 65 61 73 74 2c 20 6f 6e | or at l|east, on|
|00000f10| 65 20 74 68 61 74 20 49 | 20 63 6f 75 6c 64 20 67 |e that I| could g|
|00000f20| 65 74 0a 74 6f 20 77 6f | 72 6b 20 69 6e 20 35 20 |et.to wo|rk in 5 |
|00000f30| 6d 69 6e 75 74 65 73 2e | 2e 2e 20 20 54 6f 20 67 |minutes.|.. To g|
|00000f40| 65 74 20 62 61 63 6b 20 | 74 6f 20 79 6f 75 72 20 |et back |to your |
|00000f50| 6e 6f 72 6d 61 6c 20 77 | 69 6e 64 6f 77 2c 20 6a |normal w|indow, j|
|00000f60| 75 73 74 20 75 73 65 0a | 53 75 73 70 65 6e 64 2f |ust use.|Suspend/|
|00000f70| 52 65 73 75 6d 65 2e 0a | 0a 4b 6e 6f 77 6e 20 62 |Resume..|.Known b|
|00000f80| 75 67 73 3a 20 20 45 76 | 65 72 79 20 6f 6e 63 65 |ugs: Ev|ery once|
|00000f90| 20 69 6e 20 61 20 77 68 | 69 6c 65 2c 20 6c 69 6b | in a wh|ile, lik|
|00000fa0| 65 20 69 66 20 79 6f 75 | 20 6c 6f 67 20 6f 75 74 |e if you| log out|
|00000fb0| 20 2a 6a 75 73 74 2a 20 | 61 73 20 74 68 65 20 64 | *just* |as the d|
|00000fc0| 69 73 70 6c 61 79 0a 69 | 73 20 75 70 64 61 74 69 |isplay.i|s updati|
|00000fd0| 6e 67 2c 20 69 74 20 67 | 65 74 73 20 63 6f 6e 66 |ng, it g|ets conf|
|00000fe0| 75 73 65 64 20 61 73 20 | 74 6f 20 77 68 61 74 20 |used as |to what |
|00000ff0| 77 69 6e 64 6f 77 20 79 | 6f 75 27 72 65 20 72 65 |window y|ou're re|
|00001000| 61 6c 6c 79 20 69 6e 2e | 20 20 49 74 20 68 61 73 |ally in.| It has|
|00001010| 20 65 76 65 6e 0a 62 65 | 65 6e 20 6b 6e 6f 77 6e | even.be|en known|
|00001020| 20 74 6f 20 64 69 73 70 | 6c 61 79 20 22 77 2d 31 | to disp|lay "w-1|
|00001030| 22 20 28 77 68 6f 20 6d | 65 2c 20 63 68 65 63 6b |" (who m|e, check|
|00001040| 20 66 6f 72 20 65 72 72 | 6f 72 73 20 6f 6e 20 61 | for err|ors on a|
|00001050| 20 73 79 73 74 65 6d 20 | 63 61 6c 6c 3f 29 2e 0a | system |call?)..|
|00001060| 41 6c 73 6f 2c 20 74 68 | 65 20 70 72 6f 63 65 73 |Also, th|e proces|
|00001070| 73 20 73 74 61 74 75 73 | 20 66 65 61 74 75 72 65 |s status| feature|
|00001080| 20 70 72 6f 62 61 62 6c | 79 20 63 6f 75 6c 64 20 | probabl|y could |
|00001090| 66 69 6e 64 20 61 20 62 | 65 74 74 65 72 20 77 61 |find a b|etter wa|
|000010a0| 79 20 74 6f 20 64 65 74 | 65 72 6d 69 6e 65 0a 61 |y to det|ermine.a|
|000010b0| 20 70 72 6f 63 65 73 73 | 27 73 20 63 6f 6e 74 72 | process|'s contr|
|000010c0| 6f 6c 6c 69 6e 67 20 74 | 65 72 6d 69 6e 61 6c 3b |olling t|erminal;|
|000010d0| 20 69 74 20 68 61 73 20 | 61 20 74 65 6e 64 65 6e | it has |a tenden|
|000010e0| 63 79 20 74 6f 20 63 6f | 6d 65 20 75 70 20 77 69 |cy to co|me up wi|
|000010f0| 74 68 20 74 68 69 6e 67 | 73 0a 6c 69 6b 65 20 2f |th thing|s.like /|
|00001100| 64 65 76 2f 6e 75 6c 6c | 2e 0a 0a 50 6f 74 65 6e |dev/null|...Poten|
|00001110| 74 69 61 6c 20 62 75 67 | 73 3a 20 20 50 72 65 74 |tial bug|s: Pret|
|00001120| 74 79 20 6d 75 63 68 20 | 61 6c 6c 20 6f 66 20 74 |ty much |all of t|
|00001130| 68 65 20 65 78 74 65 6e | 64 65 64 2d 73 74 61 74 |he exten|ded-stat|
|00001140| 75 73 20 72 6f 75 74 69 | 6e 65 73 20 61 72 65 0a |us routi|nes are.|
|00001150| 69 6d 70 6c 65 6d 65 6e | 74 65 64 20 77 69 74 68 |implemen|ted with|
|00001160| 6f 75 74 20 61 6e 79 20 | 65 72 72 6f 72 2d 63 68 |out any |error-ch|
|00001170| 65 63 6b 69 6e 67 2e 2e | 2e 0a 0a 4c 61 73 74 20 |ecking..|...Last |
|00001180| 6e 6f 74 65 3a 20 20 74 | 68 69 73 20 73 74 75 66 |note: t|his stuf|
|00001190| 66 20 69 73 20 63 6f 70 | 79 72 69 67 68 74 65 64 |f is cop|yrighted|
|000011a0| 20 77 69 74 68 20 66 72 | 65 65 20 72 65 64 69 73 | with fr|ee redis|
|000011b0| 74 72 69 62 75 74 69 6f | 6e 20 70 65 72 6d 69 74 |tributio|n permit|
|000011c0| 74 65 64 2e 0a 49 20 64 | 6f 6e 27 74 20 72 65 61 |ted..I d|on't rea|
|000011d0| 6c 6c 79 20 74 68 69 6e | 6b 20 74 68 61 74 20 74 |lly thin|k that t|
|000011e0| 68 69 73 20 69 73 20 74 | 68 65 20 73 6f 72 74 20 |his is t|he sort |
|000011f0| 6f 66 20 74 68 69 6e 67 | 20 74 68 61 74 20 6e 65 |of thing| that ne|
|00001200| 65 64 73 20 6f 72 20 77 | 61 72 72 61 6e 74 73 0a |eds or w|arrants.|
|00001210| 73 63 61 64 73 20 6f 66 | 20 73 75 70 70 6f 72 74 |scads of| support|
|00001220| 2c 20 73 6f 20 49 27 6d | 20 6e 6f 74 20 70 72 6f |, so I'm| not pro|
|00001230| 6d 69 73 69 6e 67 20 74 | 6f 20 64 6f 20 73 6f 3b |mising t|o do so;|
|00001240| 20 68 6f 77 65 76 65 72 | 2c 20 49 20 77 6f 75 6c | however|, I woul|
|00001250| 64 20 6c 69 6b 65 20 74 | 6f 0a 73 65 65 20 61 6e |d like t|o.see an|
|00001260| 79 20 63 68 61 6e 67 65 | 73 20 74 68 61 74 20 61 |y change|s that a|
|00001270| 6e 79 6f 6e 65 20 6d 61 | 6b 65 73 2e 0a 0a 43 6f |nyone ma|kes...Co|
|00001280| 6d 6d 65 6e 74 73 20 77 | 65 6c 63 6f 6d 65 2c 20 |mments w|elcome, |
|00001290| 61 73 20 6c 6f 6e 67 20 | 61 73 20 74 68 65 79 20 |as long |as they |
|000012a0| 61 72 65 20 6f 74 68 65 | 72 20 74 68 61 6e 2c 20 |are othe|r than, |
|000012b0| 22 57 68 61 74 20 6b 69 | 6e 64 20 6f 66 20 69 64 |"What ki|nd of id|
|000012c0| 69 6f 74 0a 72 75 6e 73 | 20 77 69 74 68 6f 75 74 |iot.runs| without|
|000012d0| 20 73 6d 67 72 2c 20 77 | 6d 67 72 20 61 6e 64 20 | smgr, w|mgr and |
|000012e0| 70 68 3f 22 0a 0a 20 20 | 20 20 20 5c 73 63 6f 74 |ph?".. | \scot|
|000012f0| 74 0a 20 20 20 20 20 39 | 20 4a 61 6e 20 31 39 38 |t. 9| Jan 198|
|00001300| 38 0a 0a 53 48 41 52 5f | 45 4f 46 0a 66 69 20 23 |8..SHAR_|EOF.fi #|
|00001310| 20 65 6e 64 20 6f 66 20 | 6f 76 65 72 77 72 69 74 | end of |overwrit|
|00001320| 69 6e 67 20 63 68 65 63 | 6b 0a 69 66 20 74 65 73 |ing chec|k.if tes|
|00001330| 74 20 2d 66 20 27 4d 61 | 6b 65 66 69 6c 65 27 0a |t -f 'Ma|kefile'.|
|00001340| 74 68 65 6e 0a 20 20 20 | 20 20 20 20 65 63 68 6f |then. | echo|
|00001350| 20 73 68 61 72 3a 20 77 | 69 6c 6c 20 6e 6f 74 20 | shar: w|ill not |
|00001360| 6f 76 65 72 2d 77 72 69 | 74 65 20 65 78 69 73 74 |over-wri|te exist|
|00001370| 69 6e 67 20 66 69 6c 65 | 20 22 27 4d 61 6b 65 66 |ing file| "'Makef|
|00001380| 69 6c 65 27 22 0a 65 6c | 73 65 0a 63 61 74 20 3c |ile'".el|se.cat <|
|00001390| 3c 20 5c 53 48 41 52 5f | 45 4f 46 20 3e 20 27 4d |< \SHAR_|EOF > 'M|
|000013a0| 61 6b 65 66 69 6c 65 27 | 0a 4c 4f 43 41 4c 44 49 |akefile'|.LOCALDI|
|000013b0| 52 20 3d 20 2f 75 73 72 | 2f 6c 6f 63 61 6c 0a 0a |R = /usr|/local..|
|000013c0| 61 6c 6c 3a 20 6e 65 77 | 6d 67 72 20 73 74 61 72 |all: new|mgr star|
|000013d0| 74 6d 67 72 0a 0a 73 74 | 61 72 74 6d 67 72 3a 20 |tmgr..st|artmgr: |
|000013e0| 73 74 61 72 74 6d 67 72 | 2e 63 0a 09 63 63 20 2d |startmgr|.c..cc -|
|000013f0| 4f 20 2d 73 20 73 74 61 | 72 74 6d 67 72 2e 63 20 |O -s sta|rtmgr.c |
|00001400| 2d 6f 20 73 74 61 72 74 | 6d 67 72 0a 0a 6e 65 77 |-o start|mgr..new|
|00001410| 6d 67 72 3a 20 6e 65 77 | 6d 67 72 2e 6f 20 6e 64 |mgr: new|mgr.o nd|
|00001420| 69 72 2e 6f 0a 09 63 63 | 20 2d 4f 20 2d 73 20 6e |ir.o..cc| -O -s n|
|00001430| 65 77 6d 67 72 2e 6f 20 | 6e 64 69 72 2e 6f 20 2d |ewmgr.o |ndir.o -|
|00001440| 6f 20 6e 65 77 6d 67 72 | 0a 0a 69 6e 73 74 61 6c |o newmgr|..instal|
|00001450| 6c 3a 20 6e 65 77 6d 67 | 72 20 73 74 61 72 74 6d |l: newmg|r startm|
|00001460| 67 72 0a 09 6d 76 20 6e | 65 77 6d 67 72 20 4c 4f |gr..mv n|ewmgr LO|
|00001470| 43 41 4c 44 49 52 0a 09 | 6d 76 20 73 74 61 72 74 |CALDIR..|mv start|
|00001480| 6d 67 72 20 2f 65 74 63 | 2f 64 61 65 6d 6f 6e 73 |mgr /etc|/daemons|
|00001490| 0a 0a 63 6c 65 61 6e 3a | 0a 09 72 6d 20 2d 66 20 |..clean:|..rm -f |
|000014a0| 2a 2e 6f 20 73 74 61 72 | 74 6d 67 72 20 6e 65 77 |*.o star|tmgr new|
|000014b0| 6d 67 72 0a 53 48 41 52 | 5f 45 4f 46 0a 66 69 20 |mgr.SHAR|_EOF.fi |
|000014c0| 23 20 65 6e 64 20 6f 66 | 20 6f 76 65 72 77 72 69 |# end of| overwri|
|000014d0| 74 69 6e 67 20 63 68 65 | 63 6b 0a 69 66 20 74 65 |ting che|ck.if te|
|000014e0| 73 74 20 2d 66 20 27 6e | 65 77 6d 67 72 2e 63 27 |st -f 'n|ewmgr.c'|
|000014f0| 0a 74 68 65 6e 0a 20 20 | 20 20 20 20 20 65 63 68 |.then. | ech|
|00001500| 6f 20 73 68 61 72 3a 20 | 77 69 6c 6c 20 6e 6f 74 |o shar: |will not|
|00001510| 20 6f 76 65 72 2d 77 72 | 69 74 65 20 65 78 69 73 | over-wr|ite exis|
|00001520| 74 69 6e 67 20 66 69 6c | 65 20 22 27 6e 65 77 6d |ting fil|e "'newm|
|00001530| 67 72 2e 63 27 22 0a 65 | 6c 73 65 0a 63 61 74 20 |gr.c'".e|lse.cat |
|00001540| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|00001550| 6e 65 77 6d 67 72 2e 63 | 27 0a 2f 2a 09 6e 65 77 |newmgr.c|'./*.new|
|00001560| 6d 67 72 3a 20 20 4c 6f | 6f 70 20 66 6f 72 65 76 |mgr: Lo|op forev|
|00001570| 65 72 2c 20 70 72 69 6e | 74 69 6e 67 20 61 20 73 |er, prin|ting a s|
|00001580| 74 61 74 75 73 20 64 69 | 73 70 6c 61 79 20 61 6e |tatus di|splay an|
|00001590| 64 20 63 68 65 63 6b 69 | 6e 67 20 74 68 65 0a 09 |d checki|ng the..|
|000015a0| 53 75 73 70 65 6e 64 2c | 20 52 65 73 75 6d 65 20 |Suspend,| Resume |
|000015b0| 61 6e 64 20 73 68 69 66 | 74 65 64 20 46 75 6e 63 |and shif|ted Func|
|000015c0| 74 69 6f 6e 20 4b 65 79 | 73 2e 20 20 4d 65 61 6e |tion Key|s. Mean|
|000015d0| 74 20 74 6f 20 62 65 20 | 75 73 65 64 20 6f 6e 20 |t to be |used on |
|000015e0| 74 68 65 0a 09 74 6f 70 | 20 6c 69 6e 65 20 6f 66 |the..top| line of|
|000015f0| 20 61 20 55 6e 69 78 2d | 50 43 20 28 37 33 30 30 | a Unix-|PC (7300|
|00001600| 2f 33 42 31 29 20 73 63 | 72 65 65 6e 20 74 68 61 |/3B1) sc|reen tha|
|00001610| 74 20 68 61 73 20 68 61 | 64 20 74 68 65 20 50 68 |t has ha|d the Ph|
|00001620| 6f 6e 65 20 4d 61 6e 61 | 67 65 72 2c 0a 09 53 74 |one Mana|ger,..St|
|00001630| 61 74 75 73 20 4d 61 6e | 61 67 65 72 20 61 6e 64 |atus Man|ager and|
|00001640| 20 57 69 6e 64 6f 77 20 | 4d 61 6e 61 67 65 72 20 | Window |Manager |
|00001650| 64 69 73 61 62 6c 65 64 | 2e 20 20 57 68 61 74 20 |disabled|. What |
|00001660| 69 74 20 73 68 6f 77 73 | 3a 0a 0a 09 2d 20 50 68 |it shows|:...- Ph|
|00001670| 6f 6e 65 20 6c 69 6e 65 | 20 73 74 61 74 65 73 0a |one line| states.|
|00001680| 09 09 6f 20 49 64 6c 65 | 20 2d 20 63 6f 6d 70 6c |..o Idle| - compl|
|00001690| 65 74 65 6c 79 20 66 72 | 65 65 20 6c 69 6e 65 0a |etely fr|ee line.|
|000016a0| 09 09 6f 20 41 6e 73 72 | 20 2d 20 63 6f 6d 70 75 |..o Ansr| - compu|
|000016b0| 74 65 72 20 61 6e 73 77 | 65 72 69 6e 67 20 6c 69 |ter answ|ering li|
|000016c0| 6e 65 20 28 67 65 74 74 | 79 20 6a 6f 62 29 0a 09 |ne (gett|y job)..|
|000016d0| 09 6f 20 4d 61 63 68 20 | 2d 20 69 6e 63 6f 6d 69 |.o Mach |- incomi|
|000016e0| 6e 67 20 6d 61 63 68 69 | 6e 65 0a 09 09 6f 20 55 |ng machi|ne...o U|
|000016f0| 73 65 72 20 2d 20 69 6e | 63 6f 6d 69 6e 67 20 75 |ser - in|coming u|
|00001700| 73 65 72 0a 09 09 6f 20 | 43 61 6c 6c 20 2d 20 61 |ser...o |Call - a|
|00001710| 6e 79 20 6f 75 74 62 6f | 75 6e 64 0a 09 2d 20 42 |ny outbo|und..- B|
|00001720| 6f 6f 74 20 64 61 74 65 | 20 61 6e 64 20 74 69 6d |oot date| and tim|
|00001730| 65 0a 09 2d 20 43 75 72 | 72 65 6e 74 20 72 75 6e |e..- Cur|rent run|
|00001740| 20 6c 65 76 65 6c 0a 09 | 2d 20 43 75 72 72 65 6e | level..|- Curren|
|00001750| 74 20 64 61 74 65 20 61 | 6e 64 20 74 69 6d 65 0a |t date a|nd time.|
|00001760| 09 2d 20 4e 75 6d 62 65 | 72 20 6f 66 20 75 73 65 |.- Numbe|r of use|
|00001770| 72 73 0a 0a 09 57 68 65 | 6e 20 53 75 73 70 65 6e |rs...Whe|n Suspen|
|00001780| 64 20 69 73 20 68 69 74 | 2c 20 69 74 20 6d 61 6b |d is hit|, it mak|
|00001790| 65 73 20 74 68 65 20 6e | 65 78 74 20 77 69 6e 64 |es the n|ext wind|
|000017a0| 6f 77 20 63 75 72 72 65 | 6e 74 3b 20 52 65 73 75 |ow curre|nt; Resu|
|000017b0| 6d 65 0a 09 6d 61 6b 65 | 73 20 74 68 65 20 6c 61 |me..make|s the la|
|000017c0| 73 74 20 77 69 6e 64 6f | 77 20 63 75 72 72 65 6e |st windo|w curren|
|000017d0| 74 2e 0a 0a 09 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |t....The| followi|
|000017e0| 6e 67 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 72 65 |ng funct|ions are|
|000017f0| 20 6d 61 70 70 65 64 20 | 74 6f 20 74 68 65 20 66 | mapped |to the f|
|00001800| 75 6e 63 74 69 6f 6e 20 | 6b 65 79 73 3a 0a 0a 09 |unction |keys:...|
|00001810| 53 68 69 66 74 2d 46 31 | 3a 20 20 70 72 6f 63 65 |Shift-F1|: proce|
|00001820| 73 73 20 64 69 73 70 6c | 61 79 2c 20 73 69 6d 69 |ss displ|ay, simi|
|00001830| 6c 61 72 20 74 6f 20 27 | 70 73 20 2d 65 66 27 0a |lar to '|ps -ef'.|
|00001840| 09 53 68 69 66 74 2d 46 | 32 3a 20 20 75 74 6d 70 |.Shift-F|2: utmp|
|00001850| 20 64 69 73 70 6c 61 79 | 2c 20 6c 69 6b 65 20 27 | display|, like '|
|00001860| 77 68 6f 27 0a 09 53 68 | 69 66 74 2d 46 33 3a 20 |who'..Sh|ift-F3: |
|00001870| 20 6c 69 73 74 73 20 55 | 55 43 50 20 4c 43 4b 2e | lists U|UCP LCK.|
|00001880| 2e 20 66 69 6c 65 73 2c | 20 69 66 20 61 6e 79 0a |. files,| if any.|
|00001890| 09 53 68 69 66 74 2d 46 | 34 3a 20 20 64 69 72 65 |.Shift-F|4: dire|
|000018a0| 63 74 6f 72 79 20 6f 66 | 20 2f 75 73 72 2f 6d 61 |ctory of| /usr/ma|
|000018b0| 69 6c 0a 09 53 68 69 66 | 74 2d 46 35 3a 20 20 52 |il..Shif|t-F5: R|
|000018c0| 6f 6f 74 20 66 69 6c 65 | 73 79 73 74 65 6d 20 66 |oot file|system f|
|000018d0| 72 65 65 73 70 61 63 65 | 20 61 6e 64 20 66 72 65 |reespace| and fre|
|000018e0| 65 20 69 6e 6f 64 65 73 | 0a 09 53 68 69 66 74 2d |e inodes|..Shift-|
|000018f0| 46 36 3a 20 20 6c 69 73 | 74 73 20 55 55 43 50 20 |F6: lis|ts UUCP |
|00001900| 43 2e 20 66 69 6c 65 73 | 2c 20 69 66 20 61 6e 79 |C. files|, if any|
|00001910| 0a 09 53 68 69 66 74 2d | 46 37 3a 20 20 6c 69 73 |..Shift-|F7: lis|
|00001920| 74 73 20 55 55 43 50 20 | 58 2e 20 66 69 6c 65 73 |ts UUCP |X. files|
|00001930| 2c 20 69 66 20 61 6e 79 | 0a 09 53 68 69 66 74 2d |, if any|..Shift-|
|00001940| 46 38 3a 20 20 64 69 72 | 65 63 74 6f 72 79 20 6f |F8: dir|ectory o|
|00001950| 66 20 2f 75 73 72 2f 73 | 70 6f 6f 6c 2f 75 75 63 |f /usr/s|pool/uuc|
|00001960| 70 0a 0a 09 54 68 69 73 | 20 69 73 20 73 74 61 72 |p...This| is star|
|00001970| 74 65 64 20 62 79 20 73 | 74 61 72 74 6d 67 72 20 |ted by s|tartmgr |
|00001980| 28 77 68 69 63 68 20 73 | 68 6f 75 6c 64 20 62 65 |(which s|hould be|
|00001990| 20 69 6e 63 6c 75 64 65 | 64 20 69 6e 20 61 6e 79 | include|d in any|
|000019a0| 0a 09 64 69 73 74 72 69 | 62 75 74 69 6f 6e 29 20 |..distri|bution) |
|000019b0| 73 6f 20 74 68 61 74 20 | 74 68 65 20 66 6f 72 6b |so that |the fork|
|000019c0| 2f 65 78 65 63 2f 6f 70 | 65 6e 20 63 6f 64 65 20 |/exec/op|en code |
|000019d0| 64 6f 65 73 6e 27 74 20 | 68 61 76 65 20 74 6f 20 |doesn't |have to |
|000019e0| 62 65 0a 09 63 61 72 72 | 69 65 64 20 61 72 6f 75 |be..carr|ied arou|
|000019f0| 6e 64 20 77 69 74 68 20 | 74 68 69 73 20 70 72 6f |nd with |this pro|
|00001a00| 67 72 61 6d 2e 0a 0a 09 | 54 68 65 20 70 72 6f 63 |gram....|The proc|
|00001a10| 65 73 73 20 74 61 62 6c | 65 20 73 74 75 66 66 20 |ess tabl|e stuff |
|00001a20| 69 73 20 68 65 61 76 69 | 6c 79 20 69 6e 73 70 69 |is heavi|ly inspi|
|00001a30| 72 65 64 20 62 79 20 74 | 68 65 20 27 66 75 73 65 |red by t|he 'fuse|
|00001a40| 72 2e 63 27 20 70 72 6f | 67 72 61 6d 0a 09 70 6f |r.c' pro|gram..po|
|00001a50| 73 74 65 64 20 74 6f 20 | 74 68 65 20 55 73 65 6e |sted to |the Usen|
|00001a60| 65 74 20 62 79 20 4d 69 | 63 68 61 65 6c 20 27 46 |et by Mi|chael 'F|
|00001a70| 6f 72 64 27 20 44 69 74 | 74 6f 2e 0a 0a 09 54 68 |ord' Dit|to....Th|
|00001a80| 69 73 20 73 6f 66 74 77 | 61 72 65 20 69 73 20 43 |is softw|are is C|
|00001a90| 6f 70 79 72 69 67 68 74 | 20 28 63 29 20 31 39 38 |opyright| (c) 198|
|00001aa0| 37 20 62 79 20 53 63 6f | 74 74 20 48 61 7a 65 6e |7 by Sco|tt Hazen|
|00001ab0| 20 4d 75 65 6c 6c 65 72 | 2e 0a 20 0a 09 50 65 72 | Mueller|.. ..Per|
|00001ac0| 6d 69 73 73 69 6f 6e 20 | 69 73 20 68 65 72 65 62 |mission |is hereb|
|00001ad0| 79 20 67 72 61 6e 74 65 | 64 20 74 6f 20 63 6f 70 |y grante|d to cop|
|00001ae0| 79 2c 20 72 65 70 72 6f | 64 75 63 65 2c 20 72 65 |y, repro|duce, re|
|00001af0| 64 69 73 74 72 69 62 75 | 74 65 20 6f 72 0a 09 6f |distribu|te or..o|
|00001b00| 74 68 65 72 77 69 73 65 | 20 75 73 65 20 74 68 69 |therwise| use thi|
|00001b10| 73 20 73 6f 66 74 77 61 | 72 65 20 61 73 20 6c 6f |s softwa|re as lo|
|00001b20| 6e 67 20 61 73 3a 20 74 | 68 65 72 65 20 69 73 20 |ng as: t|here is |
|00001b30| 6e 6f 20 6d 6f 6e 65 74 | 61 72 79 0a 09 70 72 6f |no monet|ary..pro|
|00001b40| 66 69 74 20 67 61 69 6e | 65 64 20 73 70 65 63 69 |fit gain|ed speci|
|00001b50| 66 69 63 61 6c 6c 79 20 | 66 72 6f 6d 20 74 68 65 |fically |from the|
|00001b60| 20 75 73 65 20 6f 72 20 | 72 65 70 72 6f 64 75 63 | use or |reproduc|
|00001b70| 74 69 6f 6e 20 6f 72 20 | 74 68 69 73 0a 09 73 6f |tion or |this..so|
|00001b80| 66 74 77 61 72 65 2c 20 | 69 74 20 69 73 20 6e 6f |ftware, |it is no|
|00001b90| 74 20 73 6f 6c 64 2c 20 | 72 65 6e 74 65 64 2c 20 |t sold, |rented, |
|00001ba0| 74 72 61 64 65 64 20 6f | 72 20 6f 74 68 65 72 77 |traded o|r otherw|
|00001bb0| 69 73 65 20 6d 61 72 6b | 65 74 65 64 2c 20 61 6e |ise mark|eted, an|
|00001bc0| 64 0a 09 74 68 69 73 20 | 63 6f 70 79 72 69 67 68 |d..this |copyrigh|
|00001bd0| 74 20 6e 6f 74 69 63 65 | 20 69 73 20 69 6e 63 6c |t notice| is incl|
|00001be0| 75 64 65 64 20 70 72 6f | 6d 69 6e 65 6e 74 6c 79 |uded pro|minently|
|00001bf0| 20 69 6e 20 61 6e 79 20 | 63 6f 70 79 0a 09 6d 61 | in any |copy..ma|
|00001c00| 64 65 2e 0a 0a 09 54 68 | 65 20 61 75 74 68 6f 72 |de....Th|e author|
|00001c10| 20 6d 61 6b 65 20 6e 6f | 20 63 6c 61 69 6d 73 20 | make no| claims |
|00001c20| 61 73 20 74 6f 20 74 68 | 65 20 66 69 74 6e 65 73 |as to th|e fitnes|
|00001c30| 73 20 6f 72 20 63 6f 72 | 72 65 63 74 6e 65 73 73 |s or cor|rectness|
|00001c40| 20 6f 66 0a 09 74 68 69 | 73 20 73 6f 66 74 77 61 | of..thi|s softwa|
|00001c50| 72 65 20 66 6f 72 20 61 | 6e 79 20 75 73 65 20 77 |re for a|ny use w|
|00001c60| 68 61 74 73 6f 65 76 65 | 72 2c 20 61 6e 64 20 69 |hatsoeve|r, and i|
|00001c70| 74 20 69 73 20 70 72 6f | 76 69 64 65 64 20 61 73 |t is pro|vided as|
|00001c80| 20 69 73 2e 20 0a 09 41 | 6e 79 20 75 73 65 20 6f | is. ..A|ny use o|
|00001c90| 66 20 74 68 69 73 20 73 | 6f 66 74 77 61 72 65 20 |f this s|oftware |
|00001ca0| 69 73 20 61 74 20 74 68 | 65 20 75 73 65 72 27 73 |is at th|e user's|
|00001cb0| 20 6f 77 6e 20 72 69 73 | 6b 2e 0a 0a 09 28 43 6f | own ris|k....(Co|
|00001cc0| 70 79 72 69 67 68 74 20 | 6e 6f 74 69 63 65 20 63 |pyright |notice c|
|00001cd0| 6f 75 72 74 65 73 79 20 | 6f 66 20 4e 65 77 73 20 |ourtesy |of News |
|00001ce0| 32 2e 31 31 20 3a 2d 29 | 0a 0a 09 41 64 64 69 74 |2.11 :-)|...Addit|
|00001cf0| 69 6f 6e 61 6c 6c 79 3a | 20 20 79 6f 75 20 62 72 |ionally:| you br|
|00001d00| 65 61 6b 20 69 74 2c 20 | 79 6f 75 20 62 6f 75 67 |eak it, |you boug|
|00001d10| 68 74 20 69 74 2e 20 20 | 49 27 76 65 20 6c 69 73 |ht it. |I've lis|
|00001d20| 74 65 64 20 74 68 65 20 | 70 72 6f 62 6c 65 6d 73 |ted the |problems|
|00001d30| 0a 09 74 68 61 74 20 49 | 20 6b 6e 6f 77 20 6f 66 |..that I| know of|
|00001d40| 20 69 6e 20 63 6f 6d 6d | 65 6e 74 73 20 69 6e 20 | in comm|ents in |
|00001d50| 74 68 65 20 63 6f 64 65 | 3b 20 69 66 20 79 6f 75 |the code|; if you|
|00001d60| 20 63 6f 6d 65 20 75 70 | 20 77 69 74 68 20 66 69 | come up| with fi|
|00001d70| 78 65 73 2c 20 49 27 64 | 0a 09 6c 69 6b 65 20 74 |xes, I'd|..like t|
|00001d80| 6f 20 73 65 65 20 74 68 | 65 6d 2c 20 62 75 74 20 |o see th|em, but |
|00001d90| 49 27 6d 20 6e 6f 74 20 | 70 6c 61 6e 6e 69 6e 67 |I'm not |planning|
|00001da0| 20 6f 6e 20 73 75 70 70 | 6f 72 74 69 6e 67 20 61 | on supp|orting a|
|00001db0| 6e 79 74 68 69 6e 67 2e | 20 20 49 74 27 73 0a 09 |nything.| It's..|
|00001dc0| 22 67 6f 6f 64 20 65 6e | 6f 75 67 68 22 3b 20 74 |"good en|ough"; t|
|00001dd0| 68 61 74 27 73 20 61 6c | 6c 20 74 68 61 74 20 49 |hat's al|l that I|
|00001de0| 27 6d 20 6c 6f 6f 6b 69 | 6e 67 20 66 6f 72 2e 09 |'m looki|ng for..|
|00001df0| 2a 2f 0a 0a 23 69 6e 63 | 6c 75 64 65 09 3c 73 74 |*/..#inc|lude.<st|
|00001e00| 64 69 6f 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 09 |dio.h>.#|include.|
|00001e10| 3c 73 79 73 2f 74 79 70 | 65 73 2e 68 3e 0a 23 69 |<sys/typ|es.h>.#i|
|00001e20| 6e 63 6c 75 64 65 09 3c | 73 79 73 2f 70 68 6f 6e |nclude.<|sys/phon|
|00001e30| 65 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 09 3c 73 |e.h>.#in|clude.<s|
|00001e40| 79 73 2f 77 69 6e 64 6f | 77 2e 68 3e 0a 23 69 6e |ys/windo|w.h>.#in|
|00001e50| 63 6c 75 64 65 09 3c 73 | 79 73 2f 73 69 67 6e 61 |clude.<s|ys/signa|
|00001e60| 6c 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 09 3c 73 |l.h>.#in|clude.<s|
|00001e70| 79 73 2f 66 69 6c 73 79 | 73 2e 68 3e 0a 23 69 6e |ys/filsy|s.h>.#in|
|00001e80| 63 6c 75 64 65 09 3c 73 | 79 73 2f 70 72 6f 63 2e |clude.<s|ys/proc.|
|00001e90| 68 3e 0a 23 69 6e 63 6c | 75 64 65 09 3c 73 79 73 |h>.#incl|ude.<sys|
|00001ea0| 2f 75 73 65 72 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |/user.h>|.#includ|
|00001eb0| 65 09 3c 73 79 73 2f 73 | 79 73 6c 6f 63 61 6c 2e |e.<sys/s|yslocal.|
|00001ec0| 68 3e 0a 23 69 6e 63 6c | 75 64 65 09 3c 73 79 73 |h>.#incl|ude.<sys|
|00001ed0| 2f 74 75 6e 65 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |/tune.h>|.#includ|
|00001ee0| 65 09 3c 73 79 73 2f 73 | 74 61 74 2e 68 3e 0a 23 |e.<sys/s|tat.h>.#|
|00001ef0| 69 6e 63 6c 75 64 65 09 | 3c 66 63 6e 74 6c 2e 68 |include.|<fcntl.h|
|00001f00| 3e 0a 23 69 6e 63 6c 75 | 64 65 09 3c 74 69 6d 65 |>.#inclu|de.<time|
|00001f10| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 09 3c 75 74 |.h>.#inc|lude.<ut|
|00001f20| 6d 70 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 09 3c |mp.h>.#i|nclude.<|
|00001f30| 6e 6c 69 73 74 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |nlist.h>|.#includ|
|00001f40| 65 09 3c 70 77 64 2e 68 | 3e 0a 23 69 6e 63 6c 75 |e.<pwd.h|>.#inclu|
|00001f50| 64 65 09 22 6e 64 69 72 | 2e 68 22 0a 0a 23 64 65 |de."ndir|.h"..#de|
|00001f60| 66 69 6e 65 09 09 50 48 | 4f 4e 45 31 09 09 22 70 |fine..PH|ONE1.."p|
|00001f70| 68 30 22 0a 23 64 65 66 | 69 6e 65 09 09 50 48 4f |h0".#def|ine..PHO|
|00001f80| 4e 45 32 09 09 22 70 68 | 31 22 0a 23 64 65 66 69 |NE2.."ph|1".#defi|
|00001f90| 6e 65 09 09 49 44 4c 45 | 09 09 30 0a 23 64 65 66 |ne..IDLE|..0.#def|
|00001fa0| 69 6e 65 09 09 41 4e 53 | 52 09 09 31 0a 23 64 65 |ine..ANS|R..1.#de|
|00001fb0| 66 69 6e 65 09 09 4d 41 | 43 48 09 09 32 0a 23 64 |fine..MA|CH..2.#d|
|00001fc0| 65 66 69 6e 65 09 09 55 | 53 45 52 09 09 33 0a 23 |efine..U|SER..3.#|
|00001fd0| 64 65 66 69 6e 65 09 09 | 43 41 4c 4c 09 09 34 0a |define..|CALL..4.|
|00001fe0| 23 64 65 66 69 6e 65 09 | 09 42 41 52 46 4f 52 4d |#define.|.BARFORM|
|00001ff0| 09 09 22 25 73 31 20 25 | 73 32 20 7c 20 55 70 20 |.."%s1 %|s2 | Up |
|00002000| 53 69 6e 63 65 20 25 73 | 20 7c 20 25 73 20 7c 20 |Since %s| | %s | |
|00002010| 25 73 20 7c 20 25 64 20 | 55 73 65 72 73 20 7c 20 |%s | %d |Users | |
|00002020| 77 25 64 20 5c 72 22 0a | 23 64 65 66 69 6e 65 09 |w%d \r".|#define.|
|00002030| 09 4d 41 43 48 4c 45 4e | 09 09 31 35 0a 23 64 65 |.MACHLEN|..15.#de|
|00002040| 66 69 6e 65 09 09 4d 41 | 58 50 41 54 48 4c 45 4e |fine..MA|XPATHLEN|
|00002050| 09 32 35 35 0a 23 64 65 | 66 69 6e 65 09 09 4c 4f |.255.#de|fine..LO|
|00002060| 43 4b 44 49 52 09 09 22 | 2f 75 73 72 2f 73 70 6f |CKDIR.."|/usr/spo|
|00002070| 6f 6c 2f 75 75 63 70 2f | 22 0a 23 64 65 66 69 6e |ol/uucp/|".#defin|
|00002080| 65 09 09 4d 41 49 4c 44 | 49 52 09 09 22 2f 75 73 |e..MAILD|IR.."/us|
|00002090| 72 2f 6d 61 69 6c 2f 22 | 0a 23 64 65 66 69 6e 65 |r/mail/"|.#define|
|000020a0| 09 09 44 45 56 44 49 52 | 09 09 22 2f 64 65 76 2f |..DEVDIR|.."/dev/|
|000020b0| 22 0a 23 64 65 66 69 6e | 65 09 09 4c 4f 43 4b 50 |".#defin|e..LOCKP|
|000020c0| 52 45 46 49 58 09 22 4c | 43 4b 2e 2e 22 0a 23 64 |REFIX."L|CK..".#d|
|000020d0| 65 66 69 6e 65 09 09 43 | 4f 4d 50 52 45 46 49 58 |efine..C|OMPREFIX|
|000020e0| 09 22 43 2e 22 0a 23 64 | 65 66 69 6e 65 09 09 55 |."C.".#d|efine..U|
|000020f0| 55 58 50 52 45 46 49 58 | 09 22 58 2e 22 0a 23 64 |UXPREFIX|."X.".#d|
|00002100| 65 66 69 6e 65 09 09 54 | 52 55 45 09 09 28 31 29 |efine..T|RUE..(1)|
|00002110| 0a 23 64 65 66 69 6e 65 | 09 09 46 41 4c 53 45 09 |.#define|..FALSE.|
|00002120| 09 28 30 29 0a 23 64 65 | 66 69 6e 65 09 09 54 49 |.(0).#de|fine..TI|
|00002130| 4d 45 46 4f 52 4d 09 22 | 25 2e 32 64 2f 25 2e 32 |MEFORM."|%.2d/%.2|
|00002140| 64 20 25 2e 32 64 3a 25 | 2e 32 64 22 0a 23 64 65 |d %.2d:%|.2d".#de|
|00002150| 66 69 6e 65 09 09 54 49 | 43 4b 09 09 31 35 0a 23 |fine..TI|CK..15.#|
|00002160| 64 65 66 69 6e 65 09 09 | 57 48 4f 53 4c 45 45 50 |define..|WHOSLEEP|
|00002170| 09 31 35 0a 23 64 65 66 | 69 6e 65 09 09 4e 4f 57 |.15.#def|ine..NOW|
|00002180| 48 45 52 45 09 09 30 0a | 23 64 65 66 69 6e 65 09 |HERE..0.|#define.|
|00002190| 09 46 4f 52 57 41 52 44 | 09 09 31 0a 23 64 65 66 |.FORWARD|..1.#def|
|000021a0| 69 6e 65 09 09 42 41 43 | 4b 57 41 52 44 09 32 0a |ine..BAC|KWARD.2.|
|000021b0| 23 64 65 66 69 6e 65 09 | 09 48 45 52 45 09 09 33 |#define.|.HERE..3|
|000021c0| 0a 23 64 65 66 69 6e 65 | 09 09 4d 49 4e 57 49 4e |.#define|..MINWIN|
|000021d0| 09 09 31 0a 23 64 65 66 | 69 6e 65 09 09 4d 41 58 |..1.#def|ine..MAX|
|000021e0| 57 49 4e 09 09 31 32 0a | 0a 63 68 61 72 09 2a 70 |WIN..12.|.char.*p|
|000021f0| 68 73 74 61 74 5b 35 5d | 20 3d 20 7b 20 22 49 64 |hstat[5]| = { "Id|
|00002200| 6c 65 22 2c 20 22 41 6e | 73 72 22 2c 20 22 4d 61 |le", "An|sr", "Ma|
|00002210| 63 68 22 2c 20 22 55 73 | 65 72 22 2c 20 22 43 61 |ch", "Us|er", "Ca|
|00002220| 6c 6c 22 20 7d 3b 0a 0a | 6d 61 69 6e 28 29 0a 7b |ll" };..|main().{|
|00002230| 0a 69 6e 74 09 09 6e 75 | 73 65 72 73 3b 0a 63 68 |.int..nu|sers;.ch|
|00002240| 61 72 09 63 75 72 74 69 | 6d 65 5b 32 36 5d 2c 20 |ar.curti|me[26], |
|00002250| 62 6f 6f 74 74 69 6d 65 | 5b 32 36 5d 2c 20 72 6c |boottime|[26], rl|
|00002260| 5b 31 32 5d 2c 20 6c 69 | 6e 65 5b 38 30 5d 2c 20 |[12], li|ne[80], |
|00002270| 2a 66 6d 74 74 69 6d 65 | 28 29 3b 0a 73 74 72 75 |*fmttime|();.stru|
|00002280| 63 74 09 75 74 6d 70 20 | 2a 75 74 2c 20 2a 67 65 |ct.utmp |*ut, *ge|
|00002290| 74 75 74 65 6e 74 28 29 | 3b 0a 6c 6f 6e 67 09 74 |tutent()|;.long.t|
|000022a0| 65 6d 70 3b 0a 0a 2f 2a | 09 49 67 6e 6f 72 65 20 |emp;../*|.Ignore |
|000022b0| 6b 65 79 62 6f 61 72 64 | 20 69 6e 74 65 72 72 75 |keyboard| interru|
|000022c0| 70 74 20 73 69 67 6e 61 | 6c 73 2e 09 2a 2f 0a 0a |pt signa|ls..*/..|
|000022d0| 73 69 67 6e 61 6c 28 20 | 53 49 47 49 4e 54 2c 20 |signal( |SIGINT, |
|000022e0| 53 49 47 5f 49 47 4e 20 | 29 3b 0a 73 69 67 6e 61 |SIG_IGN |);.signa|
|000022f0| 6c 28 20 53 49 47 51 55 | 49 54 2c 20 53 49 47 5f |l( SIGQU|IT, SIG_|
|00002300| 49 47 4e 20 29 3b 0a 0a | 2f 2a 09 4f 70 65 6e 20 |IGN );..|/*.Open |
|00002310| 75 70 20 74 68 65 20 75 | 74 6d 70 20 66 69 6c 65 |up the u|tmp file|
|00002320| 20 61 6e 64 20 66 69 6e | 64 20 74 68 65 20 62 6f | and fin|d the bo|
|00002330| 6f 74 20 74 69 6d 65 3b | 20 73 61 76 65 20 66 6f |ot time;| save fo|
|00002340| 72 20 64 69 73 70 6c 61 | 79 2e 09 2a 2f 0a 0a 77 |r displa|y..*/..w|
|00002350| 68 69 6c 65 20 28 20 28 | 20 75 74 20 3d 20 67 65 |hile ( (| ut = ge|
|00002360| 74 75 74 65 6e 74 28 29 | 20 29 20 21 3d 20 4e 55 |tutent()| ) != NU|
|00002370| 4c 4c 20 29 0a 09 69 66 | 20 28 20 28 69 6e 74 29 |LL )..if| ( (int)|
|00002380| 20 75 74 2d 3e 75 74 5f | 74 79 70 65 20 3d 3d 20 | ut->ut_|type == |
|00002390| 42 4f 4f 54 5f 54 49 4d | 45 20 29 20 7b 0a 09 09 |BOOT_TIM|E ) {...|
|000023a0| 73 74 72 63 70 79 28 20 | 62 6f 6f 74 74 69 6d 65 |strcpy( |boottime|
|000023b0| 2c 20 66 6d 74 74 69 6d | 65 28 20 6c 6f 63 61 6c |, fmttim|e( local|
|000023c0| 74 69 6d 65 28 20 26 28 | 20 75 74 2d 3e 75 74 5f |time( &(| ut->ut_|
|000023d0| 74 69 6d 65 20 29 20 29 | 20 29 20 29 3b 0a 09 09 |time ) )| ) );...|
|000023e0| 62 72 65 61 6b 3b 0a 09 | 7d 0a 65 6e 64 75 74 65 |break;..|}.endute|
|000023f0| 6e 74 28 29 3b 0a 0a 66 | 6f 72 20 28 3b 3b 29 20 |nt();..f|or (;;) |
|00002400| 7b 0a 0a 2f 2a 09 53 63 | 61 6e 20 74 68 65 20 75 |{../*.Sc|an the u|
|00002410| 74 6d 70 20 66 69 6c 65 | 2c 20 6e 6f 74 69 6e 67 |tmp file|, noting|
|00002420| 20 74 68 65 20 72 75 6e | 20 6c 65 76 65 6c 20 61 | the run| level a|
|00002430| 6e 64 20 74 6f 74 74 69 | 6e 67 20 75 70 20 75 73 |nd totti|ng up us|
|00002440| 65 72 73 2e 09 2a 2f 0a | 0a 09 6e 75 73 65 72 73 |ers..*/.|..nusers|
|00002450| 20 3d 20 30 3b 0a 09 77 | 68 69 6c 65 20 28 20 28 | = 0;..w|hile ( (|
|00002460| 20 75 74 20 3d 20 67 65 | 74 75 74 65 6e 74 28 29 | ut = ge|tutent()|
|00002470| 20 29 20 21 3d 20 4e 55 | 4c 4c 20 29 20 7b 0a 09 | ) != NU|LL ) {..|
|00002480| 09 73 77 69 74 63 68 20 | 28 20 28 69 6e 74 29 20 |.switch |( (int) |
|00002490| 75 74 2d 3e 75 74 5f 74 | 79 70 65 20 29 20 7b 0a |ut->ut_t|ype ) {.|
|000024a0| 09 09 09 63 61 73 65 20 | 55 53 45 52 5f 50 52 4f |...case |USER_PRO|
|000024b0| 43 45 53 53 20 3a 20 6e | 75 73 65 72 73 2b 2b 3b |CESS : n|users++;|
|000024c0| 20 62 72 65 61 6b 3b 0a | 09 09 09 63 61 73 65 20 | break;.|...case |
|000024d0| 52 55 4e 5f 4c 56 4c 20 | 3a 20 73 74 72 63 70 79 |RUN_LVL |: strcpy|
|000024e0| 28 20 72 6c 2c 20 75 74 | 2d 3e 75 74 5f 6c 69 6e |( rl, ut|->ut_lin|
|000024f0| 65 20 29 3b 20 62 72 65 | 61 6b 3b 0a 09 09 09 64 |e ); bre|ak;....d|
|00002500| 65 66 61 75 6c 74 20 3a | 20 62 72 65 61 6b 3b 0a |efault :| break;.|
|00002510| 09 09 09 7d 0a 09 09 7d | 0a 09 65 6e 64 75 74 65 |...}...}|..endute|
|00002520| 6e 74 28 29 3b 0a 0a 2f | 2a 09 46 69 67 75 72 65 |nt();../|*.Figure|
|00002530| 20 6f 75 74 20 74 68 65 | 20 63 75 72 72 65 6e 74 | out the| current|
|00002540| 20 74 69 6d 65 2e 20 20 | 54 65 6d 70 20 69 73 20 | time. |Temp is |
|00002550| 6e 65 65 64 65 64 20 27 | 63 61 75 73 65 20 6c 6f |needed '|cause lo|
|00002560| 63 61 6c 74 69 6d 65 20 | 77 61 6e 74 73 0a 09 61 |caltime |wants..a|
|00002570| 6e 20 61 64 64 72 65 73 | 73 2e 09 2a 2f 0a 0a 09 |n addres|s..*/...|
|00002580| 74 65 6d 70 20 3d 20 74 | 69 6d 65 28 20 28 6c 6f |temp = t|ime( (lo|
|00002590| 6e 67 20 2a 29 20 30 20 | 29 3b 0a 09 73 74 72 63 |ng *) 0 |);..strc|
|000025a0| 70 79 28 20 63 75 72 74 | 69 6d 65 2c 20 66 6d 74 |py( curt|ime, fmt|
|000025b0| 74 69 6d 65 28 20 6c 6f | 63 61 6c 74 69 6d 65 28 |time( lo|caltime(|
|000025c0| 20 26 74 65 6d 70 20 29 | 20 29 20 29 3b 0a 0a 2f | &temp )| ) );../|
|000025d0| 2a 09 46 6f 72 6d 61 74 | 20 61 6e 64 20 70 72 69 |*.Format| and pri|
|000025e0| 6e 74 2e 20 20 46 6c 75 | 73 68 20 73 74 64 6f 75 |nt. Flu|sh stdou|
|000025f0| 74 20 74 6f 20 6d 61 6b | 65 20 69 74 20 72 65 61 |t to mak|e it rea|
|00002600| 6c 6c 79 20 67 65 74 20 | 70 72 69 6e 74 65 64 2e |lly get |printed.|
|00002610| 09 2a 2f 0a 0a 09 73 70 | 72 69 6e 74 66 28 20 6c |.*/...sp|rintf( l|
|00002620| 69 6e 65 2c 20 42 41 52 | 46 4f 52 4d 2c 20 70 68 |ine, BAR|FORM, ph|
|00002630| 73 74 61 74 5b 20 70 68 | 6f 6e 65 5f 73 74 61 74 |stat[ ph|one_stat|
|00002640| 28 20 50 48 4f 4e 45 31 | 20 29 20 5d 2c 0a 09 09 |( PHONE1| ) ],...|
|00002650| 70 68 73 74 61 74 5b 20 | 70 68 6f 6e 65 5f 73 74 |phstat[ |phone_st|
|00002660| 61 74 28 20 50 48 4f 4e | 45 32 20 29 20 5d 2c 20 |at( PHON|E2 ) ], |
|00002670| 62 6f 6f 74 74 69 6d 65 | 2c 20 72 6c 2c 20 63 75 |boottime|, rl, cu|
|00002680| 72 74 69 6d 65 2c 20 6e | 75 73 65 72 73 2c 0a 09 |rtime, n|users,..|
|00002690| 09 63 75 72 77 69 6e 6e | 6f 28 29 20 29 3b 0a 09 |.curwinn|o() );..|
|000026a0| 70 72 69 6e 74 66 28 20 | 22 25 73 22 2c 20 6c 69 |printf( |"%s", li|
|000026b0| 6e 65 20 29 3b 0a 09 66 | 66 6c 75 73 68 28 20 73 |ne );..f|flush( s|
|000026c0| 74 64 6f 75 74 20 29 3b | 0a 0a 2f 2a 20 20 54 61 |tdout );|../* Ta|
|000026d0| 6b 65 20 63 61 72 65 20 | 6f 66 20 74 68 65 20 77 |ke care |of the w|
|000026e0| 69 6e 64 6f 77 20 6d 61 | 6e 61 67 65 6d 65 6e 74 |indow ma|nagement|
|000026f0| 20 73 74 75 66 66 3b 20 | 61 6c 73 6f 20 64 6f 20 | stuff; |also do |
|00002700| 73 6f 6d 65 20 73 6c 65 | 65 70 69 6e 67 20 64 6f |some sle|eping do|
|00002710| 77 6e 0a 09 74 68 65 72 | 65 2e 09 2a 2f 0a 0a 09 |wn..ther|e..*/...|
|00002720| 77 63 68 65 63 6b 7a 28 | 29 3b 0a 09 7d 0a 7d 0a |wcheckz(|);..}.}.|
|00002730| 0a 63 68 61 72 20 2a 66 | 6d 74 74 69 6d 65 28 20 |.char *f|mttime( |
|00002740| 74 6d 20 29 0a 0a 2f 2a | 09 46 6f 72 6d 61 74 20 |tm )../*|.Format |
|00002750| 61 20 74 69 6d 65 20 73 | 74 72 75 63 74 75 72 65 |a time s|tructure|
|00002760| 20 69 6e 74 6f 20 61 20 | 73 74 72 69 6e 67 20 74 | into a |string t|
|00002770| 68 65 20 77 61 79 20 2a | 49 2a 20 77 61 6e 74 20 |he way *|I* want |
|00002780| 69 74 2e 09 2a 2f 0a 0a | 73 74 72 75 63 74 20 74 |it..*/..|struct t|
|00002790| 6d 20 2a 74 6d 3b 0a 7b | 0a 63 68 61 72 20 20 61 |m *tm;.{|.char a|
|000027a0| 62 75 66 5b 32 36 5d 3b | 0a 0a 73 70 72 69 6e 74 |buf[26];|..sprint|
|000027b0| 66 28 20 61 62 75 66 2c | 20 54 49 4d 45 46 4f 52 |f( abuf,| TIMEFOR|
|000027c0| 4d 2c 20 74 6d 2d 3e 74 | 6d 5f 6d 6f 6e 2b 31 2c |M, tm->t|m_mon+1,|
|000027d0| 20 74 6d 2d 3e 74 6d 5f | 6d 64 61 79 2c 20 74 6d | tm->tm_|mday, tm|
|000027e0| 2d 3e 74 6d 5f 68 6f 75 | 72 2c 20 74 6d 2d 3e 74 |->tm_hou|r, tm->t|
|000027f0| 6d 5f 6d 69 6e 20 29 3b | 0a 72 65 74 75 72 6e 28 |m_min );|.return(|
|00002800| 20 61 62 75 66 20 29 3b | 0a 7d 0a 0a 70 68 6f 6e | abuf );|.}..phon|
|00002810| 65 5f 73 74 61 74 28 20 | 70 68 6f 6e 65 20 29 0a |e_stat( |phone ).|
|00002820| 63 68 61 72 09 2a 70 68 | 6f 6e 65 3b 0a 0a 2f 2a |char.*ph|one;../*|
|00002830| 09 46 69 67 75 72 65 20 | 6f 75 74 20 74 68 65 20 |.Figure |out the |
|00002840| 70 68 6f 6e 65 20 6c 69 | 6e 65 20 73 74 61 74 75 |phone li|ne statu|
|00002850| 73 2e 20 20 54 68 65 72 | 65 20 61 72 65 20 66 69 |s. Ther|e are fi|
|00002860| 76 65 20 70 6f 73 73 69 | 62 6c 65 20 73 74 61 74 |ve possi|ble stat|
|00002870| 65 73 3a 0a 09 09 49 64 | 6c 65 20 2d 20 63 6f 6d |es:...Id|le - com|
|00002880| 70 6c 65 74 65 6c 79 20 | 66 72 65 65 20 6c 69 6e |pletely |free lin|
|00002890| 65 0a 09 09 41 6e 73 72 | 20 2d 20 67 65 74 74 79 |e...Ansr| - getty|
|000028a0| 0a 09 09 4d 61 63 68 20 | 2d 20 69 6e 63 6f 6d 69 |...Mach |- incomi|
|000028b0| 6e 67 20 6d 61 63 68 69 | 6e 65 0a 09 09 55 73 65 |ng machi|ne...Use|
|000028c0| 72 20 2d 20 69 6e 63 6f | 6d 69 6e 67 20 75 73 65 |r - inco|ming use|
|000028d0| 72 0a 09 09 43 61 6c 6c | 20 2d 20 6f 75 74 62 6f |r...Call| - outbo|
|000028e0| 75 6e 64 0a 0a 09 54 68 | 65 73 65 20 66 69 76 65 |und...Th|ese five|
|000028f0| 20 73 74 61 74 65 73 20 | 61 72 65 20 64 65 66 69 | states |are defi|
|00002900| 6e 65 64 20 72 6f 75 67 | 68 6c 79 20 61 73 20 66 |ned roug|hly as f|
|00002910| 6f 6c 6c 6f 77 73 3a 0a | 0a 09 09 41 6e 73 72 20 |ollows:.|...Ansr |
|00002920| 2d 20 75 74 6d 70 20 2d | 3e 20 4c 4f 47 49 4e 5f |- utmp -|> LOGIN_|
|00002930| 50 52 4f 43 45 53 53 2e | 0a 09 09 4d 61 63 68 20 |PROCESS.|...Mach |
|00002940| 2d 20 75 74 6d 70 20 2d | 3e 20 55 53 45 52 5f 50 |- utmp -|> USER_P|
|00002950| 52 4f 43 45 53 53 3b 20 | 45 20 4c 43 4b 2e 0a 09 |ROCESS; |E LCK...|
|00002960| 09 55 73 65 72 20 2d 20 | 75 74 6d 70 20 2d 3e 20 |.User - |utmp -> |
|00002970| 55 53 45 52 5f 50 52 4f | 43 45 53 53 3b 20 7e 45 |USER_PRO|CESS; ~E|
|00002980| 20 4c 43 4b 2e 0a 09 09 | 43 61 6c 6c 20 2d 20 75 | LCK....|Call - u|
|00002990| 74 6d 70 20 2d 3e 20 6e | 6f 74 68 69 6e 67 3b 20 |tmp -> n|othing; |
|000029a0| 45 20 4c 43 4b 2e 0a 09 | 09 49 64 6c 65 20 2d 20 |E LCK...|.Idle - |
|000029b0| 75 74 6d 70 20 2d 3e 20 | 6e 6f 74 68 69 6e 67 3b |utmp -> |nothing;|
|000029c0| 20 7e 45 20 4c 43 4b 2e | 0a 0a 09 42 61 73 69 63 | ~E LCK.|...Basic|
|000029d0| 61 6c 6c 79 2c 20 77 65 | 20 64 65 63 69 64 65 20 |ally, we| decide |
|000029e0| 77 68 61 74 20 77 65 20 | 68 61 76 65 20 62 79 20 |what we |have by |
|000029f0| 61 20 70 72 6f 63 65 73 | 73 20 6f 66 20 65 6c 69 |a proces|s of eli|
|00002a00| 6d 69 6e 61 74 69 6f 6e | 2e 0a 0a 09 4b 6e 6f 77 |mination|....Know|
|00002a10| 6e 20 62 75 67 73 3a 20 | 20 54 68 69 73 20 6d 61 |n bugs: | This ma|
|00002a20| 79 20 68 61 76 65 20 70 | 72 6f 62 6c 65 6d 73 20 |y have p|roblems |
|00002a30| 77 69 74 68 20 48 44 42 | 20 55 55 43 50 2c 20 73 |with HDB| UUCP, s|
|00002a40| 69 6e 63 65 20 49 27 76 | 65 20 67 6f 74 20 6e 6f |ince I'v|e got no|
|00002a50| 0a 09 77 61 79 20 74 6f | 20 74 65 73 74 20 61 67 |..way to| test ag|
|00002a60| 61 69 6e 73 74 20 69 74 | 2e 20 20 4f 6e 65 20 74 |ainst it|. One t|
|00002a70| 68 69 6e 67 20 74 68 61 | 74 20 49 20 61 6d 20 73 |hing tha|t I am s|
|00002a80| 75 72 65 20 6f 66 20 69 | 73 20 74 68 61 74 20 73 |ure of i|s that s|
|00002a90| 69 6e 63 65 20 49 0a 09 | 62 65 6c 69 65 76 65 20 |ince I..|believe |
|00002aa0| 74 68 61 74 20 75 75 67 | 65 74 74 79 20 63 72 65 |that uug|etty cre|
|00002ab0| 61 74 65 73 20 61 20 4c | 43 4b 2e 2e 64 65 76 69 |ates a L|CK..devi|
|00002ac0| 63 65 20 66 69 6c 65 2c | 20 74 68 69 73 20 72 6f |ce file,| this ro|
|00002ad0| 75 74 69 6e 65 20 77 69 | 6c 6c 0a 09 63 6f 6e 73 |utine wi|ll..cons|
|00002ae0| 69 73 74 65 6e 74 6c 79 | 20 6d 69 73 74 61 6b 65 |istently| mistake|
|00002af0| 20 75 73 65 72 73 20 6c | 6f 67 67 65 64 20 69 6e | users l|ogged in|
|00002b00| 20 74 68 72 6f 75 67 68 | 20 75 75 67 65 74 74 79 | through| uugetty|
|00002b10| 20 66 6f 72 20 6d 61 63 | 68 69 6e 65 73 0a 09 6c | for mac|hines..l|
|00002b20| 6f 67 67 65 64 20 69 6e | 74 6f 20 75 75 63 69 63 |ogged in|to uucic|
|00002b30| 6f 2e 09 2a 2f 0a 0a 7b | 0a 73 74 72 75 63 74 20 |o..*/..{|.struct |
|00002b40| 75 74 6d 70 09 75 74 5f | 74 72 79 2c 20 2a 75 74 |utmp.ut_|try, *ut|
|00002b50| 2c 20 2a 67 65 74 75 74 | 6c 69 6e 65 28 29 3b 0a |, *getut|line();.|
|00002b60| 73 68 6f 72 74 09 75 74 | 6d 70 74 79 70 65 3b 0a |short.ut|mptype;.|
|00002b70| 63 68 61 72 09 6d 61 63 | 68 69 6e 65 5b 4d 41 43 |char.mac|hine[MAC|
|00002b80| 48 4c 45 4e 5d 3b 0a 0a | 2f 2a 09 4c 6f 6f 6b 20 |HLEN];..|/*.Look |
|00002b90| 66 6f 72 20 74 68 65 20 | 70 68 6f 6e 65 20 6c 69 |for the |phone li|
|00002ba0| 6e 65 20 69 6e 20 74 68 | 65 20 75 74 6d 70 20 66 |ne in th|e utmp f|
|00002bb0| 69 6c 65 2e 20 20 67 65 | 74 75 74 6c 69 6e 65 28 |ile. ge|tutline(|
|00002bc0| 29 20 73 68 6f 75 6c 64 | 20 72 65 74 75 72 6e 0a |) should| return.|
|00002bd0| 09 6f 6e 6c 79 20 4c 4f | 47 49 4e 5f 50 52 4f 43 |.only LO|GIN_PROC|
|00002be0| 45 53 53 2c 20 55 53 45 | 52 5f 50 52 4f 43 45 53 |ESS, USE|R_PROCES|
|00002bf0| 53 2c 20 6f 72 20 4e 55 | 4c 4c 20 28 66 6f 72 20 |S, or NU|LL (for |
|00002c00| 66 61 69 6c 75 72 65 29 | 2e 20 20 57 65 20 6e 65 |failure)|. We ne|
|00002c10| 65 64 20 74 6f 0a 09 73 | 61 76 65 20 73 6f 6d 65 |ed to..s|ave some|
|00002c20| 20 76 61 6c 75 65 73 20 | 62 65 66 6f 72 65 20 74 | values |before t|
|00002c30| 68 65 20 65 6e 64 75 74 | 65 6e 74 28 29 20 63 61 |he endut|ent() ca|
|00002c40| 6c 6c 20 62 65 63 61 75 | 73 65 20 69 74 20 63 6c |ll becau|se it cl|
|00002c50| 65 61 72 73 20 6f 75 74 | 20 74 68 65 0a 09 73 74 |ears out| the..st|
|00002c60| 61 74 69 63 20 73 74 72 | 75 63 74 75 72 65 20 70 |atic str|ucture p|
|00002c70| 6f 69 6e 74 65 64 20 74 | 6f 20 62 79 20 74 68 65 |ointed t|o by the|
|00002c80| 20 72 65 74 75 72 6e 20 | 76 61 6c 75 65 20 6f 66 | return |value of|
|00002c90| 20 67 65 74 75 74 6c 69 | 6e 65 28 29 2e 20 20 57 | getutli|ne(). W|
|00002ca0| 65 0a 09 73 61 76 65 20 | 74 68 65 20 75 74 5f 75 |e..save |the ut_u|
|00002cb0| 73 65 72 20 66 69 65 6c | 64 20 62 65 63 61 75 73 |ser fiel|d becaus|
|00002cc0| 65 20 75 75 63 69 63 6f | 20 63 72 65 61 74 65 73 |e uucico| creates|
|00002cd0| 20 61 20 6d 61 63 68 69 | 6e 65 20 4c 43 4b 20 66 | a machi|ne LCK f|
|00002ce0| 69 6c 65 20 75 73 69 6e | 67 0a 09 74 68 65 20 66 |ile usin|g..the f|
|00002cf0| 69 72 73 74 20 73 69 78 | 20 63 68 61 72 61 63 74 |irst six| charact|
|00002d00| 65 72 73 20 6f 66 20 74 | 68 69 73 20 6e 61 6d 65 |ers of t|his name|
|00002d10| 2e 09 2a 2f 0a 0a 73 74 | 72 63 70 79 28 20 75 74 |..*/..st|rcpy( ut|
|00002d20| 5f 74 72 79 2e 75 74 5f | 6c 69 6e 65 2c 20 70 68 |_try.ut_|line, ph|
|00002d30| 6f 6e 65 20 29 3b 0a 75 | 74 20 3d 20 67 65 74 75 |one );.u|t = getu|
|00002d40| 74 6c 69 6e 65 28 20 26 | 75 74 5f 74 72 79 20 29 |tline( &|ut_try )|
|00002d50| 3b 0a 75 74 6d 70 74 79 | 70 65 20 3d 20 75 74 2d |;.utmpty|pe = ut-|
|00002d60| 3e 75 74 5f 74 79 70 65 | 3b 0a 73 74 72 63 70 79 |>ut_type|;.strcpy|
|00002d70| 28 20 6d 61 63 68 69 6e | 65 2c 20 75 74 2d 3e 75 |( machin|e, ut->u|
|00002d80| 74 5f 75 73 65 72 20 29 | 3b 0a 0a 2f 2a 09 41 54 |t_user )|;../*.AT|
|00002d90| 26 54 20 55 55 43 50 20 | 73 70 65 63 69 66 69 65 |&T UUCP |specifie|
|00002da0| 73 20 61 20 6d 61 78 69 | 6d 75 6d 20 6c 65 6e 67 |s a maxi|mum leng|
|00002db0| 74 68 20 6f 66 20 73 69 | 78 20 63 68 61 72 61 63 |th of si|x charac|
|00002dc0| 74 65 72 73 2e 20 20 52 | 65 6d 6f 76 65 20 74 68 |ters. R|emove th|
|00002dd0| 69 73 0a 09 6c 69 6e 65 | 20 66 6f 72 20 6c 65 73 |is..line| for les|
|00002de0| 73 20 62 72 61 69 6e 2d | 64 61 6d 61 67 65 64 20 |s brain-|damaged |
|00002df0| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 73 2e |implemen|tations.|
|00002e00| 09 2a 2f 0a 0a 6d 61 63 | 68 69 6e 65 5b 36 5d 20 |.*/..mac|hine[6] |
|00002e10| 3d 20 27 5c 30 27 3b 0a | 65 6e 64 75 74 65 6e 74 |= '\0';.|endutent|
|00002e20| 28 29 3b 0a 0a 2f 2a 09 | 46 69 72 73 74 20 63 6f |();../*.|First co|
|00002e30| 6e 64 69 74 69 6f 6e 3a | 20 20 77 61 73 20 74 68 |ndition:| was th|
|00002e40| 65 72 65 20 61 20 75 74 | 6d 70 20 65 6e 74 72 79 |ere a ut|mp entry|
|00002e50| 3f 09 2a 2f 0a 0a 69 66 | 20 28 20 75 74 20 21 3d |?.*/..if| ( ut !=|
|00002e60| 20 4e 55 4c 4c 20 29 0a | 0a 2f 2a 09 54 68 65 72 | NULL ).|./*.Ther|
|00002e70| 65 20 77 61 73 2e 20 20 | 49 66 20 74 68 65 20 74 |e was. |If the t|
|00002e80| 79 70 65 20 66 69 65 6c | 64 20 69 73 20 4c 4f 47 |ype fiel|d is LOG|
|00002e90| 49 4e 5f 50 52 4f 43 45 | 53 53 2c 20 77 65 20 68 |IN_PROCE|SS, we h|
|00002ea0| 61 76 65 20 61 20 67 65 | 74 74 79 20 61 6e 64 20 |ave a ge|tty and |
|00002eb0| 63 61 6e 0a 09 72 65 74 | 75 72 6e 20 74 68 65 20 |can..ret|urn the |
|00002ec0| 61 70 70 72 6f 70 72 69 | 61 74 65 20 76 61 6c 75 |appropri|ate valu|
|00002ed0| 65 20 61 6e 64 20 71 75 | 69 74 2e 09 2a 2f 0a 0a |e and qu|it..*/..|
|00002ee0| 09 69 66 20 28 20 75 74 | 6d 70 74 79 70 65 20 3d |.if ( ut|mptype =|
|00002ef0| 3d 20 4c 4f 47 49 4e 5f | 50 52 4f 43 45 53 53 20 |= LOGIN_|PROCESS |
|00002f00| 29 0a 09 09 72 65 74 75 | 72 6e 28 20 41 4e 53 52 |)...retu|rn( ANSR|
|00002f10| 20 29 3b 0a 09 65 6c 73 | 65 0a 0a 2f 2a 09 41 20 | );..els|e../*.A |
|00002f20| 55 53 45 52 5f 50 52 4f | 43 45 53 53 20 69 73 20 |USER_PRO|CESS is |
|00002f30| 69 6e 63 6f 6d 69 6e 67 | 20 61 6e 64 20 63 61 6e |incoming| and can|
|00002f40| 20 62 65 20 65 69 74 68 | 65 72 20 61 20 75 73 65 | be eith|er a use|
|00002f50| 72 20 6f 72 20 61 20 75 | 75 63 69 63 6f 2e 20 20 |r or a u|ucico. |
|00002f60| 41 6e 0a 09 69 6e 63 6f | 6d 69 6e 67 20 75 75 63 |An..inco|ming uuc|
|00002f70| 69 63 6f 20 68 61 73 20 | 61 20 4c 43 4b 2e 2e 6d |ico has |a LCK..m|
|00002f80| 61 63 68 69 6e 65 20 66 | 69 6c 65 2c 20 73 6f 20 |achine f|ile, so |
|00002f90| 77 65 20 63 68 65 63 6b | 20 66 6f 72 20 74 68 61 |we check| for tha|
|00002fa0| 74 2e 09 2a 2f 0a 0a 09 | 09 72 65 74 75 72 6e 28 |t..*/...|.return(|
|00002fb0| 20 6c 6f 63 6b 65 64 28 | 20 6d 61 63 68 69 6e 65 | locked(| machine|
|00002fc0| 20 29 20 3f 20 4d 41 43 | 48 20 3a 20 55 53 45 52 | ) ? MAC|H : USER|
|00002fd0| 20 29 3b 0a 65 6c 73 65 | 0a 0a 2f 2a 09 54 68 65 | );.else|../*.The|
|00002fe0| 72 65 20 69 73 20 6e 6f | 20 75 74 6d 70 20 65 6e |re is no| utmp en|
|00002ff0| 74 72 79 2e 20 20 54 68 | 65 72 65 20 61 72 65 20 |try. Th|ere are |
|00003000| 6f 6e 6c 79 20 74 77 6f | 20 70 6f 73 73 69 62 69 |only two| possibi|
|00003010| 6c 69 74 69 65 73 20 68 | 65 72 65 3b 20 69 66 20 |lities h|ere; if |
|00003020| 74 68 65 72 65 0a 09 69 | 73 20 61 6e 20 6f 75 74 |there..i|s an out|
|00003030| 67 6f 69 6e 67 20 63 61 | 6c 6c 20 6f 66 20 73 6f |going ca|ll of so|
|00003040| 6d 65 20 73 6f 72 74 2c | 20 74 68 65 72 65 20 77 |me sort,| there w|
|00003050| 69 6c 6c 20 62 65 20 61 | 20 4c 43 4b 2e 2e 64 65 |ill be a| LCK..de|
|00003060| 76 69 63 65 20 66 69 6c | 65 3b 20 69 66 0a 09 6e |vice fil|e; if..n|
|00003070| 6f 74 2c 20 74 68 65 20 | 6c 69 6e 65 20 69 73 20 |ot, the |line is |
|00003080| 72 65 61 6c 6c 79 20 69 | 64 6c 65 2e 09 2a 2f 0a |really i|dle..*/.|
|00003090| 0a 09 09 72 65 74 75 72 | 6e 28 20 6c 6f 63 6b 65 |...retur|n( locke|
|000030a0| 64 28 20 70 68 6f 6e 65 | 20 29 20 3f 20 43 41 4c |d( phone| ) ? CAL|
|000030b0| 4c 20 3a 20 49 44 4c 45 | 20 29 3b 0a 0a 2f 2a 09 |L : IDLE| );../*.|
|000030c0| 53 68 6f 75 6c 64 6e 27 | 74 20 72 65 61 63 68 20 |Shouldn'|t reach |
|000030d0| 68 65 72 65 2e 09 2a 2f | 0a 0a 7d 0a 0a 6c 6f 63 |here..*/|..}..loc|
|000030e0| 6b 65 64 28 20 64 65 76 | 69 63 65 20 29 0a 63 68 |ked( dev|ice ).ch|
|000030f0| 61 72 09 2a 64 65 76 69 | 63 65 3b 0a 0a 2f 2a 09 |ar.*devi|ce;../*.|
|00003100| 53 65 65 20 69 66 20 61 | 20 6c 6f 63 6b 20 66 69 |See if a| lock fi|
|00003110| 6c 65 20 65 78 69 73 74 | 73 2e 09 2a 2f 0a 0a 7b |le exist|s..*/..{|
|00003120| 0a 63 68 61 72 09 74 65 | 6d 70 5b 4d 41 58 50 41 |.char.te|mp[MAXPA|
|00003130| 54 48 4c 45 4e 5d 3b 0a | 69 6e 74 09 09 66 64 3b |THLEN];.|int..fd;|
|00003140| 0a 0a 2f 2a 09 4d 61 6b | 65 20 75 70 20 74 68 65 |../*.Mak|e up the|
|00003150| 20 66 75 6c 6c 20 70 61 | 74 68 20 6e 61 6d 65 2e | full pa|th name.|
|00003160| 09 2a 2f 0a 0a 73 74 72 | 63 70 79 28 20 74 65 6d |.*/..str|cpy( tem|
|00003170| 70 2c 20 4c 4f 43 4b 44 | 49 52 20 29 3b 0a 73 74 |p, LOCKD|IR );.st|
|00003180| 72 63 61 74 28 20 74 65 | 6d 70 2c 20 4c 4f 43 4b |rcat( te|mp, LOCK|
|00003190| 50 52 45 46 49 58 20 29 | 3b 0a 73 74 72 63 61 74 |PREFIX )|;.strcat|
|000031a0| 28 20 74 65 6d 70 2c 20 | 64 65 76 69 63 65 20 29 |( temp, |device )|
|000031b0| 3b 0a 0a 2f 2a 09 41 74 | 74 65 6d 70 74 20 74 6f |;../*.At|tempt to|
|000031c0| 20 6f 70 65 6e 20 74 68 | 65 20 6c 6f 63 6b 20 66 | open th|e lock f|
|000031d0| 69 6c 65 2e 20 20 41 73 | 73 75 6d 65 20 74 68 61 |ile. As|sume tha|
|000031e0| 74 20 69 66 20 74 68 65 | 20 6f 70 65 6e 20 66 61 |t if the| open fa|
|000031f0| 69 6c 73 20 74 68 65 20 | 6c 6f 63 6b 0a 09 66 69 |ils the |lock..fi|
|00003200| 6c 65 20 64 6f 65 73 20 | 6e 6f 74 20 65 78 69 73 |le does |not exis|
|00003210| 74 2e 09 2a 2f 0a 0a 66 | 64 20 3d 20 6f 70 65 6e |t..*/..f|d = open|
|00003220| 28 20 74 65 6d 70 2c 20 | 4f 5f 52 44 4f 4e 4c 59 |( temp, |O_RDONLY|
|00003230| 20 29 3b 0a 69 66 20 28 | 20 66 64 20 3d 3d 20 2d | );.if (| fd == -|
|00003240| 31 20 29 0a 09 72 65 74 | 75 72 6e 28 20 46 41 4c |1 )..ret|urn( FAL|
|00003250| 53 45 20 29 3b 0a 63 6c | 6f 73 65 28 20 66 64 20 |SE );.cl|ose( fd |
|00003260| 29 3b 0a 72 65 74 75 72 | 6e 28 20 54 52 55 45 20 |);.retur|n( TRUE |
|00003270| 29 3b 0a 7d 0a 0a 63 75 | 72 77 69 6e 6e 6f 28 29 |);.}..cu|rwinno()|
|00003280| 0a 0a 2f 2a 09 46 69 67 | 75 72 65 20 6f 75 74 20 |../*.Fig|ure out |
|00003290| 74 68 65 20 63 75 72 72 | 65 6e 74 20 77 69 6e 64 |the curr|ent wind|
|000032a0| 6f 77 3b 20 77 65 20 6e | 65 65 64 20 61 20 73 74 |ow; we n|eed a st|
|000032b0| 61 72 74 69 6e 67 20 70 | 6f 69 6e 74 2c 20 61 66 |arting p|oint, af|
|000032c0| 74 65 72 20 61 6c 6c 2e | 0a 09 4b 6e 6f 77 6e 20 |ter all.|..Known |
|000032d0| 62 75 67 3a 20 20 74 68 | 69 73 20 73 6f 6d 65 74 |bug: th|is somet|
|000032e0| 69 6d 65 73 20 72 65 74 | 75 72 6e 73 20 74 68 65 |imes ret|urns the|
|000032f0| 20 77 72 6f 6e 67 20 76 | 61 6c 75 65 20 69 66 20 | wrong v|alue if |
|00003300| 69 74 20 67 65 74 73 20 | 69 6e 74 6f 20 61 0a 09 |it gets |into a..|
|00003310| 72 61 63 65 20 63 6f 6e | 64 69 74 69 6f 6e 20 77 |race con|dition w|
|00003320| 69 74 68 20 61 20 74 65 | 72 6d 69 6e 61 74 69 6e |ith a te|rminatin|
|00003330| 67 2f 72 65 73 74 61 72 | 74 69 6e 67 20 28 65 67 |g/restar|ting (eg|
|00003340| 2c 20 67 65 74 74 79 29 | 20 6a 6f 62 2e 20 20 49 |, getty)| job. I|
|00003350| 74 20 61 6c 73 6f 0a 09 | 64 6f 65 73 6e 27 74 20 |t also..|doesn't |
|00003360| 63 68 65 63 6b 20 74 6f | 20 73 65 65 20 69 66 20 |check to| see if |
|00003370| 74 68 65 20 69 6f 63 74 | 6c 20 66 61 69 6c 73 2e |the ioct|l fails.|
|00003380| 09 2a 2f 0a 0a 7b 0a 69 | 6e 74 09 09 66 6f 6f 77 |.*/..{.i|nt..foow|
|00003390| 69 6e 2c 20 64 75 6d 6d | 79 2c 20 74 65 6d 70 3b |in, dumm|y, temp;|
|000033a0| 0a 0a 66 6f 6f 77 69 6e | 20 3d 20 6f 70 65 6e 28 |..foowin| = open(|
|000033b0| 20 22 2f 64 65 76 2f 77 | 69 6e 64 6f 77 22 2c 20 | "/dev/w|indow", |
|000033c0| 4f 5f 52 44 4f 4e 4c 59 | 20 29 3b 0a 74 65 6d 70 |O_RDONLY| );.temp|
|000033d0| 20 3d 20 69 6f 63 74 6c | 28 20 66 6f 6f 77 69 6e | = ioctl|( foowin|
|000033e0| 2c 20 57 49 4f 43 47 43 | 55 52 52 2c 20 64 75 6d |, WIOCGC|URR, dum|
|000033f0| 6d 79 20 29 3b 0a 63 6c | 6f 73 65 28 20 66 6f 6f |my );.cl|ose( foo|
|00003400| 77 69 6e 20 29 3b 0a 72 | 65 74 75 72 6e 28 20 74 |win );.r|eturn( t|
|00003410| 65 6d 70 20 29 3b 0a 7d | 0a 0a 77 63 68 65 63 6b |emp );.}|..wcheck|
|00003420| 7a 28 29 0a 0a 2f 2a 09 | 54 68 69 73 20 69 73 20 |z()../*.|This is |
|00003430| 77 68 65 72 65 20 74 68 | 65 20 63 6f 64 65 20 74 |where th|e code t|
|00003440| 6f 20 63 68 65 63 6b 20 | 66 6f 72 20 63 68 61 6e |o check |for chan|
|00003450| 67 65 2d 77 69 6e 64 6f | 77 20 6b 65 79 73 20 6c |ge-windo|w keys l|
|00003460| 69 76 65 73 2e 20 20 41 | 6c 73 6f 2c 0a 09 73 6c |ives. A|lso,..sl|
|00003470| 65 65 70 20 66 6f 72 20 | 74 68 65 20 6d 61 69 6e |eep for |the main|
|00003480| 20 70 72 6f 67 72 61 6d | 20 68 65 72 65 2e 20 20 | program| here. |
|00003490| 49 74 20 73 68 6f 75 6c | 64 20 72 65 74 75 72 6e |It shoul|d return|
|000034a0| 20 61 62 6f 75 74 20 65 | 76 65 72 79 20 54 49 43 | about e|very TIC|
|000034b0| 4b 0a 09 73 65 63 6f 6e | 64 73 2e 09 2a 2f 0a 0a |K..secon|ds..*/..|
|000034c0| 7b 0a 69 6e 74 09 09 74 | 6f 63 6b 2c 20 6e 65 77 |{.int..t|ock, new|
|000034d0| 77 69 6e 2c 20 64 69 72 | 3b 0a 0a 74 6f 63 6b 20 |win, dir|;..tock |
|000034e0| 3d 20 30 3b 0a 0a 64 6f | 20 7b 0a 2f 2a 09 43 68 |= 0;..do| {./*.Ch|
|000034f0| 65 63 6b 20 66 6f 72 20 | 61 20 63 6f 6d 6d 61 6e |eck for |a comman|
|00003500| 64 20 6b 65 79 2e 09 2a | 2f 0a 0a 09 69 66 20 28 |d key..*|/...if (|
|00003510| 20 28 20 64 69 72 20 3d | 20 63 68 65 63 6b 65 79 | ( dir =| checkey|
|00003520| 28 29 20 29 20 21 3d 20 | 4e 4f 57 48 45 52 45 20 |() ) != |NOWHERE |
|00003530| 29 20 7b 0a 0a 2f 2a 09 | 44 65 74 65 72 6d 69 6e |) {../*.|Determin|
|00003540| 65 20 77 68 69 63 68 20 | 77 69 6e 64 6f 77 20 69 |e which |window i|
|00003550| 73 20 6e 65 78 74 20 61 | 6e 64 20 73 65 6c 65 63 |s next a|nd selec|
|00003560| 74 20 69 74 2e 09 2a 2f | 0a 0a 09 09 69 66 20 28 |t it..*/|....if (|
|00003570| 20 64 69 72 20 21 3d 20 | 48 45 52 45 20 29 20 7b | dir != |HERE ) {|
|00003580| 0a 09 09 09 6e 65 77 77 | 69 6e 20 3d 20 6e 65 78 |....neww|in = nex|
|00003590| 77 69 6e 28 20 63 75 72 | 77 69 6e 6e 6f 28 29 2c |win( cur|winno(),|
|000035a0| 20 64 69 72 20 29 3b 0a | 09 09 09 69 6f 63 74 6c | dir );.|...ioctl|
|000035b0| 28 20 6e 65 77 77 69 6e | 2c 20 57 49 4f 43 53 45 |( newwin|, WIOCSE|
|000035c0| 4c 45 43 54 20 29 3b 0a | 09 09 09 63 6c 6f 73 65 |LECT );.|...close|
|000035d0| 28 20 6e 65 77 77 69 6e | 20 29 3b 0a 09 09 09 7d |( newwin| );....}|
|000035e0| 0a 09 09 74 6f 63 6b 20 | 3d 20 54 49 43 4b 3b 09 |...tock |= TICK;.|
|000035f0| 09 2f 2a 09 4b 6c 75 64 | 67 65 20 74 6f 20 66 6f |./*.Klud|ge to fo|
|00003600| 72 63 65 20 72 65 74 75 | 72 6e 20 61 6e 64 20 72 |rce retu|rn and r|
|00003610| 65 64 69 73 70 6c 61 79 | 2e 09 2a 2f 0a 09 09 7d |edisplay|..*/...}|
|00003620| 0a 09 7d 0a 0a 2f 2a 09 | 52 65 74 75 72 6e 20 61 |..}../*.|Return a|
|00003630| 66 74 65 72 20 54 49 43 | 4b 20 74 6f 63 6b 73 2e |fter TIC|K tocks.|
|00003640| 09 2a 2f 0a 0a 77 68 69 | 6c 65 20 28 20 74 6f 63 |.*/..whi|le ( toc|
|00003650| 6b 2b 2b 20 3c 20 54 49 | 43 4b 20 29 3b 0a 7d 0a |k++ < TI|CK );.}.|
|00003660| 0a 6a 75 73 74 67 6f 6f | 6e 28 29 0a 0a 2f 2a 09 |.justgoo|n()../*.|
|00003670| 53 74 75 62 20 72 6f 75 | 74 69 6e 65 20 74 6f 20 |Stub rou|tine to |
|00003680| 22 68 61 6e 64 6c 65 22 | 20 74 68 65 20 61 6c 61 |"handle"| the ala|
|00003690| 72 6d 20 73 69 67 6e 61 | 6c 2e 20 20 44 6f 65 73 |rm signa|l. Does|
|000036a0| 6e 27 74 20 64 6f 20 61 | 20 6c 6f 74 2e 09 2a 2f |n't do a| lot..*/|
|000036b0| 0a 0a 7b 0a 72 65 74 75 | 72 6e 3b 0a 7d 0a 0a 63 |..{.retu|rn;.}..c|
|000036c0| 68 65 63 6b 65 79 28 29 | 0a 0a 2f 2a 09 43 68 65 |heckey()|../*.Che|
|000036d0| 63 6b 20 61 6e 64 20 73 | 65 65 20 69 66 20 6f 6e |ck and s|ee if on|
|000036e0| 65 20 6f 66 20 6f 75 72 | 20 6b 65 79 73 20 68 61 |e of our| keys ha|
|000036f0| 73 20 62 65 65 6e 20 70 | 6f 6b 65 64 2e 20 20 54 |s been p|oked. T|
|00003700| 68 65 20 6f 6e 6c 79 20 | 6b 65 79 73 20 74 68 69 |he only |keys thi|
|00003710| 73 20 77 69 6e 64 6f 77 | 0a 09 69 73 20 73 75 70 |s window|..is sup|
|00003720| 70 6f 73 65 64 20 74 6f | 20 72 65 73 70 6f 6e 64 |posed to| respond|
|00003730| 20 74 6f 20 61 6c 6c 20 | 67 65 6e 65 72 61 74 65 | to all |generate|
|00003740| 20 74 68 72 65 65 20 63 | 68 61 72 61 63 74 65 72 | three c|haracter|
|00003750| 20 65 73 63 61 70 65 20 | 73 65 71 75 65 6e 63 65 | escape |sequence|
|00003760| 73 2e 0a 09 53 65 74 20 | 61 6e 64 20 63 61 74 63 |s...Set |and catc|
|00003770| 68 20 61 6e 20 61 6c 61 | 72 6d 20 73 69 67 6e 61 |h an ala|rm signa|
|00003780| 6c 20 74 6f 20 6b 65 65 | 70 20 66 72 6f 6d 20 67 |l to kee|p from g|
|00003790| 65 74 74 69 6e 67 20 68 | 75 6e 67 20 69 6e 20 74 |etting h|ung in t|
|000037a0| 68 65 20 66 72 65 61 64 | 28 29 3b 0a 09 74 68 69 |he fread|();..thi|
|000037b0| 73 20 70 72 6f 62 61 62 | 6c 79 20 63 6f 75 6c 64 |s probab|ly could|
|000037c0| 20 62 65 20 64 6f 6e 65 | 20 6d 6f 72 65 20 6e 65 | be done| more ne|
|000037d0| 61 74 6c 79 20 73 6f 6d | 65 20 6f 74 68 65 72 20 |atly som|e other |
|000037e0| 77 61 79 2c 20 62 75 74 | 2e 2e 2e 09 2a 2f 0a 0a |way, but|....*/..|
|000037f0| 7b 0a 69 6e 74 09 09 64 | 69 72 65 63 74 69 6f 6e |{.int..d|irection|
|00003800| 2c 20 69 3b 0a 46 49 4c | 45 09 2a 66 77 3b 0a 63 |, i;.FIL|E.*fw;.c|
|00003810| 68 61 72 09 6b 65 79 5b | 33 5d 3b 0a 0a 2f 2a 09 |har.key[|3];../*.|
|00003820| 53 65 74 20 74 68 65 20 | 61 6c 61 72 6d 20 73 69 |Set the |alarm si|
|00003830| 67 6e 61 6c 2e 09 2a 2f | 0a 0a 73 69 67 6e 61 6c |gnal..*/|..signal|
|00003840| 28 20 53 49 47 41 4c 52 | 4d 2c 20 6a 75 73 74 67 |( SIGALR|M, justg|
|00003850| 6f 6f 6e 20 29 3b 0a 61 | 6c 61 72 6d 28 20 31 20 |oon );.a|larm( 1 |
|00003860| 29 3b 0a 69 66 20 28 20 | 66 72 65 61 64 28 20 6b |);.if ( |fread( k|
|00003870| 65 79 2c 20 31 2c 20 33 | 2c 20 73 74 64 69 6e 20 |ey, 1, 3|, stdin |
|00003880| 29 20 3d 3d 20 33 20 29 | 20 7b 0a 0a 2f 2a 09 52 |) == 3 )| {../*.R|
|00003890| 65 73 65 74 20 74 68 65 | 20 61 6c 61 72 6d 20 73 |eset the| alarm s|
|000038a0| 69 67 6e 61 6c 20 74 6f | 20 62 65 20 69 67 6e 6f |ignal to| be igno|
|000038b0| 72 65 64 2e 09 2a 2f 0a | 0a 09 73 69 67 6e 61 6c |red..*/.|..signal|
|000038c0| 28 20 53 49 47 41 4c 52 | 4d 2c 20 53 49 47 5f 49 |( SIGALR|M, SIG_I|
|000038d0| 47 4e 20 29 3b 0a 09 61 | 6c 61 72 6d 28 20 30 20 |GN );..a|larm( 0 |
|000038e0| 29 3b 0a 0a 2f 2a 09 50 | 69 63 6b 20 61 20 66 75 |);../*.P|ick a fu|
|000038f0| 6e 63 74 69 6f 6e 2e 09 | 2a 2f 0a 0a 09 73 77 69 |nction..|*/...swi|
|00003900| 74 63 68 20 28 20 6b 65 | 79 5b 32 5d 20 29 20 7b |tch ( ke|y[2] ) {|
|00003910| 0a 09 09 63 61 73 65 20 | 27 43 27 20 3a 20 73 68 |...case |'C' : sh|
|00003920| 6f 77 70 72 6f 63 73 28 | 29 3b 20 64 69 72 65 63 |owprocs(|); direc|
|00003930| 74 69 6f 6e 3d 48 45 52 | 45 3b 20 62 72 65 61 6b |tion=HER|E; break|
|00003940| 3b 0a 09 09 63 61 73 65 | 20 27 44 27 20 3a 20 73 |;...case| 'D' : s|
|00003950| 68 6f 77 75 74 6d 70 28 | 29 3b 20 64 69 72 65 63 |howutmp(|); direc|
|00003960| 74 69 6f 6e 3d 48 45 52 | 45 3b 20 62 72 65 61 6b |tion=HER|E; break|
|00003970| 3b 0a 09 09 63 61 73 65 | 20 27 45 27 20 3a 20 73 |;...case| 'E' : s|
|00003980| 68 6f 77 64 69 72 28 20 | 4c 4f 43 4b 44 49 52 2c |howdir( |LOCKDIR,|
|00003990| 20 4c 4f 43 4b 50 52 45 | 46 49 58 20 29 3b 20 64 | LOCKPRE|FIX ); d|
|000039a0| 69 72 65 63 74 69 6f 6e | 3d 48 45 52 45 3b 20 62 |irection|=HERE; b|
|000039b0| 72 65 61 6b 3b 0a 09 09 | 63 61 73 65 20 27 46 27 |reak;...|case 'F'|
|000039c0| 20 3a 20 73 68 6f 77 64 | 69 72 28 20 4d 41 49 4c | : showd|ir( MAIL|
|000039d0| 44 49 52 2c 20 22 22 20 | 29 3b 20 64 69 72 65 63 |DIR, "" |); direc|
|000039e0| 74 69 6f 6e 3d 48 45 52 | 45 3b 20 62 72 65 61 6b |tion=HER|E; break|
|000039f0| 3b 0a 09 09 63 61 73 65 | 20 27 47 27 20 3a 20 73 |;...case| 'G' : s|
|00003a00| 68 6f 77 66 73 79 73 28 | 29 3b 20 64 69 72 65 63 |howfsys(|); direc|
|00003a10| 74 69 6f 6e 3d 48 45 52 | 45 3b 20 62 72 65 61 6b |tion=HER|E; break|
|00003a20| 3b 0a 09 09 63 61 73 65 | 20 27 48 27 20 3a 20 73 |;...case| 'H' : s|
|00003a30| 68 6f 77 64 69 72 28 20 | 4c 4f 43 4b 44 49 52 2c |howdir( |LOCKDIR,|
|00003a40| 20 43 4f 4d 50 52 45 46 | 49 58 20 29 3b 20 64 69 | COMPREF|IX ); di|
|00003a50| 72 65 63 74 69 6f 6e 3d | 48 45 52 45 3b 20 62 72 |rection=|HERE; br|
|00003a60| 65 61 6b 3b 0a 09 09 63 | 61 73 65 20 27 49 27 20 |eak;...c|ase 'I' |
|00003a70| 3a 20 73 68 6f 77 64 69 | 72 28 20 4c 4f 43 4b 44 |: showdi|r( LOCKD|
|00003a80| 49 52 2c 20 55 55 58 50 | 52 45 46 49 58 20 29 3b |IR, UUXP|REFIX );|
|00003a90| 20 64 69 72 65 63 74 69 | 6f 6e 3d 48 45 52 45 3b | directi|on=HERE;|
|00003aa0| 20 62 72 65 61 6b 3b 0a | 09 09 63 61 73 65 20 27 | break;.|..case '|
|00003ab0| 4a 27 20 3a 20 73 68 6f | 77 64 69 72 28 20 4c 4f |J' : sho|wdir( LO|
|00003ac0| 43 4b 44 49 52 2c 20 22 | 22 20 29 3b 20 64 69 72 |CKDIR, "|" ); dir|
|00003ad0| 65 63 74 69 6f 6e 3d 48 | 45 52 45 3b 20 62 72 65 |ection=H|ERE; bre|
|00003ae0| 61 6b 3b 0a 09 09 63 61 | 73 65 20 27 70 27 20 3a |ak;...ca|se 'p' :|
|00003af0| 20 0a 09 09 63 61 73 65 | 20 27 50 27 20 3a 20 64 | ...case| 'P' : d|
|00003b00| 69 72 65 63 74 69 6f 6e | 20 3d 20 46 4f 52 57 41 |irection| = FORWA|
|00003b10| 52 44 3b 20 62 72 65 61 | 6b 3b 0a 09 09 63 61 73 |RD; brea|k;...cas|
|00003b20| 65 20 27 71 27 20 3a 0a | 09 09 63 61 73 65 20 27 |e 'q' :.|..case '|
|00003b30| 51 27 20 3a 20 64 69 72 | 65 63 74 69 6f 6e 20 3d |Q' : dir|ection =|
|00003b40| 20 42 41 43 4b 57 41 52 | 44 3b 20 62 72 65 61 6b | BACKWAR|D; break|
|00003b50| 3b 0a 09 09 63 61 73 65 | 20 27 5a 27 20 3a 20 68 |;...case| 'Z' : h|
|00003b60| 65 6c 70 28 29 3b 20 64 | 69 72 65 63 74 69 6f 6e |elp(); d|irection|
|00003b70| 20 3d 20 48 45 52 45 3b | 20 62 72 65 61 6b 3b 0a | = HERE;| break;.|
|00003b80| 09 09 64 65 66 61 75 6c | 74 20 3a 20 64 69 72 65 |..defaul|t : dire|
|00003b90| 63 74 69 6f 6e 20 3d 20 | 4e 4f 57 48 45 52 45 3b |ction = |NOWHERE;|
|00003ba0| 20 62 72 65 61 6b 3b 0a | 09 09 7d 0a 09 7d 0a 09 | break;.|..}..}..|
|00003bb0| 65 6c 73 65 0a 09 09 64 | 69 72 65 63 74 69 6f 6e |else...d|irection|
|00003bc0| 20 3d 20 4e 4f 57 48 45 | 52 45 3b 0a 0a 2f 2a 09 | = NOWHE|RE;../*.|
|00003bd0| 52 65 73 65 74 20 74 68 | 65 20 61 6c 61 72 6d 20 |Reset th|e alarm |
|00003be0| 73 69 67 6e 61 6c 20 74 | 6f 20 62 65 20 69 67 6e |signal t|o be ign|
|00003bf0| 6f 72 65 64 2e 09 2a 2f | 0a 0a 73 69 67 6e 61 6c |ored..*/|..signal|
|00003c00| 28 20 53 49 47 41 4c 52 | 4d 2c 20 53 49 47 5f 49 |( SIGALR|M, SIG_I|
|00003c10| 47 4e 20 29 3b 0a 61 6c | 61 72 6d 28 20 30 20 29 |GN );.al|arm( 0 )|
|00003c20| 3b 0a 72 65 74 75 72 6e | 28 20 64 69 72 65 63 74 |;.return|( direct|
|00003c30| 69 6f 6e 20 29 3b 0a 7d | 0a 0a 6e 65 78 77 69 6e |ion );.}|..nexwin|
|00003c40| 28 20 77 69 6e 6e 6f 2c | 20 64 69 72 20 29 0a 69 |( winno,| dir ).i|
|00003c50| 6e 74 20 77 69 6e 6e 6f | 2c 20 64 69 72 3b 0a 0a |nt winno|, dir;..|
|00003c60| 2f 2a 09 44 65 63 69 64 | 65 20 77 68 61 74 20 73 |/*.Decid|e what s|
|00003c70| 68 6f 75 6c 64 20 62 65 | 20 74 68 65 20 6e 65 78 |hould be| the nex|
|00003c80| 74 20 77 69 6e 64 6f 77 | 2e 20 20 54 68 69 73 20 |t window|. This |
|00003c90| 72 65 6c 69 65 73 20 6f | 6e 20 74 68 65 20 66 61 |relies o|n the fa|
|00003ca0| 63 74 20 74 68 61 74 0a | 09 77 68 65 6e 20 79 6f |ct that.|.when yo|
|00003cb0| 75 20 6f 70 65 6e 20 61 | 20 77 69 6e 64 6f 77 20 |u open a| window |
|00003cc0| 64 65 76 69 63 65 20 64 | 69 72 65 63 74 6c 79 20 |device d|irectly |
|00003cd0| 74 68 65 20 6f 70 65 6e | 20 63 61 6c 6c 20 77 69 |the open| call wi|
|00003ce0| 6c 6c 20 66 61 69 6c 20 | 69 66 20 69 74 20 68 61 |ll fail |if it ha|
|00003cf0| 73 0a 09 6e 6f 74 20 61 | 6c 72 65 61 64 79 20 62 |s..not a|lready b|
|00003d00| 65 65 6e 20 6f 70 65 6e | 65 64 20 62 79 20 73 6f |een open|ed by so|
|00003d10| 6d 65 6f 6e 65 20 65 6c | 73 65 3b 20 74 68 69 73 |meone el|se; this|
|00003d20| 20 69 73 20 68 6f 77 20 | 77 65 20 66 69 6e 64 20 | is how |we find |
|00003d30| 74 68 65 20 6f 70 65 6e | 0a 09 77 69 6e 64 6f 77 |the open|..window|
|00003d40| 73 2e 20 20 49 6e 76 69 | 73 69 62 6c 65 20 77 69 |s. Invi|sible wi|
|00003d50| 6e 64 6f 77 73 20 73 68 | 6f 75 6c 64 20 68 61 76 |ndows sh|ould hav|
|00003d60| 65 20 74 68 65 69 72 20 | 75 73 65 72 2d 74 65 78 |e their |user-tex|
|00003d70| 74 20 73 65 74 20 74 6f | 20 22 49 6e 76 69 73 69 |t set to| "Invisi|
|00003d80| 62 6c 65 22 0a 09 69 66 | 20 74 68 65 79 20 77 69 |ble"..if| they wi|
|00003d90| 73 68 20 74 6f 20 62 65 | 20 69 67 6e 6f 72 65 64 |sh to be| ignored|
|00003da0| 2e 09 2a 2f 0a 0a 7b 0a | 69 6e 74 09 09 77 64 3b |..*/..{.|int..wd;|
|00003db0| 0a 63 68 61 72 09 77 69 | 6e 64 65 78 5b 31 32 5d |.char.wi|ndex[12]|
|00003dc0| 3b 0a 73 74 72 75 63 74 | 09 75 74 64 61 74 61 09 |;.struct|.utdata.|
|00003dd0| 77 69 6e 74 65 78 74 3b | 0a 0a 2f 2a 09 54 72 69 |wintext;|../*.Tri|
|00003de0| 76 69 61 6c 20 6c 6f 6f | 70 3b 20 61 74 20 77 6f |vial loo|p; at wo|
|00003df0| 72 73 74 2c 20 77 65 27 | 6c 6c 20 77 69 6e 64 20 |rst, we'|ll wind |
|00003e00| 75 70 20 62 61 63 6b 20 | 77 68 65 72 65 20 77 65 |up back |where we|
|00003e10| 20 73 74 61 72 74 65 64 | 2e 20 20 49 20 73 75 70 | started|. I sup|
|00003e20| 70 6f 73 65 0a 09 69 74 | 27 73 20 70 6f 73 73 69 |pose..it|'s possi|
|00003e30| 62 6c 65 20 74 6f 20 68 | 61 76 65 20 61 20 73 79 |ble to h|ave a sy|
|00003e40| 73 74 65 6d 20 77 69 74 | 68 20 6e 6f 20 77 69 6e |stem wit|h no win|
|00003e50| 64 6f 77 73 20 65 78 63 | 65 70 74 20 74 68 6f 73 |dows exc|ept thos|
|00003e60| 65 20 6d 61 72 6b 65 64 | 20 61 73 0a 09 22 49 6e |e marked| as.."In|
|00003e70| 76 69 73 69 62 6c 65 22 | 3b 20 69 74 20 64 6f 65 |visible"|; it doe|
|00003e80| 73 6e 27 74 20 73 65 65 | 6d 20 74 6f 6f 20 75 73 |sn't see|m too us|
|00003e90| 65 66 75 6c 2c 20 74 68 | 6f 75 67 68 2e 09 2a 2f |eful, th|ough..*/|
|00003ea0| 0a 0a 77 68 69 6c 65 20 | 28 20 31 20 29 20 7b 0a |..while |( 1 ) {.|
|00003eb0| 0a 2f 2a 09 46 6f 72 77 | 61 72 64 2f 62 61 63 6b |./*.Forw|ard/back|
|00003ec0| 77 61 72 64 20 73 6f 72 | 74 2d 6f 66 20 6d 6f 64 |ward sor|t-of mod|
|00003ed0| 75 6c 6f 20 61 72 69 74 | 68 6d 65 74 69 63 2e 20 |ulo arit|hmetic. |
|00003ee0| 20 52 65 61 6c 20 6d 6f | 64 75 6c 6f 20 61 72 69 | Real mo|dulo ari|
|00003ef0| 74 68 6d 65 74 69 63 0a | 09 73 74 61 72 74 73 20 |thmetic.|.starts |
|00003f00| 61 74 20 7a 65 72 6f 2e | 09 2a 2f 0a 0a 09 77 69 |at zero.|.*/...wi|
|00003f10| 6e 6e 6f 20 2b 3d 20 28 | 20 64 69 72 20 3d 3d 20 |nno += (| dir == |
|00003f20| 46 4f 52 57 41 52 44 20 | 3f 20 31 20 3a 20 2d 31 |FORWARD |? 1 : -1|
|00003f30| 20 29 3b 0a 09 69 66 20 | 28 20 77 69 6e 6e 6f 20 | );..if |( winno |
|00003f40| 3e 20 4d 41 58 57 49 4e | 20 29 0a 09 09 77 69 6e |> MAXWIN| )...win|
|00003f50| 6e 6f 20 3d 20 4d 49 4e | 57 49 4e 3b 0a 09 65 6c |no = MIN|WIN;..el|
|00003f60| 73 65 20 69 66 20 28 20 | 77 69 6e 6e 6f 20 3c 20 |se if ( |winno < |
|00003f70| 4d 49 4e 57 49 4e 20 29 | 0a 09 09 77 69 6e 6e 6f |MINWIN )|...winno|
|00003f80| 20 3d 20 4d 41 58 57 49 | 4e 3b 0a 0a 2f 2a 09 47 | = MAXWI|N;../*.G|
|00003f90| 65 6e 65 72 61 74 65 20 | 61 20 77 69 6e 64 6f 77 |enerate |a window|
|00003fa0| 20 6e 61 6d 65 20 61 6e | 64 20 74 65 73 74 20 66 | name an|d test f|
|00003fb0| 6f 72 20 65 78 69 73 74 | 65 6e 63 65 2e 09 2a 2f |or exist|ence..*/|
|00003fc0| 0a 09 73 70 72 69 6e 74 | 66 28 20 77 69 6e 64 65 |..sprint|f( winde|
|00003fd0| 78 2c 20 22 2f 64 65 76 | 2f 77 25 64 22 2c 20 77 |x, "/dev|/w%d", w|
|00003fe0| 69 6e 6e 6f 20 29 3b 0a | 09 69 66 20 28 20 28 20 |inno );.|.if ( ( |
|00003ff0| 77 64 20 3d 20 6f 70 65 | 6e 28 20 77 69 6e 64 65 |wd = ope|n( winde|
|00004000| 78 2c 20 4f 5f 52 44 4f | 4e 4c 59 20 29 20 29 20 |x, O_RDO|NLY ) ) |
|00004010| 21 3d 20 2d 31 20 29 20 | 7b 0a 0a 2f 2a 09 49 74 |!= -1 ) |{../*.It|
|00004020| 20 65 78 69 73 74 73 2c | 20 6e 6f 77 20 6c 6f 6f | exists,| now loo|
|00004030| 6b 20 61 74 20 69 74 73 | 20 75 73 65 72 20 74 65 |k at its| user te|
|00004040| 78 74 20 69 6e 66 6f 2e | 20 20 54 68 69 73 20 69 |xt info.| This i|
|00004050| 73 20 77 68 65 72 65 20 | 22 49 6e 76 69 73 69 62 |s where |"Invisib|
|00004060| 6c 65 22 0a 09 67 65 74 | 73 20 73 6b 69 70 70 65 |le"..get|s skippe|
|00004070| 64 2e 09 2a 2f 0a 0a 09 | 09 77 69 6e 74 65 78 74 |d..*/...|.wintext|
|00004080| 2e 75 74 5f 6e 75 6d 20 | 3d 20 57 54 58 54 55 53 |.ut_num |= WTXTUS|
|00004090| 45 52 3b 0a 09 09 69 6f | 63 74 6c 28 20 77 64 2c |ER;...io|ctl( wd,|
|000040a0| 20 57 49 4f 43 47 45 54 | 54 45 58 54 2c 20 26 77 | WIOCGET|TEXT, &w|
|000040b0| 69 6e 74 65 78 74 20 29 | 3b 0a 09 09 69 66 20 28 |intext )|;...if (|
|000040c0| 20 73 74 72 63 6d 70 28 | 20 77 69 6e 74 65 78 74 | strcmp(| wintext|
|000040d0| 2e 75 74 5f 74 65 78 74 | 2c 20 22 49 6e 76 69 73 |.ut_text|, "Invis|
|000040e0| 69 62 6c 65 22 20 29 20 | 29 0a 09 09 09 72 65 74 |ible" ) |)....ret|
|000040f0| 75 72 6e 28 20 77 64 20 | 29 3b 0a 09 09 65 6c 73 |urn( wd |);...els|
|00004100| 65 0a 09 09 09 63 6c 6f | 73 65 28 20 77 64 20 29 |e....clo|se( wd )|
|00004110| 3b 0a 09 09 7d 0a 09 7d | 0a 7d 0a 0a 73 68 6f 77 |;...}..}|.}..show|
|00004120| 70 72 6f 63 73 28 29 0a | 0a 2f 2a 09 46 69 6e 64 |procs().|./*.Find|
|00004130| 20 74 68 65 20 70 72 6f | 63 65 73 73 20 74 61 62 | the pro|cess tab|
|00004140| 6c 65 3b 20 72 75 6e 20 | 74 68 72 6f 75 67 68 20 |le; run |through |
|00004150| 69 74 2c 20 6c 6f 6f 6b | 69 6e 67 20 75 70 20 74 |it, look|ing up t|
|00004160| 68 65 20 75 73 65 72 20 | 61 72 65 61 73 20 61 6e |he user |areas an|
|00004170| 64 0a 09 70 72 69 6e 74 | 69 6e 67 20 6f 75 74 20 |d..print|ing out |
|00004180| 73 6f 6d 65 20 64 61 74 | 61 20 6f 6e 20 65 61 63 |some dat|a on eac|
|00004190| 68 20 6f 6e 65 20 6f 6e | 20 74 68 65 20 66 6c 79 |h one on| the fly|
|000041a0| 2e 20 20 57 6f 72 6b 73 | 20 6c 69 6b 65 20 27 70 |. Works| like 'p|
|000041b0| 73 20 2d 65 66 27 0a 09 | 63 6f 6d 6d 61 6e 64 2e |s -ef'..|command.|
|000041c0| 09 2a 2f 0a 0a 7b 0a 73 | 74 72 75 63 74 20 70 72 |.*/..{.s|truct pr|
|000041d0| 6f 63 09 2a 70 70 74 3b | 0a 73 74 61 74 69 63 20 |oc.*ppt;|.static |
|000041e0| 73 74 72 75 63 74 20 6e | 6c 69 73 74 09 73 79 6d |struct n|list.sym|
|000041f0| 5b 33 5d 20 3d 20 7b 20 | 7b 20 22 74 75 68 69 22 |[3] = { |{ "tuhi"|
|00004200| 2c 20 7d 2c 20 7b 20 22 | 70 72 6f 63 22 2c 20 7d |, }, { "|proc", }|
|00004210| 2c 20 7b 20 28 63 68 61 | 72 20 2a 29 30 2c 20 7d |, { (cha|r *)0, }|
|00004220| 2c 20 7d 3b 0a 73 74 72 | 75 63 74 20 74 75 6e 61 |, };.str|uct tuna|
|00004230| 62 6c 65 09 74 75 6e 65 | 3b 0a 69 6e 74 09 6d 65 |ble.tune|;.int.me|
|00004240| 6d 2c 20 6b 6d 65 6d 3b | 0a 46 49 4c 45 09 2a 77 |m, kmem;|.FILE.*w|
|00004250| 70 3b 0a 0a 73 69 67 6e | 61 6c 28 20 53 49 47 41 |p;..sign|al( SIGA|
|00004260| 4c 52 4d 2c 20 6a 75 73 | 74 67 6f 6f 6e 20 29 3b |LRM, jus|tgoon );|
|00004270| 0a 0a 2f 2a 09 4f 70 65 | 6e 20 75 70 20 61 20 77 |../*.Ope|n up a w|
|00004280| 69 6e 64 6f 77 3b 20 61 | 6c 73 6f 20 6f 70 65 6e |indow; a|lso open|
|00004290| 20 74 68 65 20 6d 65 6d | 6f 72 79 20 64 65 76 69 | the mem|ory devi|
|000042a0| 63 65 73 20 66 6f 72 20 | 72 65 61 64 69 6e 67 2e |ces for |reading.|
|000042b0| 09 2a 2f 0a 0a 77 70 20 | 3d 20 66 6f 70 65 6e 28 |.*/..wp |= fopen(|
|000042c0| 20 22 2f 64 65 76 2f 77 | 69 6e 64 6f 77 22 2c 20 | "/dev/w|indow", |
|000042d0| 22 77 22 20 29 3b 0a 6d | 65 6d 20 3d 20 6f 70 65 |"w" );.m|em = ope|
|000042e0| 6e 28 20 22 2f 64 65 76 | 2f 6d 65 6d 22 2c 20 4f |n( "/dev|/mem", O|
|000042f0| 5f 52 44 4f 4e 4c 59 20 | 29 3b 0a 6b 6d 65 6d 20 |_RDONLY |);.kmem |
|00004300| 3d 20 6f 70 65 6e 28 20 | 22 2f 64 65 76 2f 6b 6d |= open( |"/dev/km|
|00004310| 65 6d 22 2c 20 4f 5f 52 | 44 4f 4e 4c 59 20 29 3b |em", O_R|DONLY );|
|00004320| 0a 0a 2f 2a 09 46 69 6e | 64 20 74 68 65 20 74 75 |../*.Fin|d the tu|
|00004330| 6e 61 62 6c 65 20 70 61 | 72 61 6d 65 74 65 72 73 |nable pa|rameters|
|00004340| 2c 20 74 6f 20 67 65 74 | 20 74 68 65 20 6d 61 78 |, to get| the max|
|00004350| 69 6d 75 6d 20 6e 75 6d | 62 65 72 20 6f 66 20 70 |imum num|ber of p|
|00004360| 72 6f 63 65 73 73 65 73 | 3b 20 61 6e 64 0a 09 74 |rocesses|; and..t|
|00004370| 68 65 20 70 72 6f 63 65 | 73 73 20 74 61 62 6c 65 |he proce|ss table|
|00004380| 2e 09 2a 2f 0a 0a 6e 6c | 69 73 74 28 20 22 2f 75 |..*/..nl|ist( "/u|
|00004390| 6e 69 78 22 2c 20 73 79 | 6d 20 29 3b 0a 64 6d 65 |nix", sy|m );.dme|
|000043a0| 6d 63 6f 70 79 28 20 6b | 6d 65 6d 2c 20 28 63 68 |mcopy( k|mem, (ch|
|000043b0| 61 72 20 2a 29 26 74 75 | 6e 65 2c 20 28 6c 6f 6e |ar *)&tu|ne, (lon|
|000043c0| 67 29 28 73 79 6d 5b 30 | 5d 2e 6e 5f 76 61 6c 75 |g)(sym[0|].n_valu|
|000043d0| 65 29 2c 20 28 6c 6f 6e | 67 29 73 69 7a 65 6f 66 |e), (lon|g)sizeof|
|000043e0| 28 20 74 75 6e 65 20 29 | 20 29 3b 0a 64 6d 65 6d |( tune )| );.dmem|
|000043f0| 63 6f 70 79 28 20 6b 6d | 65 6d 2c 20 28 63 68 61 |copy( km|em, (cha|
|00004400| 72 20 2a 29 26 70 70 74 | 2c 20 28 6c 6f 6e 67 29 |r *)&ppt|, (long)|
|00004410| 28 73 79 6d 5b 31 5d 2e | 6e 5f 76 61 6c 75 65 29 |(sym[1].|n_value)|
|00004420| 2c 20 28 6c 6f 6e 67 29 | 73 69 7a 65 6f 66 28 20 |, (long)|sizeof( |
|00004430| 70 70 74 20 29 20 29 3b | 0a 0a 2f 2a 09 52 75 6e |ppt ) );|../*.Run|
|00004440| 20 74 68 72 6f 75 67 68 | 20 74 68 65 20 70 72 6f | through| the pro|
|00004450| 63 65 73 73 20 74 61 62 | 6c 65 2e 09 2a 2f 0a 0a |cess tab|le..*/..|
|00004460| 66 70 72 69 6e 74 66 28 | 20 77 70 2c 20 22 52 45 |fprintf(| wp, "RE|
|00004470| 41 4c 20 55 49 44 20 45 | 46 45 43 54 20 49 44 20 |AL UID E|FECT ID |
|00004480| 20 50 49 44 20 20 20 50 | 50 49 44 20 53 54 41 52 | PID P|PID STAR|
|00004490| 54 20 54 49 4d 45 20 20 | 20 20 54 54 59 20 20 43 |T TIME | TTY C|
|000044a0| 4f 4d 4d 41 4e 44 5c 6e | 22 20 29 3b 0a 77 68 69 |OMMAND\n|" );.whi|
|000044b0| 6c 65 20 28 20 74 75 6e | 65 2e 6e 70 72 6f 63 2d |le ( tun|e.nproc-|
|000044c0| 2d 20 29 0a 09 70 72 69 | 6e 74 70 72 6f 63 28 20 |- )..pri|ntproc( |
|000044d0| 77 70 2c 20 6b 6d 65 6d | 2c 20 6d 65 6d 2c 20 70 |wp, kmem|, mem, p|
|000044e0| 70 74 2b 2b 20 29 3b 0a | 0a 2f 2a 09 45 6d 70 74 |pt++ );.|./*.Empt|
|000044f0| 79 20 74 68 65 20 6f 75 | 74 70 75 74 20 62 75 66 |y the ou|tput buf|
|00004500| 66 65 72 2c 20 73 6c 65 | 65 70 20 74 6f 20 61 6c |fer, sle|ep to al|
|00004510| 6c 6f 77 20 69 74 20 74 | 6f 20 62 65 20 72 65 61 |low it t|o be rea|
|00004520| 64 2c 20 61 6e 64 20 63 | 6c 6f 73 65 20 75 70 20 |d, and c|lose up |
|00004530| 74 68 65 0a 09 65 78 74 | 72 61 20 77 69 6e 64 6f |the..ext|ra windo|
|00004540| 77 20 61 6e 64 20 72 65 | 74 75 72 6e 2e 09 2a 2f |w and re|turn..*/|
|00004550| 0a 0a 66 66 6c 75 73 68 | 28 20 77 70 20 29 3b 0a |..fflush|( wp );.|
|00004560| 73 6c 65 65 70 28 20 57 | 48 4f 53 4c 45 45 50 20 |sleep( W|HOSLEEP |
|00004570| 29 3b 0a 66 63 6c 6f 73 | 65 28 20 77 70 20 29 3b |);.fclos|e( wp );|
|00004580| 0a 73 69 67 6e 61 6c 28 | 20 53 49 47 41 4c 52 4d |.signal(| SIGALRM|
|00004590| 2c 20 53 49 47 5f 49 47 | 4e 20 29 3b 0a 7d 0a 0a |, SIG_IG|N );.}..|
|000045a0| 73 68 6f 77 75 74 6d 70 | 28 29 0a 0a 2f 2a 09 52 |showutmp|()../*.R|
|000045b0| 75 6e 20 74 68 72 6f 75 | 67 68 20 74 68 65 20 75 |un throu|gh the u|
|000045c0| 74 6d 70 20 66 69 6c 65 | 2e 20 20 55 73 65 64 20 |tmp file|. Used |
|000045d0| 74 6f 20 67 69 76 65 20 | 61 6e 20 69 64 65 61 20 |to give |an idea |
|000045e0| 6f 66 20 73 79 73 74 65 | 6d 20 61 63 74 69 76 69 |of syste|m activi|
|000045f0| 74 79 2e 09 2a 2f 0a 0a | 7b 0a 73 74 72 75 63 74 |ty..*/..|{.struct|
|00004600| 09 75 74 6d 70 20 2a 75 | 74 2c 20 2a 67 65 74 75 |.utmp *u|t, *getu|
|00004610| 74 65 6e 74 28 29 3b 0a | 46 49 4c 45 09 2a 77 70 |tent();.|FILE.*wp|
|00004620| 3b 0a 0a 73 69 67 6e 61 | 6c 28 20 53 49 47 41 4c |;..signa|l( SIGAL|
|00004630| 52 4d 2c 20 6a 75 73 74 | 67 6f 6f 6e 20 29 3b 0a |RM, just|goon );.|
|00004640| 77 70 20 3d 20 66 6f 70 | 65 6e 28 20 22 2f 64 65 |wp = fop|en( "/de|
|00004650| 76 2f 77 69 6e 64 6f 77 | 22 2c 20 22 77 22 20 29 |v/window|", "w" )|
|00004660| 3b 0a 0a 2f 2a 09 47 6f | 20 74 68 72 6f 75 67 68 |;../*.Go| through|
|00004670| 20 75 74 6d 70 2e 20 20 | 53 68 6f 77 20 6c 6f 67 | utmp. |Show log|
|00004680| 69 6e 20 61 6e 64 20 75 | 73 65 72 20 70 72 6f 63 |in and u|ser proc|
|00004690| 65 73 73 65 73 2e 09 2a | 2f 0a 0a 77 68 69 6c 65 |esses..*|/..while|
|000046a0| 20 28 20 28 20 75 74 20 | 3d 20 67 65 74 75 74 65 | ( ( ut |= getute|
|000046b0| 6e 74 28 29 20 29 20 21 | 3d 20 4e 55 4c 4c 20 29 |nt() ) !|= NULL )|
|000046c0| 20 7b 0a 09 73 77 69 74 | 63 68 20 28 20 28 69 6e | {..swit|ch ( (in|
|000046d0| 74 29 20 75 74 2d 3e 75 | 74 5f 74 79 70 65 20 29 |t) ut->u|t_type )|
|000046e0| 20 7b 0a 09 09 63 61 73 | 65 20 55 53 45 52 5f 50 | {...cas|e USER_P|
|000046f0| 52 4f 43 45 53 53 20 3a | 20 0a 09 09 63 61 73 65 |ROCESS :| ...case|
|00004700| 20 4c 4f 47 49 4e 5f 50 | 52 4f 43 45 53 53 20 3a | LOGIN_P|ROCESS :|
|00004710| 20 73 68 6f 77 75 74 65 | 6e 74 28 20 77 70 2c 20 | showute|nt( wp, |
|00004720| 75 74 20 29 3b 0a 09 09 | 64 65 66 61 75 6c 74 20 |ut );...|default |
|00004730| 3a 20 62 72 65 61 6b 3b | 0a 09 09 7d 0a 09 7d 0a |: break;|...}..}.|
|00004740| 65 6e 64 75 74 65 6e 74 | 28 29 3b 0a 66 70 72 69 |endutent|();.fpri|
|00004750| 6e 74 66 28 20 77 70 2c | 20 22 5c 6e 22 20 29 3b |ntf( wp,| "\n" );|
|00004760| 0a 66 66 6c 75 73 68 28 | 20 77 70 20 29 3b 0a 73 |.fflush(| wp );.s|
|00004770| 6c 65 65 70 28 20 57 48 | 4f 53 4c 45 45 50 20 29 |leep( WH|OSLEEP )|
|00004780| 3b 0a 66 63 6c 6f 73 65 | 28 20 77 70 20 29 3b 0a |;.fclose|( wp );.|
|00004790| 73 69 67 6e 61 6c 28 20 | 53 49 47 41 4c 52 4d 2c |signal( |SIGALRM,|
|000047a0| 20 53 49 47 5f 49 47 4e | 20 29 3b 0a 7d 0a 0a 73 | SIG_IGN| );.}..s|
|000047b0| 68 6f 77 64 69 72 28 20 | 64 69 72 6e 61 6d 65 2c |howdir( |dirname,|
|000047c0| 20 6d 61 73 6b 20 29 0a | 63 68 61 72 09 2a 64 69 | mask ).|char.*di|
|000047d0| 72 6e 61 6d 65 2c 20 2a | 6d 61 73 6b 3b 0a 0a 2f |rname, *|mask;../|
|000047e0| 2a 09 44 69 73 70 6c 61 | 79 20 74 68 65 20 63 6f |*.Displa|y the co|
|000047f0| 6e 74 65 6e 74 73 20 6f | 66 20 61 20 64 69 72 65 |ntents o|f a dire|
|00004800| 63 74 6f 72 79 2e 20 20 | 55 73 65 20 27 6d 61 73 |ctory. |Use 'mas|
|00004810| 6b 27 20 74 6f 20 73 70 | 65 63 69 66 79 20 61 20 |k' to sp|ecify a |
|00004820| 66 69 6c 65 20 70 72 65 | 66 69 78 0a 09 73 74 72 |file pre|fix..str|
|00004830| 69 6e 67 20 74 6f 20 6c | 6f 6f 6b 20 66 6f 72 3b |ing to l|ook for;|
|00004840| 20 75 73 65 66 75 6c 20 | 66 6f 72 20 66 69 6e 64 | useful |for find|
|00004850| 69 6e 67 20 27 4c 43 4b | 2e 2e 27 20 66 69 6c 65 |ing 'LCK|..' file|
|00004860| 73 2e 09 2a 2f 0a 0a 7b | 0a 44 49 52 09 2a 64 69 |s..*/..{|.DIR.*di|
|00004870| 72 70 3b 0a 73 74 72 75 | 63 74 09 64 69 72 65 63 |rp;.stru|ct.direc|
|00004880| 74 79 20 2a 64 69 72 3b | 0a 46 49 4c 45 09 2a 77 |ty *dir;|.FILE.*w|
|00004890| 70 3b 0a 69 6e 74 09 6d | 6c 65 6e 3b 0a 0a 73 69 |p;.int.m|len;..si|
|000048a0| 67 6e 61 6c 28 20 53 49 | 47 41 4c 52 4d 2c 20 6a |gnal( SI|GALRM, j|
|000048b0| 75 73 74 67 6f 6f 6e 20 | 29 3b 0a 77 70 20 3d 20 |ustgoon |);.wp = |
|000048c0| 66 6f 70 65 6e 28 20 22 | 2f 64 65 76 2f 77 69 6e |fopen( "|/dev/win|
|000048d0| 64 6f 77 22 2c 20 22 77 | 22 20 29 3b 0a 64 69 72 |dow", "w|" );.dir|
|000048e0| 70 20 3d 20 6f 70 65 6e | 64 69 72 28 20 64 69 72 |p = open|dir( dir|
|000048f0| 6e 61 6d 65 20 29 3b 0a | 6d 6c 65 6e 20 3d 20 73 |name );.|mlen = s|
|00004900| 74 72 6c 65 6e 28 20 6d | 61 73 6b 20 29 3b 0a 77 |trlen( m|ask );.w|
|00004910| 68 69 6c 65 20 28 20 28 | 20 64 69 72 20 3d 20 72 |hile ( (| dir = r|
|00004920| 65 61 64 64 69 72 28 20 | 64 69 72 70 20 29 20 29 |eaddir( |dirp ) )|
|00004930| 20 21 3d 20 4e 55 4c 4c | 20 29 20 7b 0a 09 69 66 | != NULL| ) {..if|
|00004940| 20 28 20 28 20 64 69 72 | 2d 3e 64 5f 6e 61 6d 65 | ( ( dir|->d_name|
|00004950| 5b 30 5d 20 21 3d 20 27 | 2e 27 20 29 20 26 26 20 |[0] != '|.' ) && |
|00004960| 28 20 21 73 74 72 6e 63 | 6d 70 28 20 64 69 72 2d |( !strnc|mp( dir-|
|00004970| 3e 64 5f 6e 61 6d 65 2c | 20 6d 61 73 6b 2c 20 6d |>d_name,| mask, m|
|00004980| 6c 65 6e 20 29 20 29 20 | 29 7b 0a 09 09 66 70 72 |len ) ) |){...fpr|
|00004990| 69 6e 74 66 28 20 77 70 | 2c 20 22 5c 6e 25 73 25 |intf( wp|, "\n%s%|
|000049a0| 73 22 2c 20 64 69 72 6e | 61 6d 65 2c 20 64 69 72 |s", dirn|ame, dir|
|000049b0| 2d 3e 64 5f 6e 61 6d 65 | 20 29 3b 0a 09 09 7d 0a |->d_name| );...}.|
|000049c0| 09 7d 0a 63 6c 6f 73 65 | 64 69 72 28 20 64 69 72 |.}.close|dir( dir|
|000049d0| 70 20 29 3b 0a 66 70 72 | 69 6e 74 66 28 20 77 70 |p );.fpr|intf( wp|
|000049e0| 2c 20 22 5c 6e 22 20 29 | 3b 0a 66 66 6c 75 73 68 |, "\n" )|;.fflush|
|000049f0| 28 20 77 70 20 29 3b 0a | 73 6c 65 65 70 28 20 57 |( wp );.|sleep( W|
|00004a00| 48 4f 53 4c 45 45 50 20 | 29 3b 0a 66 63 6c 6f 73 |HOSLEEP |);.fclos|
|00004a10| 65 28 20 77 70 20 29 3b | 0a 73 69 67 6e 61 6c 28 |e( wp );|.signal(|
|00004a20| 20 53 49 47 41 4c 52 4d | 2c 20 53 49 47 5f 49 47 | SIGALRM|, SIG_IG|
|00004a30| 4e 20 29 3b 0a 7d 0a 0a | 73 68 6f 77 66 73 79 73 |N );.}..|showfsys|
|00004a40| 28 29 0a 0a 2f 2a 09 53 | 68 6f 77 20 74 68 65 20 |()../*.S|how the |
|00004a50| 72 6f 6f 74 20 66 69 6c | 65 20 73 79 73 74 65 6d |root fil|e system|
|00004a60| 20 73 74 61 74 69 73 74 | 69 63 73 2e 20 20 52 65 | statist|ics. Re|
|00004a70| 61 64 20 74 68 65 20 73 | 75 70 65 72 62 6c 6f 63 |ad the s|uperbloc|
|00004a80| 6b 20 69 6e 20 61 6e 64 | 20 67 65 74 0a 09 66 72 |k in and| get..fr|
|00004a90| 65 65 20 62 6c 6f 63 6b | 73 2c 20 74 6f 74 61 6c |ee block|s, total|
|00004aa0| 20 62 6c 6f 63 6b 73 2c | 20 61 6e 64 20 66 72 65 | blocks,| and fre|
|00004ab0| 65 20 69 6e 6f 64 65 73 | 20 66 72 6f 6d 20 69 74 |e inodes| from it|
|00004ac0| 2e 20 20 41 6c 73 6f 20 | 64 69 73 70 6c 61 79 20 |. Also |display |
|00004ad0| 74 68 65 0a 09 66 72 65 | 65 73 70 61 63 65 20 61 |the..fre|espace a|
|00004ae0| 73 20 61 20 70 65 72 63 | 65 6e 74 61 67 65 2e 09 |s a perc|entage..|
|00004af0| 2a 2f 0a 0a 7b 0a 69 6e | 74 20 72 70 3b 0a 73 74 |*/..{.in|t rp;.st|
|00004b00| 72 75 63 74 20 66 69 6c | 73 79 73 20 66 73 3b 0a |ruct fil|sys fs;.|
|00004b10| 0a 73 69 67 6e 61 6c 28 | 20 53 49 47 41 4c 52 4d |.signal(| SIGALRM|
|00004b20| 2c 20 6a 75 73 74 67 6f | 6f 6e 20 29 3b 0a 72 70 |, justgo|on );.rp|
|00004b30| 20 3d 20 6f 70 65 6e 28 | 20 22 2f 64 65 76 2f 72 | = open(| "/dev/r|
|00004b40| 66 70 30 30 32 22 2c 20 | 4f 5f 52 44 4f 4e 4c 59 |fp002", |O_RDONLY|
|00004b50| 20 29 3b 0a 6c 73 65 65 | 6b 28 20 72 70 2c 20 35 | );.lsee|k( rp, 5|
|00004b60| 31 32 2c 20 30 20 29 3b | 0a 72 65 61 64 28 20 72 |12, 0 );|.read( r|
|00004b70| 70 2c 20 26 66 73 2c 20 | 73 69 7a 65 6f 66 28 20 |p, &fs, |sizeof( |
|00004b80| 66 73 20 29 20 29 3b 0a | 63 6c 6f 73 65 28 20 72 |fs ) );.|close( r|
|00004b90| 70 20 29 3b 0a 70 72 69 | 6e 74 66 28 20 22 5c 6e |p );.pri|ntf( "\n|
|00004ba0| 52 6f 6f 74 3a 20 25 6c | 64 4b 20 66 72 65 65 20 |Root: %l|dK free |
|00004bb0| 25 6c 64 4b 20 74 6f 74 | 61 6c 20 25 64 25 25 20 |%ldK tot|al %d%% |
|00004bc0| 66 72 65 65 20 25 64 20 | 69 6e 6f 64 65 73 22 2c |free %d |inodes",|
|00004bd0| 20 66 73 2e 73 5f 74 66 | 72 65 65 2c 0a 09 66 73 | fs.s_tf|ree,..fs|
|00004be0| 2e 73 5f 66 73 69 7a 65 | 2c 20 28 69 6e 74 29 28 |.s_fsize|, (int)(|
|00004bf0| 31 30 30 2e 30 2a 28 66 | 6c 6f 61 74 29 28 66 73 |100.0*(f|loat)(fs|
|00004c00| 2e 73 5f 74 66 72 65 65 | 29 2f 28 66 6c 6f 61 74 |.s_tfree|)/(float|
|00004c10| 29 28 66 73 2e 73 5f 66 | 73 69 7a 65 29 29 2c 0a |)(fs.s_f|size)),.|
|00004c20| 09 66 73 2e 73 5f 74 69 | 6e 6f 64 65 20 29 3b 0a |.fs.s_ti|node );.|
|00004c30| 66 66 6c 75 73 68 28 20 | 73 74 64 6f 75 74 20 29 |fflush( |stdout )|
|00004c40| 3b 0a 73 6c 65 65 70 28 | 20 35 20 29 3b 0a 70 72 |;.sleep(| 5 );.pr|
|00004c50| 69 6e 74 66 28 20 22 5c | 6e 22 20 29 3b 0a 73 69 |intf( "\|n" );.si|
|00004c60| 67 6e 61 6c 28 20 53 49 | 47 41 4c 52 4d 2c 20 53 |gnal( SI|GALRM, S|
|00004c70| 49 47 5f 49 47 4e 20 29 | 3b 0a 7d 0a 0a 68 65 6c |IG_IGN )|;.}..hel|
|00004c80| 70 28 29 0a 0a 2f 2a 09 | 50 72 69 6e 74 20 61 20 |p()../*.|Print a |
|00004c90| 68 65 6c 70 20 6d 65 73 | 73 61 67 65 20 6f 6e 20 |help mes|sage on |
|00004ca0| 6b 65 79 20 75 73 61 67 | 65 2e 09 2a 2f 0a 0a 7b |key usag|e..*/..{|
|00004cb0| 0a 46 49 4c 45 09 2a 77 | 70 3b 0a 0a 73 69 67 6e |.FILE.*w|p;..sign|
|00004cc0| 61 6c 28 20 53 49 47 41 | 4c 52 4d 2c 20 6a 75 73 |al( SIGA|LRM, jus|
|00004cd0| 74 67 6f 6f 6e 20 29 3b | 0a 77 70 20 3d 20 66 6f |tgoon );|.wp = fo|
|00004ce0| 70 65 6e 28 20 22 2f 64 | 65 76 2f 77 69 6e 64 6f |pen( "/d|ev/windo|
|00004cf0| 77 22 2c 20 22 77 22 20 | 29 3b 0a 66 70 72 69 6e |w", "w" |);.fprin|
|00004d00| 74 66 28 20 77 70 2c 20 | 22 5c 74 2d 20 50 68 6f |tf( wp, |"\t- Pho|
|00004d10| 6e 65 20 6c 69 6e 65 20 | 73 74 61 74 65 73 5c 6e |ne line |states\n|
|00004d20| 5c 74 5c 74 6f 20 49 64 | 6c 65 20 2d 20 63 6f 6d |\t\to Id|le - com|
|00004d30| 70 6c 65 74 65 6c 79 20 | 66 72 65 65 20 6c 69 6e |pletely |free lin|
|00004d40| 65 5c 6e 22 20 29 3b 0a | 66 70 72 69 6e 74 66 28 |e\n" );.|fprintf(|
|00004d50| 20 77 70 2c 20 22 5c 74 | 5c 74 6f 20 41 6e 73 72 | wp, "\t|\to Ansr|
|00004d60| 20 2d 20 63 6f 6d 70 75 | 74 65 72 20 61 6e 73 77 | - compu|ter answ|
|00004d70| 65 72 69 6e 67 20 6c 69 | 6e 65 20 28 67 65 74 74 |ering li|ne (gett|
|00004d80| 79 20 6a 6f 62 29 5c 6e | 22 20 29 3b 0a 66 70 72 |y job)\n|" );.fpr|
|00004d90| 69 6e 74 66 28 20 77 70 | 2c 20 22 5c 74 5c 74 6f |intf( wp|, "\t\to|
|00004da0| 20 4d 61 63 68 20 2d 20 | 69 6e 63 6f 6d 69 6e 67 | Mach - |incoming|
|00004db0| 20 6d 61 63 68 69 6e 65 | 5c 6e 5c 74 5c 74 6f 20 | machine|\n\t\to |
|00004dc0| 55 73 65 72 20 2d 20 69 | 6e 63 6f 6d 69 6e 67 20 |User - i|ncoming |
|00004dd0| 75 73 65 72 5c 6e 22 20 | 29 3b 0a 66 70 72 69 6e |user\n" |);.fprin|
|00004de0| 74 66 28 20 77 70 2c 20 | 22 5c 74 5c 74 6f 20 43 |tf( wp, |"\t\to C|
|00004df0| 61 6c 6c 20 2d 20 61 6e | 79 20 6f 75 74 62 6f 75 |all - an|y outbou|
|00004e00| 6e 64 5c 6e 5c 74 2d 20 | 42 6f 6f 74 20 64 61 74 |nd\n\t- |Boot dat|
|00004e10| 65 20 61 6e 64 20 74 69 | 6d 65 5c 6e 22 20 29 3b |e and ti|me\n" );|
|00004e20| 0a 66 70 72 69 6e 74 66 | 28 20 77 70 2c 20 22 5c |.fprintf|( wp, "\|
|00004e30| 74 2d 20 43 75 72 72 65 | 6e 74 20 72 75 6e 20 6c |t- Curre|nt run l|
|00004e40| 65 76 65 6c 5c 6e 5c 74 | 2d 20 43 75 72 72 65 6e |evel\n\t|- Curren|
|00004e50| 74 20 64 61 74 65 20 61 | 6e 64 20 74 69 6d 65 5c |t date a|nd time\|
|00004e60| 6e 5c 74 2d 20 4e 75 6d | 62 65 72 20 6f 66 20 75 |n\t- Num|ber of u|
|00004e70| 73 65 72 73 5c 6e 22 20 | 29 3b 0a 66 70 72 69 6e |sers\n" |);.fprin|
|00004e80| 74 66 28 20 77 70 2c 20 | 22 5c 74 57 68 65 6e 20 |tf( wp, |"\tWhen |
|00004e90| 53 75 73 70 65 6e 64 20 | 69 73 20 68 69 74 2c 20 |Suspend |is hit, |
|00004ea0| 69 74 20 6d 61 6b 65 73 | 20 74 68 65 20 6e 65 78 |it makes| the nex|
|00004eb0| 74 20 77 69 6e 64 6f 77 | 20 63 75 72 72 65 6e 74 |t window| current|
|00004ec0| 3b 20 52 65 73 75 6d 65 | 5c 6e 22 20 29 3b 0a 66 |; Resume|\n" );.f|
|00004ed0| 70 72 69 6e 74 66 28 20 | 77 70 2c 20 22 5c 74 6d |printf( |wp, "\tm|
|00004ee0| 61 6b 65 73 20 74 68 65 | 20 6c 61 73 74 20 77 69 |akes the| last wi|
|00004ef0| 6e 64 6f 77 20 63 75 72 | 72 65 6e 74 2e 5c 6e 5c |ndow cur|rent.\n\|
|00004f00| 6e 22 20 29 3b 0a 66 70 | 72 69 6e 74 66 28 20 77 |n" );.fp|rintf( w|
|00004f10| 70 2c 20 22 5c 74 54 68 | 65 20 66 6f 6c 6c 6f 77 |p, "\tTh|e follow|
|00004f20| 69 6e 67 20 66 75 6e 63 | 74 69 6f 6e 73 20 61 72 |ing func|tions ar|
|00004f30| 65 20 6d 61 70 70 65 64 | 20 74 6f 20 74 68 65 20 |e mapped| to the |
|00004f40| 66 75 6e 63 74 69 6f 6e | 20 6b 65 79 73 3a 5c 6e |function| keys:\n|
|00004f50| 22 20 29 3b 0a 66 70 72 | 69 6e 74 66 28 20 77 70 |" );.fpr|intf( wp|
|00004f60| 2c 20 22 5c 74 53 68 69 | 66 74 2d 46 31 3a 20 20 |, "\tShi|ft-F1: |
|00004f70| 70 72 6f 63 65 73 73 20 | 64 69 73 70 6c 61 79 2c |process |display,|
|00004f80| 20 73 69 6d 69 6c 61 72 | 20 74 6f 20 27 70 73 20 | similar| to 'ps |
|00004f90| 2d 65 66 27 5c 6e 22 20 | 29 3b 0a 66 70 72 69 6e |-ef'\n" |);.fprin|
|00004fa0| 74 66 28 20 77 70 2c 20 | 22 5c 74 53 68 69 66 74 |tf( wp, |"\tShift|
|00004fb0| 2d 46 32 3a 20 20 75 74 | 6d 70 20 64 69 73 70 6c |-F2: ut|mp displ|
|00004fc0| 61 79 2c 20 6c 69 6b 65 | 20 27 77 68 6f 27 5c 6e |ay, like| 'who'\n|
|00004fd0| 22 20 29 3b 0a 66 70 72 | 69 6e 74 66 28 20 77 70 |" );.fpr|intf( wp|
|00004fe0| 2c 20 22 5c 74 53 68 69 | 66 74 2d 46 33 3a 20 20 |, "\tShi|ft-F3: |
|00004ff0| 6c 69 73 74 73 20 55 55 | 43 50 20 4c 43 4b 2e 2e |lists UU|CP LCK..|
|00005000| 20 66 69 6c 65 73 2c 20 | 69 66 20 61 6e 79 5c 6e | files, |if any\n|
|00005010| 22 20 29 3b 0a 66 70 72 | 69 6e 74 66 28 20 77 70 |" );.fpr|intf( wp|
|00005020| 2c 20 22 5c 74 53 68 69 | 66 74 2d 46 34 3a 20 20 |, "\tShi|ft-F4: |
|00005030| 64 69 72 65 63 74 6f 72 | 79 20 6f 66 20 2f 75 73 |director|y of /us|
|00005040| 72 2f 6d 61 69 6c 5c 6e | 22 20 29 3b 0a 66 70 72 |r/mail\n|" );.fpr|
|00005050| 69 6e 74 66 28 20 77 70 | 2c 20 22 5c 74 53 68 69 |intf( wp|, "\tShi|
|00005060| 66 74 2d 46 35 3a 20 20 | 52 6f 6f 74 20 66 69 6c |ft-F5: |Root fil|
|00005070| 65 73 79 73 74 65 6d 20 | 66 72 65 65 73 70 61 63 |esystem |freespac|
|00005080| 65 20 61 6e 64 20 66 72 | 65 65 20 69 6e 6f 64 65 |e and fr|ee inode|
|00005090| 73 5c 6e 22 20 29 3b 0a | 66 70 72 69 6e 74 66 28 |s\n" );.|fprintf(|
|000050a0| 20 77 70 2c 20 22 5c 74 | 53 68 69 66 74 2d 46 36 | wp, "\t|Shift-F6|
|000050b0| 3a 20 20 6c 69 73 74 73 | 20 55 55 43 50 20 43 2e |: lists| UUCP C.|
|000050c0| 20 66 69 6c 65 73 2c 20 | 69 66 20 61 6e 79 5c 6e | files, |if any\n|
|000050d0| 22 20 29 3b 0a 66 70 72 | 69 6e 74 66 28 20 77 70 |" );.fpr|intf( wp|
|000050e0| 2c 20 22 5c 74 53 68 69 | 66 74 2d 46 37 3a 20 20 |, "\tShi|ft-F7: |
|000050f0| 6c 69 73 74 73 20 55 55 | 43 50 20 58 2e 20 66 69 |lists UU|CP X. fi|
|00005100| 6c 65 73 2c 20 69 66 20 | 61 6e 79 5c 6e 22 20 29 |les, if |any\n" )|
|00005110| 3b 0a 66 70 72 69 6e 74 | 66 28 20 77 70 2c 20 22 |;.fprint|f( wp, "|
|00005120| 5c 74 53 68 69 66 74 2d | 46 38 3a 20 20 64 69 72 |\tShift-|F8: dir|
|00005130| 65 63 74 6f 72 79 20 6f | 66 20 2f 75 73 72 2f 73 |ectory o|f /usr/s|
|00005140| 70 6f 6f 6c 2f 75 75 63 | 70 5c 6e 22 20 29 3b 0a |pool/uuc|p\n" );.|
|00005150| 66 70 72 69 6e 74 66 28 | 20 77 70 2c 20 22 5c 74 |fprintf(| wp, "\t|
|00005160| 53 68 69 66 74 2d 50 72 | 69 6e 74 3a 20 20 64 69 |Shift-Pr|int: di|
|00005170| 73 70 6c 61 79 20 74 68 | 69 73 20 6c 69 73 74 22 |splay th|is list"|
|00005180| 20 29 3b 0a 66 66 6c 75 | 73 68 28 20 77 70 20 29 | );.fflu|sh( wp )|
|00005190| 3b 0a 73 6c 65 65 70 28 | 20 57 48 4f 53 4c 45 45 |;.sleep(| WHOSLEE|
|000051a0| 50 20 29 3b 0a 66 63 6c | 6f 73 65 28 20 77 70 20 |P );.fcl|ose( wp |
|000051b0| 29 3b 0a 73 69 67 6e 61 | 6c 28 20 53 49 47 41 4c |);.signa|l( SIGAL|
|000051c0| 52 4d 2c 20 53 49 47 5f | 49 47 4e 20 29 3b 0a 7d |RM, SIG_|IGN );.}|
|000051d0| 0a 0a 64 6d 65 6d 63 6f | 70 79 28 20 64 65 76 6d |..dmemco|py( devm|
|000051e0| 65 6d 2c 20 62 75 66 2c | 20 6d 65 6d 6c 6f 63 2c |em, buf,| memloc,|
|000051f0| 20 6e 62 79 74 65 73 20 | 29 0a 69 6e 74 09 64 65 | nbytes |).int.de|
|00005200| 76 6d 65 6d 3b 0a 63 68 | 61 72 09 2a 62 75 66 3b |vmem;.ch|ar.*buf;|
|00005210| 0a 6c 6f 6e 67 09 6d 65 | 6d 6c 6f 63 2c 20 6e 62 |.long.me|mloc, nb|
|00005220| 79 74 65 73 3b 0a 0a 2f | 2a 09 52 65 61 64 20 66 |ytes;../|*.Read f|
|00005230| 72 6f 6d 20 61 20 6d 65 | 6d 6f 72 79 20 64 65 76 |rom a me|mory dev|
|00005240| 69 63 65 20 69 6e 74 6f | 20 61 20 6c 6f 63 61 6c |ice into| a local|
|00005250| 20 62 75 66 66 65 72 2e | 09 2a 2f 0a 0a 7b 0a 6c | buffer.|.*/..{.l|
|00005260| 73 65 65 6b 28 20 64 65 | 76 6d 65 6d 2c 20 6d 65 |seek( de|vmem, me|
|00005270| 6d 6c 6f 63 2c 20 30 20 | 29 3b 0a 72 65 61 64 28 |mloc, 0 |);.read(|
|00005280| 20 64 65 76 6d 65 6d 2c | 20 62 75 66 2c 20 28 75 | devmem,| buf, (u|
|00005290| 6e 73 69 67 6e 65 64 29 | 6e 62 79 74 65 73 20 29 |nsigned)|nbytes )|
|000052a0| 3b 20 0a 7d 0a 0a 70 72 | 69 6e 74 70 72 6f 63 28 |; .}..pr|intproc(|
|000052b0| 20 77 70 2c 20 6b 6d 65 | 6d 2c 20 6d 65 6d 2c 20 | wp, kme|m, mem, |
|000052c0| 70 70 74 20 29 0a 46 49 | 4c 45 09 2a 77 70 3b 0a |ppt ).FI|LE.*wp;.|
|000052d0| 69 6e 74 09 6b 6d 65 6d | 2c 20 6d 65 6d 3b 0a 73 |int.kmem|, mem;.s|
|000052e0| 74 72 75 63 74 20 70 72 | 6f 63 09 2a 70 70 74 3b |truct pr|oc.*ppt;|
|000052f0| 0a 0a 2f 2a 09 47 65 74 | 20 61 20 70 72 6f 63 65 |../*.Get| a proce|
|00005300| 73 73 20 74 61 62 6c 65 | 20 65 6e 74 72 79 20 61 |ss table| entry a|
|00005310| 6e 64 20 70 72 69 6e 74 | 20 73 6f 6d 65 20 6f 66 |nd print| some of|
|00005320| 20 74 68 65 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e | the inf|ormation|
|00005330| 20 66 72 6f 6d 20 69 74 | 2e 09 2a 2f 0a 0a 7b 0a | from it|..*/..{.|
|00005340| 73 74 72 75 63 74 20 70 | 72 6f 63 20 70 3b 0a 73 |struct p|roc p;.s|
|00005350| 74 72 75 63 74 20 75 73 | 65 72 09 75 3b 0a 73 74 |truct us|er.u;.st|
|00005360| 72 75 63 74 20 70 61 73 | 73 77 64 09 2a 70 77 64 |ruct pas|swd.*pwd|
|00005370| 2c 20 2a 67 65 74 70 77 | 75 69 64 28 29 3b 0a 63 |, *getpw|uid();.c|
|00005380| 68 61 72 09 63 75 72 74 | 69 6d 65 5b 32 36 5d 2c |har.curt|ime[26],|
|00005390| 20 70 74 74 79 5b 37 5d | 2c 20 2a 67 65 74 70 74 | ptty[7]|, *getpt|
|000053a0| 74 79 28 29 3b 0a 0a 64 | 6d 65 6d 63 6f 70 79 28 |ty();..d|memcopy(|
|000053b0| 20 6b 6d 65 6d 2c 20 28 | 63 68 61 72 20 2a 29 26 | kmem, (|char *)&|
|000053c0| 70 2c 20 28 6c 6f 6e 67 | 29 70 70 74 2c 20 28 6c |p, (long|)ppt, (l|
|000053d0| 6f 6e 67 29 73 69 7a 65 | 6f 66 28 20 73 74 72 75 |ong)size|of( stru|
|000053e0| 63 74 20 70 72 6f 63 20 | 29 20 29 3b 0a 69 66 20 |ct proc |) );.if |
|000053f0| 28 20 70 2e 70 5f 66 6c | 61 67 20 26 20 53 4c 4f |( p.p_fl|ag & SLO|
|00005400| 41 44 20 29 20 7b 0a 09 | 64 6d 65 6d 63 6f 70 79 |AD ) {..|dmemcopy|
|00005410| 28 20 6d 65 6d 2c 20 28 | 63 68 61 72 20 2a 29 26 |( mem, (|char *)&|
|00005420| 75 2c 20 28 6c 6f 6e 67 | 29 28 20 63 74 6f 62 28 |u, (long|)( ctob(|
|00005430| 20 70 2e 70 5f 61 64 64 | 72 5b 30 5d 20 29 2b 55 | p.p_add|r[0] )+U|
|00005440| 5f 4f 46 46 53 45 54 20 | 29 2c 0a 09 09 28 6c 6f |_OFFSET |),...(lo|
|00005450| 6e 67 29 73 69 7a 65 6f | 66 28 20 73 74 72 75 63 |ng)sizeo|f( struc|
|00005460| 74 20 75 73 65 72 20 29 | 20 29 3b 0a 09 70 77 64 |t user )| );..pwd|
|00005470| 20 3d 20 67 65 74 70 77 | 75 69 64 28 20 70 2e 70 | = getpw|uid( p.p|
|00005480| 5f 75 69 64 20 29 3b 0a | 09 66 70 72 69 6e 74 66 |_uid );.|.fprintf|
|00005490| 28 20 77 70 2c 20 22 25 | 38 73 20 22 2c 20 70 77 |( wp, "%|8s ", pw|
|000054a0| 64 2d 3e 70 77 5f 6e 61 | 6d 65 20 29 3b 0a 09 70 |d->pw_na|me );..p|
|000054b0| 77 64 20 3d 20 67 65 74 | 70 77 75 69 64 28 20 70 |wd = get|pwuid( p|
|000054c0| 2e 70 5f 73 75 69 64 20 | 29 3b 0a 09 66 70 72 69 |.p_suid |);..fpri|
|000054d0| 6e 74 66 28 20 77 70 2c | 20 22 25 38 73 20 25 35 |ntf( wp,| "%8s %5|
|000054e0| 64 20 25 35 64 20 22 2c | 20 70 77 64 2d 3e 70 77 |d %5d ",| pwd->pw|
|000054f0| 5f 6e 61 6d 65 2c 20 70 | 2e 70 5f 70 69 64 2c 20 |_name, p|.p_pid, |
|00005500| 70 2e 70 5f 70 70 69 64 | 20 29 3b 0a 09 73 74 72 |p.p_ppid| );..str|
|00005510| 63 70 79 28 20 63 75 72 | 74 69 6d 65 2c 20 66 6d |cpy( cur|time, fm|
|00005520| 74 74 69 6d 65 28 20 6c | 6f 63 61 6c 74 69 6d 65 |ttime( l|ocaltime|
|00005530| 28 20 26 75 2e 75 5f 73 | 74 61 72 74 20 29 20 29 |( &u.u_s|tart ) )|
|00005540| 20 29 3b 0a 09 73 74 72 | 63 70 79 28 20 70 74 74 | );..str|cpy( ptt|
|00005550| 79 2c 20 67 65 74 70 74 | 74 79 28 20 75 2e 75 5f |y, getpt|ty( u.u_|
|00005560| 74 74 79 64 20 29 20 29 | 3b 0a 09 66 70 72 69 6e |ttyd ) )|;..fprin|
|00005570| 74 66 28 20 77 70 2c 20 | 22 25 31 31 73 20 25 36 |tf( wp, |"%11s %6|
|00005580| 73 20 25 73 5c 6e 22 2c | 20 63 75 72 74 69 6d 65 |s %s\n",| curtime|
|00005590| 2c 20 70 74 74 79 2c 20 | 75 2e 75 5f 63 6f 6d 6d |, ptty, |u.u_comm|
|000055a0| 20 29 3b 0a 09 66 66 6c | 75 73 68 28 20 77 70 20 | );..ffl|ush( wp |
|000055b0| 29 3b 0a 09 7d 0a 7d 0a | 0a 63 68 61 72 09 2a 67 |);..}.}.|.char.*g|
|000055c0| 65 74 70 74 74 79 28 20 | 64 65 76 6e 6f 20 29 0a |etptty( |devno ).|
|000055d0| 64 65 76 5f 74 09 64 65 | 76 6e 6f 3b 0a 0a 2f 2a |dev_t.de|vno;../*|
|000055e0| 09 47 6f 20 66 72 6f 6d | 20 61 20 64 65 76 69 63 |.Go from| a devic|
|000055f0| 65 20 6e 75 6d 62 65 72 | 20 74 6f 20 61 20 64 65 |e number| to a de|
|00005600| 76 69 63 65 20 6e 61 6d | 65 2e 09 2a 2f 0a 0a 7b |vice nam|e..*/..{|
|00005610| 0a 44 49 52 09 2a 64 69 | 72 70 3b 0a 73 74 72 75 |.DIR.*di|rp;.stru|
|00005620| 63 74 20 64 69 72 65 63 | 74 79 09 2a 64 69 72 3b |ct direc|ty.*dir;|
|00005630| 0a 73 74 72 75 63 74 20 | 73 74 61 74 09 73 62 75 |.struct |stat.sbu|
|00005640| 66 3b 0a 63 68 61 72 09 | 6e 61 6d 65 5b 31 34 5d |f;.char.|name[14]|
|00005650| 3b 0a 73 74 61 74 69 63 | 20 63 68 61 72 09 74 6e |;.static| char.tn|
|00005660| 61 6d 65 5b 37 5d 3b 0a | 0a 73 74 72 63 70 79 28 |ame[7];.|.strcpy(|
|00005670| 20 74 6e 61 6d 65 2c 20 | 22 6e 6f 6e 65 22 20 29 | tname, |"none" )|
|00005680| 3b 0a 69 66 20 28 20 21 | 64 65 76 6e 6f 20 29 0a |;.if ( !|devno ).|
|00005690| 09 72 65 74 75 72 6e 28 | 20 74 6e 61 6d 65 20 29 |.return(| tname )|
|000056a0| 3b 0a 64 69 72 70 20 3d | 20 6f 70 65 6e 64 69 72 |;.dirp =| opendir|
|000056b0| 28 20 44 45 56 44 49 52 | 20 29 3b 0a 77 68 69 6c |( DEVDIR| );.whil|
|000056c0| 65 20 28 20 28 20 64 69 | 72 20 3d 20 72 65 61 64 |e ( ( di|r = read|
|000056d0| 64 69 72 28 20 64 69 72 | 70 20 29 20 29 20 21 3d |dir( dir|p ) ) !=|
|000056e0| 20 4e 55 4c 4c 20 29 20 | 7b 0a 09 69 66 20 28 20 | NULL ) |{..if ( |
|000056f0| 64 69 72 2d 3e 64 5f 6e | 61 6d 65 5b 30 5d 20 21 |dir->d_n|ame[0] !|
|00005700| 3d 20 27 2e 27 20 29 20 | 7b 0a 09 09 73 74 72 63 |= '.' ) |{...strc|
|00005710| 70 79 28 20 6e 61 6d 65 | 2c 20 44 45 56 44 49 52 |py( name|, DEVDIR|
|00005720| 20 29 3b 0a 09 09 73 74 | 72 63 61 74 28 20 6e 61 | );...st|rcat( na|
|00005730| 6d 65 2c 20 64 69 72 2d | 3e 64 5f 6e 61 6d 65 20 |me, dir-|>d_name |
|00005740| 29 3b 0a 09 09 73 74 61 | 74 28 20 6e 61 6d 65 2c |);...sta|t( name,|
|00005750| 20 26 73 62 75 66 20 29 | 3b 0a 09 09 69 66 20 28 | &sbuf )|;...if (|
|00005760| 20 64 65 76 6e 6f 20 3d | 3d 20 73 62 75 66 2e 73 | devno =|= sbuf.s|
|00005770| 74 5f 72 64 65 76 20 29 | 20 7b 0a 09 09 09 63 6c |t_rdev )| {....cl|
|00005780| 6f 73 65 64 69 72 28 20 | 64 69 72 70 20 29 3b 0a |osedir( |dirp );.|
|00005790| 09 09 09 73 74 72 63 70 | 79 28 20 74 6e 61 6d 65 |...strcp|y( tname|
|000057a0| 2c 20 64 69 72 2d 3e 64 | 5f 6e 61 6d 65 20 29 3b |, dir->d|_name );|
|000057b0| 0a 09 09 09 72 65 74 75 | 72 6e 28 20 74 6e 61 6d |....retu|rn( tnam|
|000057c0| 65 20 29 3b 0a 09 09 09 | 7d 0a 09 09 7d 0a 09 7d |e );....|}...}..}|
|000057d0| 0a 63 6c 6f 73 65 64 69 | 72 28 20 64 69 72 70 20 |.closedi|r( dirp |
|000057e0| 29 3b 0a 72 65 74 75 72 | 6e 28 20 74 6e 61 6d 65 |);.retur|n( tname|
|000057f0| 20 29 3b 0a 7d 0a 0a 73 | 68 6f 77 75 74 65 6e 74 | );.}..s|howutent|
|00005800| 28 20 66 70 2c 20 75 20 | 29 0a 46 49 4c 45 09 2a |( fp, u |).FILE.*|
|00005810| 66 70 3b 0a 73 74 72 75 | 63 74 09 75 74 6d 70 20 |fp;.stru|ct.utmp |
|00005820| 2a 75 3b 0a 0a 2f 2a 09 | 50 72 69 6e 74 20 61 20 |*u;../*.|Print a |
|00005830| 66 6f 72 6d 61 74 74 65 | 64 20 75 74 6d 70 20 65 |formatte|d utmp e|
|00005840| 6e 74 72 79 2e 09 2a 2f | 0a 0a 7b 0a 63 68 61 72 |ntry..*/|..{.char|
|00005850| 09 63 75 72 74 69 6d 65 | 5b 32 36 5d 2c 20 2a 66 |.curtime|[26], *f|
|00005860| 6d 74 74 69 6d 65 28 29 | 3b 0a 0a 73 74 72 63 70 |mttime()|;..strcp|
|00005870| 79 28 20 63 75 72 74 69 | 6d 65 2c 20 66 6d 74 74 |y( curti|me, fmtt|
|00005880| 69 6d 65 28 20 6c 6f 63 | 61 6c 74 69 6d 65 28 20 |ime( loc|altime( |
|00005890| 26 28 20 75 2d 3e 75 74 | 5f 74 69 6d 65 20 29 20 |&( u->ut|_time ) |
|000058a0| 29 20 29 20 29 3b 0a 66 | 70 72 69 6e 74 66 28 20 |) ) );.f|printf( |
|000058b0| 66 70 2c 20 22 25 38 73 | 20 25 31 34 73 20 25 31 |fp, "%8s| %14s %1|
|000058c0| 31 73 20 25 35 64 5c 6e | 22 2c 20 75 2d 3e 75 74 |1s %5d\n|", u->ut|
|000058d0| 5f 75 73 65 72 2c 20 75 | 2d 3e 75 74 5f 6c 69 6e |_user, u|->ut_lin|
|000058e0| 65 2c 20 63 75 72 74 69 | 6d 65 2c 20 75 2d 3e 75 |e, curti|me, u->u|
|000058f0| 74 5f 70 69 64 20 29 3b | 0a 7d 0a 0a 53 48 41 52 |t_pid );|.}..SHAR|
|00005900| 5f 45 4f 46 0a 66 69 20 | 23 20 65 6e 64 20 6f 66 |_EOF.fi |# end of|
|00005910| 20 6f 76 65 72 77 72 69 | 74 69 6e 67 20 63 68 65 | overwri|ting che|
|00005920| 63 6b 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 73 |ck.if te|st -f 's|
|00005930| 74 61 72 74 6d 67 72 2e | 63 27 0a 74 68 65 6e 0a |tartmgr.|c'.then.|
|00005940| 20 20 20 20 20 20 20 65 | 63 68 6f 20 73 68 61 72 | e|cho shar|
|00005950| 3a 20 77 69 6c 6c 20 6e | 6f 74 20 6f 76 65 72 2d |: will n|ot over-|
|00005960| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 20 66 |write ex|isting f|
|00005970| 69 6c 65 20 22 27 73 74 | 61 72 74 6d 67 72 2e 63 |ile "'st|artmgr.c|
|00005980| 27 22 0a 65 6c 73 65 0a | 63 61 74 20 3c 3c 20 5c |'".else.|cat << \|
|00005990| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 73 74 61 72 |SHAR_EOF| > 'star|
|000059a0| 74 6d 67 72 2e 63 27 0a | 2f 2a 09 73 74 61 72 74 |tmgr.c'.|/*.start|
|000059b0| 6d 67 72 3a 20 20 43 72 | 65 61 74 65 20 61 20 6f |mgr: Cr|eate a o|
|000059c0| 6e 65 2d 6c 69 6e 65 20 | 77 69 6e 64 6f 77 20 6f |ne-line |window o|
|000059d0| 6e 20 74 68 65 20 74 6f | 70 20 6c 69 6e 65 20 6f |n the to|p line o|
|000059e0| 66 20 74 68 65 20 55 6e | 69 78 2d 50 43 0a 09 28 |f the Un|ix-PC..(|
|000059f0| 37 33 30 30 2f 33 42 31 | 29 20 73 63 72 65 65 6e |7300/3B1|) screen|
|00005a00| 20 61 6e 64 20 73 74 61 | 72 74 20 61 20 70 72 6f | and sta|rt a pro|
|00005a10| 67 72 61 6d 20 72 75 6e | 6e 69 6e 67 20 69 6e 20 |gram run|ning in |
|00005a20| 74 68 61 74 20 77 69 6e | 64 6f 77 2e 0a 09 44 65 |that win|dow...De|
|00005a30| 63 6c 61 72 65 20 74 68 | 69 73 20 77 69 6e 64 6f |clare th|is windo|
|00005a40| 77 20 74 6f 20 62 65 20 | 74 68 65 20 57 69 6e 64 |w to be |the Wind|
|00005a50| 6f 77 20 4d 61 6e 61 67 | 65 72 2c 20 77 68 69 63 |ow Manag|er, whic|
|00005a60| 68 20 67 69 76 65 73 20 | 69 74 20 63 6f 6e 74 72 |h gives |it contr|
|00005a70| 6f 6c 0a 09 6f 76 65 72 | 20 74 68 65 20 53 75 73 |ol..over| the Sus|
|00005a80| 70 65 6e 64 2c 20 52 65 | 73 75 6d 65 20 61 6e 64 |pend, Re|sume and|
|00005a90| 20 50 72 69 6e 74 20 6b | 65 79 73 2e 20 20 54 68 | Print k|eys. Th|
|00005aa0| 69 73 20 69 73 20 6d 65 | 61 6e 74 20 74 6f 20 62 |is is me|ant to b|
|00005ab0| 65 20 75 73 65 64 20 74 | 6f 0a 09 73 74 61 72 74 |e used t|o..start|
|00005ac0| 20 6e 65 77 6d 67 72 2c | 20 62 75 74 20 63 61 6e | newmgr,| but can|
|00005ad0| 20 70 72 6f 62 61 62 6c | 79 20 62 65 20 61 64 61 | probabl|y be ada|
|00005ae0| 70 74 65 64 20 74 6f 20 | 62 65 20 61 20 66 61 69 |pted to |be a fai|
|00005af0| 72 6c 79 20 67 65 6e 65 | 72 69 63 20 70 72 6f 67 |rly gene|ric prog|
|00005b00| 72 61 6d 0a 09 73 74 61 | 72 74 65 72 2e 20 20 49 |ram..sta|rter. I|
|00005b10| 74 20 77 61 73 20 64 65 | 73 69 67 6e 65 64 20 74 |t was de|signed t|
|00005b20| 6f 20 6d 69 6d 69 63 20 | 74 68 65 20 6f 62 73 65 |o mimic |the obse|
|00005b30| 72 76 65 64 20 6f 70 65 | 72 61 74 69 6f 6e 20 6f |rved ope|ration o|
|00005b40| 66 20 74 68 69 6e 67 73 | 20 6c 69 6b 65 0a 09 63 |f things| like..c|
|00005b50| 72 6f 6e 2c 20 73 6d 67 | 72 2c 20 65 74 63 2e 0a |ron, smg|r, etc..|
|00005b60| 0a 09 54 68 69 73 20 73 | 6f 66 74 77 61 72 65 20 |..This s|oftware |
|00005b70| 69 73 20 43 6f 70 79 72 | 69 67 68 74 20 28 63 29 |is Copyr|ight (c)|
|00005b80| 20 31 39 38 37 20 62 79 | 20 53 63 6f 74 74 20 48 | 1987 by| Scott H|
|00005b90| 61 7a 65 6e 20 4d 75 65 | 6c 6c 65 72 2e 0a 20 0a |azen Mue|ller.. .|
|00005ba0| 09 50 65 72 6d 69 73 73 | 69 6f 6e 20 69 73 20 68 |.Permiss|ion is h|
|00005bb0| 65 72 65 62 79 20 67 72 | 61 6e 74 65 64 20 74 6f |ereby gr|anted to|
|00005bc0| 20 63 6f 70 79 2c 20 72 | 65 70 72 6f 64 75 63 65 | copy, r|eproduce|
|00005bd0| 2c 20 72 65 64 69 73 74 | 72 69 62 75 74 65 20 6f |, redist|ribute o|
|00005be0| 72 0a 09 6f 74 68 65 72 | 77 69 73 65 20 75 73 65 |r..other|wise use|
|00005bf0| 20 74 68 69 73 20 73 6f | 66 74 77 61 72 65 20 61 | this so|ftware a|
|00005c00| 73 20 6c 6f 6e 67 20 61 | 73 3a 20 74 68 65 72 65 |s long a|s: there|
|00005c10| 20 69 73 20 6e 6f 20 6d | 6f 6e 65 74 61 72 79 0a | is no m|onetary.|
|00005c20| 09 70 72 6f 66 69 74 20 | 67 61 69 6e 65 64 20 73 |.profit |gained s|
|00005c30| 70 65 63 69 66 69 63 61 | 6c 6c 79 20 66 72 6f 6d |pecifica|lly from|
|00005c40| 20 74 68 65 20 75 73 65 | 20 6f 72 20 72 65 70 72 | the use| or repr|
|00005c50| 6f 64 75 63 74 69 6f 6e | 20 6f 72 20 74 68 69 73 |oduction| or this|
|00005c60| 0a 09 73 6f 66 74 77 61 | 72 65 2c 20 69 74 20 69 |..softwa|re, it i|
|00005c70| 73 20 6e 6f 74 20 73 6f | 6c 64 2c 20 72 65 6e 74 |s not so|ld, rent|
|00005c80| 65 64 2c 20 74 72 61 64 | 65 64 20 6f 72 20 6f 74 |ed, trad|ed or ot|
|00005c90| 68 65 72 77 69 73 65 20 | 6d 61 72 6b 65 74 65 64 |herwise |marketed|
|00005ca0| 2c 20 61 6e 64 0a 09 74 | 68 69 73 20 63 6f 70 79 |, and..t|his copy|
|00005cb0| 72 69 67 68 74 20 6e 6f | 74 69 63 65 20 69 73 20 |right no|tice is |
|00005cc0| 69 6e 63 6c 75 64 65 64 | 20 70 72 6f 6d 69 6e 65 |included| promine|
|00005cd0| 6e 74 6c 79 20 69 6e 20 | 61 6e 79 20 63 6f 70 79 |ntly in |any copy|
|00005ce0| 0a 09 6d 61 64 65 2e 0a | 0a 09 54 68 65 20 61 75 |..made..|..The au|
|00005cf0| 74 68 6f 72 20 6d 61 6b | 65 20 6e 6f 20 63 6c 61 |thor mak|e no cla|
|00005d00| 69 6d 73 20 61 73 20 74 | 6f 20 74 68 65 20 66 69 |ims as t|o the fi|
|00005d10| 74 6e 65 73 73 20 6f 72 | 20 63 6f 72 72 65 63 74 |tness or| correct|
|00005d20| 6e 65 73 73 20 6f 66 0a | 09 74 68 69 73 20 73 6f |ness of.|.this so|
|00005d30| 66 74 77 61 72 65 20 66 | 6f 72 20 61 6e 79 20 75 |ftware f|or any u|
|00005d40| 73 65 20 77 68 61 74 73 | 6f 65 76 65 72 2c 20 61 |se whats|oever, a|
|00005d50| 6e 64 20 69 74 20 69 73 | 20 70 72 6f 76 69 64 65 |nd it is| provide|
|00005d60| 64 20 61 73 20 69 73 2e | 20 0a 09 41 6e 79 20 75 |d as is.| ..Any u|
|00005d70| 73 65 20 6f 66 20 74 68 | 69 73 20 73 6f 66 74 77 |se of th|is softw|
|00005d80| 61 72 65 20 69 73 20 61 | 74 20 74 68 65 20 75 73 |are is a|t the us|
|00005d90| 65 72 27 73 20 6f 77 6e | 20 72 69 73 6b 2e 0a 0a |er's own| risk...|
|00005da0| 09 28 43 6f 70 79 72 69 | 67 68 74 20 6e 6f 74 69 |.(Copyri|ght noti|
|00005db0| 63 65 20 63 6f 75 72 74 | 65 73 79 20 6f 66 20 4e |ce court|esy of N|
|00005dc0| 65 77 73 20 32 2e 31 31 | 20 3a 2d 29 0a 0a 09 41 |ews 2.11| :-)...A|
|00005dd0| 64 64 69 74 69 6f 6e 61 | 6c 6c 79 3a 20 20 79 6f |dditiona|lly: yo|
|00005de0| 75 20 62 72 65 61 6b 20 | 69 74 2c 20 79 6f 75 20 |u break |it, you |
|00005df0| 62 6f 75 67 68 74 20 69 | 74 2e 20 20 49 27 76 65 |bought i|t. I've|
|00005e00| 20 6c 69 73 74 65 64 20 | 74 68 65 20 70 72 6f 62 | listed |the prob|
|00005e10| 6c 65 6d 73 0a 09 74 68 | 61 74 20 49 20 6b 6e 6f |lems..th|at I kno|
|00005e20| 77 20 6f 66 20 69 6e 20 | 63 6f 6d 6d 65 6e 74 73 |w of in |comments|
|00005e30| 20 69 6e 20 74 68 65 20 | 63 6f 64 65 3b 20 69 66 | in the |code; if|
|00005e40| 20 79 6f 75 20 63 6f 6d | 65 20 75 70 20 77 69 74 | you com|e up wit|
|00005e50| 68 20 66 69 78 65 73 2c | 20 49 27 64 0a 09 6c 69 |h fixes,| I'd..li|
|00005e60| 6b 65 20 74 6f 20 73 65 | 65 20 74 68 65 6d 2c 20 |ke to se|e them, |
|00005e70| 62 75 74 20 49 27 6d 20 | 6e 6f 74 20 70 6c 61 6e |but I'm |not plan|
|00005e80| 6e 69 6e 67 20 6f 6e 20 | 73 75 70 70 6f 72 74 69 |ning on |supporti|
|00005e90| 6e 67 20 61 6e 79 74 68 | 69 6e 67 2e 20 20 49 74 |ng anyth|ing. It|
|00005ea0| 27 73 0a 09 22 67 6f 6f | 64 20 65 6e 6f 75 67 68 |'s.."goo|d enough|
|00005eb0| 22 3b 20 74 68 61 74 27 | 73 20 61 6c 6c 20 74 68 |"; that'|s all th|
|00005ec0| 61 74 20 49 27 6d 20 6c | 6f 6f 6b 69 6e 67 20 66 |at I'm l|ooking f|
|00005ed0| 6f 72 2e 09 2a 2f 0a 0a | 23 69 6e 63 6c 75 64 65 |or..*/..|#include|
|00005ee0| 09 3c 73 74 64 69 6f 2e | 68 3e 0a 23 69 6e 63 6c |.<stdio.|h>.#incl|
|00005ef0| 75 64 65 09 3c 73 79 73 | 2f 74 79 70 65 73 2e 68 |ude.<sys|/types.h|
|00005f00| 3e 0a 23 69 6e 63 6c 75 | 64 65 09 3c 77 69 6e 64 |>.#inclu|de.<wind|
|00005f10| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 09 3c 73 79 |.h>.#inc|lude.<sy|
|00005f20| 73 2f 77 69 6e 64 6f 77 | 2e 68 3e 0a 23 69 6e 63 |s/window|.h>.#inc|
|00005f30| 6c 75 64 65 09 3c 66 63 | 6e 74 6c 2e 68 3e 0a 23 |lude.<fc|ntl.h>.#|
|00005f40| 69 6e 63 6c 75 64 65 09 | 3c 74 65 72 6d 69 6f 2e |include.|<termio.|
|00005f50| 68 3e 0a 0a 2f 2a 09 50 | 61 72 61 6d 65 74 65 72 |h>../*.P|arameter|
|00005f60| 73 20 64 65 66 69 6e 69 | 6e 67 20 74 68 65 20 77 |s defini|ng the w|
|00005f70| 69 6e 64 6f 77 20 61 6e | 64 20 74 68 65 20 70 72 |indow an|d the pr|
|00005f80| 6f 67 72 61 6d 20 66 6f | 72 20 74 68 61 74 20 77 |ogram fo|r that w|
|00005f90| 69 6e 64 6f 77 2e 20 20 | 59 6f 75 27 6c 6c 0a 09 |indow. |You'll..|
|00005fa0| 61 6c 6d 6f 73 74 20 63 | 65 72 74 61 69 6e 6c 79 |almost c|ertainly|
|00005fb0| 20 68 61 76 65 20 74 6f | 20 63 68 61 6e 67 65 20 | have to| change |
|00005fc0| 62 61 72 70 72 6f 67 20 | 74 6f 20 63 6f 72 72 65 |barprog |to corre|
|00005fd0| 73 70 6f 6e 64 20 77 69 | 74 68 20 77 68 61 74 65 |spond wi|th whate|
|00005fe0| 76 65 72 0a 09 64 69 72 | 65 63 74 6f 72 79 20 79 |ver..dir|ectory y|
|00005ff0| 6f 75 20 75 73 65 20 66 | 6f 72 20 79 6f 75 72 20 |ou use f|or your |
|00006000| 6c 6f 63 61 6c 20 73 74 | 75 66 66 2e 0a 0a 09 4e |local st|uff....N|
|00006010| 6f 74 65 3a 20 20 57 46 | 4c 41 47 53 20 77 61 73 |ote: WF|LAGS was|
|00006020| 20 64 65 74 65 72 6d 69 | 6e 65 64 20 65 6d 70 69 | determi|ned empi|
|00006030| 72 69 63 61 6c 6c 79 2c | 20 62 79 20 6c 6f 6f 6b |rically,| by look|
|00006040| 69 6e 67 20 61 74 20 74 | 68 65 20 66 6c 61 67 73 |ing at t|he flags|
|00006050| 20 66 6f 72 0a 09 74 68 | 65 20 41 54 26 54 2d 73 | for..th|e AT&T-s|
|00006060| 75 70 70 6c 69 65 64 20 | 73 6d 67 72 20 77 69 6e |upplied |smgr win|
|00006070| 64 6f 77 2e 20 20 4e 6f | 20 67 75 61 72 61 6e 74 |dow. No| guarant|
|00006080| 65 65 73 20 68 65 72 65 | 2e 09 2a 2f 0a 0a 23 64 |ees here|..*/..#d|
|00006090| 65 66 69 6e 65 09 09 42 | 41 52 50 52 4f 47 09 09 |efine..B|ARPROG..|
|000060a0| 22 2f 75 73 72 2f 6c 6f | 63 61 6c 2f 6e 65 77 6d |"/usr/lo|cal/newm|
|000060b0| 67 72 22 0a 23 64 65 66 | 69 6e 65 09 09 57 58 53 |gr".#def|ine..WXS|
|000060c0| 54 41 52 54 09 09 30 0a | 23 64 65 66 69 6e 65 09 |TART..0.|#define.|
|000060d0| 09 57 59 53 54 41 52 54 | 09 09 30 0a 23 64 65 66 |.WYSTART|..0.#def|
|000060e0| 69 6e 65 09 09 57 57 49 | 44 54 48 09 09 37 32 30 |ine..WWI|DTH..720|
|000060f0| 0a 23 64 65 66 69 6e 65 | 09 09 57 48 45 49 47 48 |.#define|..WHEIGH|
|00006100| 54 09 09 31 32 0a 23 64 | 65 66 69 6e 65 09 09 57 |T..12.#d|efine..W|
|00006110| 46 4c 41 47 53 09 09 32 | 35 37 0a 0a 6d 61 69 6e |FLAGS..2|57..main|
|00006120| 28 29 0a 7b 0a 69 6e 74 | 09 77 64 2c 20 64 75 6d |().{.int|.wd, dum|
|00006130| 6d 79 3b 0a 73 74 72 75 | 63 74 20 75 77 64 61 74 |my;.stru|ct uwdat|
|00006140| 61 20 77 69 6e 62 61 72 | 3b 0a 73 74 72 75 63 74 |a winbar|;.struct|
|00006150| 20 75 74 64 61 74 61 20 | 77 69 6e 6e 61 6d 65 3b | utdata |winname;|
|00006160| 0a 73 74 72 75 63 74 20 | 74 65 72 6d 69 6f 20 62 |.struct |termio b|
|00006170| 61 72 74 74 79 3b 0a 0a | 77 69 6e 62 61 72 2e 75 |artty;..|winbar.u|
|00006180| 77 5f 78 20 3d 20 57 58 | 53 54 41 52 54 3b 0a 77 |w_x = WX|START;.w|
|00006190| 69 6e 62 61 72 2e 75 77 | 5f 79 20 3d 20 57 59 53 |inbar.uw|_y = WYS|
|000061a0| 54 41 52 54 3b 0a 77 69 | 6e 62 61 72 2e 75 77 5f |TART;.wi|nbar.uw_|
|000061b0| 77 69 64 74 68 20 3d 20 | 57 57 49 44 54 48 3b 0a |width = |WWIDTH;.|
|000061c0| 77 69 6e 62 61 72 2e 75 | 77 5f 68 65 69 67 68 74 |winbar.u|w_height|
|000061d0| 20 3d 20 57 48 45 49 47 | 48 54 3b 0a 77 69 6e 62 | = WHEIG|HT;.winb|
|000061e0| 61 72 2e 75 77 5f 75 66 | 6c 61 67 73 20 3d 20 57 |ar.uw_uf|lags = W|
|000061f0| 46 4c 41 47 53 3b 0a 77 | 69 6e 6e 61 6d 65 2e 75 |FLAGS;.w|inname.u|
|00006200| 74 5f 6e 75 6d 20 3d 20 | 57 54 58 54 55 53 45 52 |t_num = |WTXTUSER|
|00006210| 3b 0a 0a 73 74 72 63 70 | 79 28 20 77 69 6e 6e 61 |;..strcp|y( winna|
|00006220| 6d 65 2e 75 74 5f 74 65 | 78 74 2c 20 22 49 6e 76 |me.ut_te|xt, "Inv|
|00006230| 69 73 69 62 6c 65 22 20 | 29 3b 0a 69 66 20 28 20 |isible" |);.if ( |
|00006240| 66 6f 72 6b 28 29 20 29 | 0a 09 65 78 69 74 28 20 |fork() )|..exit( |
|00006250| 30 20 29 3b 0a 65 6c 73 | 65 20 7b 0a 0a 2f 2a 09 |0 );.els|e {../*.|
|00006260| 53 65 74 70 67 72 70 28 | 29 20 63 61 6e 6e 6f 74 |Setpgrp(|) cannot|
|00006270| 20 62 65 20 63 61 6c 6c | 65 64 20 66 72 6f 6d 20 | be call|ed from |
|00006280| 70 72 6f 63 65 73 73 65 | 73 20 61 73 73 6f 63 69 |processe|s associ|
|00006290| 61 74 65 64 20 77 69 74 | 68 20 77 69 6e 64 6f 77 |ated wit|h window|
|000062a0| 73 2e 0a 09 46 72 6f 6d | 20 74 68 65 20 6d 61 6e |s...From| the man|
|000062b0| 75 61 6c 2e 20 20 53 69 | 6e 63 65 20 69 74 27 73 |ual. Si|nce it's|
|000062c0| 20 61 20 63 6c 65 61 6e | 65 72 20 6d 6f 64 65 6c | a clean|er model|
|000062d0| 20 66 6f 72 20 74 68 65 | 20 70 61 72 65 6e 74 20 | for the| parent |
|000062e0| 74 6f 20 72 65 64 69 72 | 65 63 74 0a 09 74 68 65 |to redir|ect..the|
|000062f0| 20 63 68 69 6c 64 27 73 | 20 73 74 64 69 6e 2c 20 | child's| stdin, |
|00006300| 73 74 64 6f 75 74 20 61 | 6e 64 20 73 74 64 65 72 |stdout a|nd stder|
|00006310| 72 2c 20 77 65 20 64 6f | 20 74 68 61 74 2e 20 20 |r, we do| that. |
|00006320| 57 65 20 68 61 76 65 20 | 74 6f 20 73 65 74 70 67 |We have |to setpg|
|00006330| 72 70 28 29 2c 0a 09 6f | 72 20 65 6c 73 65 20 74 |rp(),..o|r else t|
|00006340| 68 65 20 63 68 69 6c 64 | 20 77 6f 75 6c 64 20 62 |he child| would b|
|00006350| 65 20 6b 69 6c 6c 65 64 | 20 77 68 65 6e 20 74 68 |e killed| when th|
|00006360| 65 20 70 72 6f 63 65 73 | 73 20 67 72 6f 75 70 20 |e proces|s group |
|00006370| 6c 65 61 64 65 72 20 65 | 78 69 74 65 64 2e 09 2a |leader e|xited..*|
|00006380| 2f 0a 0a 09 66 63 6c 6f | 73 65 28 20 73 74 64 69 |/...fclo|se( stdi|
|00006390| 6e 20 29 3b 0a 09 66 63 | 6c 6f 73 65 28 20 73 74 |n );..fc|lose( st|
|000063a0| 64 6f 75 74 20 29 3b 0a | 09 66 63 6c 6f 73 65 28 |dout );.|.fclose(|
|000063b0| 20 73 74 64 65 72 72 20 | 29 3b 0a 09 73 65 74 70 | stderr |);..setp|
|000063c0| 67 72 70 28 29 3b 0a 0a | 2f 2a 09 47 65 74 20 61 |grp();..|/*.Get a|
|000063d0| 20 77 69 6e 64 6f 77 2c | 20 61 6e 64 20 73 65 74 | window,| and set|
|000063e0| 20 69 74 20 75 70 20 61 | 63 63 6f 72 64 69 6e 67 | it up a|ccording|
|000063f0| 20 74 6f 20 6f 75 72 20 | 70 61 72 61 6d 65 74 65 | to our |paramete|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.