truss(1)


truss -- Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╚Ñ╖Ñ░Ñ╩Ñδñ╬Ñ╚Ñ∞í╝Ñ╣

╖┴╝░

truss [-p] [-f] [-c] [-a] [-e] [-i] [-[tvx] [!] syscall . . .]
[-s [!] signal . . .] [-m [!] fault . . .] [-[rw] [!] fd . . .]
[-o outfile] command

╡í╟╜└Γ╠└

truss ñ╧╗╪─Ωñ╡ñ∞ñ┐Ñ│Ñ▐Ñ≤Ñ╔ñ≥╝┬╣╘ñ╖íó╝┬╣╘ñ╖ñ┐Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδíó╝⌡┐«ñ╖ñ┐Ñ╖Ñ░Ñ╩Ñδíóñ¬ñΦñ╙╚»└╕ñ╖ñ┐Ñ▐Ñ╖Ñ≤╛π│▓ñ╬Ñ╚Ñ∞í╝Ñ╣ñ≥└╕└«ñ╖ñ▐ñ╣íúÑ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╬│╞╣╘ñ╦íó╛π│▓íóÑ╖Ñ░Ñ╩Ñδ╠╛ñ▐ñ┐ñ╧Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδ╠╛ñ╬ñ╔ñ∞ñ½ñ¼íó░·ñ¡┐⌠ñ╚╠ßñΩ├═ñ╚╢ªñ╦─╠├╬ñ╡ñ∞ñ▐ñ╣íúÑ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╬░·ñ¡┐⌠ñ╧íó▓─╟╜ñ╩╛∞╣τñ╧┤╪╧óñ╣ñδÑ╖Ñ╣Ñ╞ÑαÑ╪Ñ├Ñ└Ñ╒ÑíÑñÑδñ½ñΘ─Ω╡┴ñ≥╗╚═╤ñ╖ñ╞╡¡╣µñ╟╔╜╝¿ñ╡ñ∞ñ▐ñ╣íúñ╔ñ╬Ñ╤Ñ╣╠╛Ñ▌ÑñÑ≤Ñ┐░·ñ¡┐⌠ñ╦┬╨ñ╖ñ╞ñΓíóÑ▌ÑñÑ≤Ñ┐ñ¼╗╪ñ╖ñ╞ñññδ╩╕╗·╬≤ñ¼╔╜╝¿ñ╡ñ∞ñ▐ñ╣íúÑ¿ÑΘí╝╗■ñ╬╠ßñΩ├═ñ╧ intro(2) ñ╟╡¡╜╥ñ╣ñδÑ¿ÑΘí╝Ñ│í╝Ñ╔╠╛ñ≥╗╚═╤ñ╖ñ╞─╠├╬ñ╡ñ∞ñ▐ñ╣íú

▓╝╡¡ñ╬ѬÑ╫Ñ╖ÑτÑ≤ñ¼╟º╝▒ñ╡ñ∞ñ▐ñ╣íúÑΩÑ╣Ñ╚░·ñ¡┐⌠ñ≥ñ╚ñδѬÑ╫Ñ╖ÑτÑ≤ñ╬╛∞╣τíó╠╛┴░``all''ñ≥├╗╜╠╖┴ñ╚ñ╖ñ╞╗╚═╤ñ╖ñ╞íóÑΩÑ╣Ñ╚ñ╬ñ╣ñ┘ñ╞ñ╬▓─╟╜ñ╩ÑßÑ≤Ñ╨ñ≥╗╪─Ωñ╟ñ¡ñ▐ñ╣íúÑΩÑ╣Ñ╚ñ¼``!''ñ╟╗╧ñ▐ñδ╛∞╣τíóѬÑ╫Ñ╖ÑτÑ≤ñ╬░╒╠úñ╧Ñ═Ñ▓í╝Ñ╚ñ╡ñ∞ñ▐ñ╣(ñ┐ñ╚ñ¿ñ╨íóÑ╚Ñ∞í╝Ñ╣ñ╟ñ╩ñ»╜ⁿ│░ñ╣ñδ)íú╞▒ñ╕ѬÑ╫Ñ╖ÑτÑ≤ñ╬╩ú┐⌠ñ╬ѬѽÑ∞Ñ≤Ñ╣ñ≥╗╪─Ωñ╟ñ¡ñ▐ñ╣íúÑΩÑ╣Ñ╚╞Γñ╬╞▒ñ╕╠╛┴░ñ╦┬╨ñ╖ñ╞ñ╧íó╕σñ╬(▒ª┬ªñ╬)ѬÑ╫Ñ╖ÑτÑ≤ñ¼┴░ñ╬(║╕┬ªñ╬)ѬÑ╫Ñ╖ÑτÑ≤ñ≥╠╡╕·ñ╦ñ╖ñ▐ñ╣íú

-p
truss ñ╦┬╨ñ╣ñδ░·ñ¡┐⌠ñ≥íó╝┬╣╘ñ╣ñ┘ñ¡Ñ│Ñ▐Ñ≤Ñ╔ñ╚ñ╖ñ╞ñ╟ñ╩ñ»íó┤√┬╕ñ╬Ñ╫ÑφÑ╗Ñ╣ñ╦┬╨ñ╣ñδÑ╫ÑφÑ╗Ñ╣ ID (ps(1) ╗▓╛╚) ñ╬ÑΩÑ╣Ñ╚ñ╚ñ╖ñ╞▓≥╝ßñ╖ñ▐ñ╣íútruss ñ╧│╞Ñ╫ÑφÑ╗Ñ╣ñ≥└⌐╕µñ╖íóÑ╫ÑφÑ╗Ñ╣ñ╬ѵí╝Ñ╢ ID ñ¬ñΦñ╙Ñ░Ñδí╝Ñ╫ ID ñ¼ñ╜ñ╬ѵí╝Ñ╢ñ╬ñΓñ╬ñ╚░∞├╫ñ╣ñδñ½íóñ▐ñ┐ñ╧ѵí╝Ñ╢ñ¼╞├╕óѵí╝Ñ╢ñ╟ñóñδ╛∞╣τñ╦│╞Ñ╫ÑφÑ╗Ñ╣ñ╬Ñ╚Ñ∞í╝Ñ╣ñ≥│½╗╧ñ╖ñ▐ñ╣íúÑ╫ÑφÑ╗Ñ╣ñ╧íó╬πñ¿ñ╨ /proc/1234 ñ╬ñΦñªñ╦íó/proc Ñ╟ÑúÑ∞Ñ»Ñ╚ÑΩñ╦ñ¬ñ▒ñδ╠╛┴░ñ╦ñΦñ├ñ╞ñΓ╗╪─Ωñ╟ñ¡ñ▐ñ╣íúñ│ñ∞ñ╧íóÑΩÑΓí╝Ñ╚ñ╦Ñ▐ѪÑ≤Ñ╚ñ╡ñ∞ñ┐ /proc Ñ╟ÑúÑ∞Ñ»Ñ╚ÑΩñ╟ñΓ═¡╕·ñ╟ñ╣íú

-f
Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╟ñ╬Ñ╖Ñ░Ñ╩Ñδíó╛π│▓íóñ¬ñΦñ╙Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ≥┤▐ñßíófork ñ╦ñΦñ├ñ╞└╕└«ñ╡ñ∞ñ┐ñ╣ñ┘ñ╞ñ╬╗╥Ñ╫ÑφÑ╗Ñ╣ñ≥─╔└╫ñ╖ñ▐ñ╣íú─╠╛∩ñ╧┬Φ 1 Ñ∞Ñ┘Ñδñ╬Ñ│Ñ▐Ñ≤Ñ╔ñ▐ñ┐ñ╧Ñ╫ÑφÑ╗Ñ╣ñ└ñ▒ñ¼Ñ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñ▐ñ╣íú-f ñ≥╗╪─Ωñ╖ñ┐ñ╚ñ¡ñ╧Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╬│╞╣╘ñ╦Ñ╫ÑφÑ╗Ñ╣ ID ñ¼╔╜╝¿ñ╡ñ∞íóñ╔ñ╬Ñ╫ÑφÑ╗Ñ╣ñ¼Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ≥╝┬╣╘ñ╖ñ┐ñ½íóñóñδñññ╧Ñ╖Ñ░Ñ╩Ñδñ≥╝⌡┐«ñ╖ñ┐ñ½ñ≥─╠├╬ñ╖ñ▐ñ╣íú

-c
Ñ╚Ñ∞í╝Ñ╣ñ≥ 1 ╣╘ñ║ñ─╔╜╝¿ñ╣ñδñ╬ñ╟ñ╧ñ╩ñ»íóÑ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñ┐Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδíó╛π│▓íóñ¬ñΦñ╙Ñ╖Ñ░Ñ╩Ñδñ≥ѽѪÑ≤Ñ╚ñ╖ñ▐ñ╣íúÑ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñ┐Ñ│Ñ▐Ñ≤Ñ╔ñ¼╜¬╬╗ñ╖ñ┐ñóñ╚íóñ▐ñ┐ñ╧ truss ñ¼│ΣñΩ╣■ñ▐ñ∞ñ┐ñ╚ñ¡íó═╫╠≤Ñ∞Ñ▌í╝Ñ╚ñ¼└╕└«ñ╡ñ∞ñ▐ñ╣íú-f ñΓ╗╪─Ωñ╖ñ┐╛∞╣τíó╗╥Ñ╫ÑφÑ╗Ñ╣ñ╦┬╨ñ╖ñ╞Ñ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñ┐Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδíó╛π│▓ñ¬ñΦñ╙Ñ╖Ñ░Ñ╩Ñδñ≥ñ╣ñ┘ñ╞ѽѪÑ≤Ñ╚ñ╦┤▐ñ▀ñ▐ñ╣íú

-a
│╞ exec Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╟┼╧ñ╡ñ∞ñδ░·ñ¡┐⌠╩╕╗·╬≤ñ≥╝¿ñ╖ñ▐ñ╣íú

-e
│╞ exec Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╟┼╧ñ╡ñ∞ñδ┤─╢¡╩╕╗·╬≤ñ≥╝¿ñ╖ñ▐ñ╣íú

-i
│ΣñΩ╣■ñ▀▓─╟╜ñ╩Ñ╣ÑΩí╝Ñ╫╛⌡┬╓ñ╬Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ≥╔╜╝¿ñ╖ñ▐ñ╗ñ≤íú├╝╦÷Ñ╟Ñ╨ÑñÑ╣ñ▐ñ┐ñ╧Ñ╤ÑñÑ╫ñ╬ open ñ¬ñΦñ╙ read ñ╩ñ╔íó╞├─Ωñ╬Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╧╠╡╕┬ñ╦Ñ╣ÑΩí╝Ñ╫ñ╟ñ¡íó│ΣñΩ╣■ñ▀▓─╟╜ñ╟ñ╣íú─╠╛∩ñ╧íóÑ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ¼ 1 ╔├ñ≥─╢ñ¿ñ╞ñ│ñ╬ñΦñªñ╩Ñ╣ÑΩí╝Ñ╫╛⌡┬╓ñ╦ñ╩ñ├ñ╞ñññδ╛∞╣τíótruss ñ╧ñ╜ñ∞ñΘñ≥─╠├╬ñ╖ñ▐ñ╣íúÑ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╧┤░╬╗╗■ñ╦║╞┼┘íó─╠├╬ñ╡ñ∞ñ▐ñ╣íú-i ѬÑ╫Ñ╖ÑτÑ≤ñ╧íóñ│ñ╬ñΦñªñ╩Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ≥ 1 ▓≤ñ└ñ▒íó┤░╬╗╗■ñ╦ñ╬ñ▀─╠├╬ñ╖ñ▐ñ╣íú

-t [!] syscall,. . .
Ñ╚Ñ∞í╝Ñ╣ñ▐ñ┐ñ╧║∩╜ⁿñ╣ñδÑ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ≥╗╪─Ωñ╖ñ▐ñ╣íúÑ│Ñ≤Ñ▐ñ╟╢Φ└┌ñ├ñ┐ÑΩÑ╣Ñ╚╞Γñ╟╗╪─Ωñ╡ñ∞ñ┐Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ≥Ñ╚Ñ∞í╝Ñ╣ñ╖ñ▐ñ╣íúÑΩÑ╣Ñ╚ñ¼``!''ñ╟╗╧ñ▐ñδ╛∞╣τíó╗╪─Ωñ╡ñ∞ñ┐Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ¼Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ½ñΘ║∩╜ⁿñ╡ñ∞ñ▐ñ╣íú╛╩╬¼├═ñ╧ -tall ñ╟ñ╣íú

-v [!] syscall,. . .
└Γ╠└╔╜╝¿íú(Ñ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñδ╛∞╣τ)╗╪─Ωñ╡ñ∞ñ┐Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╦ÑóÑ╔Ñ∞Ñ╣ñ¼┼╧ñ╣ñóñΘñµñδ╣╜┬ñ┬╬ñ╬╞Γ═╞ñ≥╔╜╝¿ñ╖ñ▐ñ╣íú╞■╬╧├═ñ╚ѬÑ┌Ñ∞í╝Ñ╞ÑúÑ≤Ñ░Ñ╖Ñ╣Ñ╞Ñαñ╦ñΦñ├ñ╞╩╓ñ╡ñ∞ñ┐├═ñ≥╝¿ñ╖ñ▐ñ╣íú╞■╬╧ñ¬ñΦñ╙╜╨╬╧ñ╬╬╛╩²ñ╦╗╚ñ∩ñ∞ñ┐╟ñ░╒ñ╬Ñ╒Ñúí╝ÑδÑ╔ñ╦┬╨ñ╖ñ╞ñ╧╜╨╬╧├═ñ└ñ▒ñ≥╝¿ñ╖ñ▐ñ╣íú╛╩╬¼├═ñ╧ -v!all ñ╟ñ╣íú

-x [!] syscall,. . .
(Ñ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñδ╛∞╣τ)╗╪─Ωñ╡ñ∞ñ┐Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╦┬╨ñ╣ñδ░·ñ¡┐⌠ñ≥ raw ╖┴╝░ñ╟íó╡¡╣µñ╟ñ╩ñ» 16 ┐╩┐⌠ñ╟╔╜╝¿ñ╖ñ▐ñ╣íúñ│ñ∞ñ╧íóÑ╙Ñ├Ñ╚ñ╬ñ▐ñ▐ñ≥╕½ñδ╩²ñ¼╬╔ñññ╚ñ╡ñ∞ñδ unredeemed Ñ╧Ñ├ѽí╝ñ╬ñ┐ñßñ╬ñΓñ╬ñ╟ñ╣íú╛╩╬¼├═ñ╧ -x!all ñ╟ñ╣íú

-s [!] signal,. . .
Ñ╚Ñ∞í╝Ñ╣ñ▐ñ┐ñ╧║∩╜ⁿñ╣ñδÑ╖Ñ░Ñ╩Ñδñ≥╗╪─Ωñ╖ñ▐ñ╣íúÑ│Ñ≤Ñ▐ñ╟╢Φ└┌ñ├ñ┐ÑΩÑ╣Ñ╚╞Γñ╟╗╪─Ωñ╡ñ∞ñ┐Ñ╖Ñ░Ñ╩Ñδñ≥Ñ╚Ñ∞í╝Ñ╣ñ╖ñ▐ñ╣íúÑ╫ÑφÑ╗Ñ╣ñ¼Ñ╖Ñ░Ñ╩Ñδñ≥╠╡╗δñ╣ñδ(Ñ╓ÑφÑ├Ñ»ñ╖ñ╩ññ)╛∞╣τñ╟ñΓíóÑ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╧╗╪─Ωñ╡ñ∞ñ┐│╞Ñ╖Ñ░Ñ╩Ñδñ╬╝⌡┐«ñ≥─╠├╬ñ╖ñ▐ñ╣íú(Ñ╓ÑφÑ├Ñ»ñ╡ñ∞ñ┐Ñ╖Ñ░Ñ╩Ñδñ╧Ñ╫ÑφÑ╗Ñ╣ñ¼ñ╜ñ∞ñΘñ≥▓≥╩ⁿñ╣ñδñ▐ñ╟╝⌡┐«ñ╡ñ∞ñ▐ñ╗ñ≤íú)Ñ╖Ñ░Ñ╩Ñδñ╧╠╛┴░ñ▐ñ┐ñ╧┐⌠╗·ñ╟╗╪─Ωñ╟ñ¡ñ▐ñ╣(sys/signal.h ╗▓╛╚)íúÑΩÑ╣Ñ╚ñ¼``!''ñ╟╗╧ñ▐ñδ╛∞╣τíó╗╪─Ωñ╡ñ∞ñ┐Ñ╖Ñ░Ñ╩Ñδñ¼Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ½ñΘ║∩╜ⁿñ╡ñ∞ñ▐ñ╣íú╛╩╬¼├═ñ╧ -sall ñ╟ñ╣íú

-m [``!''] fault,. . .
Ñ╚Ñ∞í╝Ñ╣ñ▐ñ┐ñ╧║∩╜ⁿñ╣ñδÑ▐Ñ╖Ñ≤╛π│▓ñ≥╗╪─Ωñ╖ñ▐ñ╣íúÑ│Ñ≤Ñ▐ñ╟╢Φ└┌ñ├ñ┐ÑΩÑ╣Ñ╚╞Γñ╟╗╪─Ωñ╡ñ∞ñ┐Ñ▐Ñ╖Ñ≤╛π│▓ñ≥Ñ╚Ñ∞í╝Ñ╣ñ╖ñ▐ñ╣íú╛π│▓ñ╧╠╛┴░ñ▐ñ┐ñ╧┐⌠╗·ñ╟╗╪─Ωñ╟ñ¡ñ▐ñ╣(sys/fault.h ╗▓╛╚)íúÑΩÑ╣Ñ╚ñ¼``!''ñ╟╗╧ñ▐ñδ╛∞╣τíó╗╪─Ωñ╡ñ∞ñ┐╛π│▓ñ¼Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ½ñΘ║∩╜ⁿñ╡ñ∞ñ▐ñ╣íú╛╩╬¼├═ñ╧ -mall -m!fltpage ñ╟ñ╣íú

-r [!] fd,. . .
╗╪─Ωñ╡ñ∞ñ┐╟ñ░╒ñ╬Ñ╒ÑíÑñÑδ╡¡╜╥╗╥ñ╦┤╪ñ╣ñδ│╞ read ñ╦┬╨ñ╖ñ╞íó╞■╜╨╬╧Ñ╨Ñ├Ñ╒Ñíñ╬┴┤╞Γ═╞ñ≥╝¿ñ╖ñ▐ñ╣íú╜╨╬╧ñ╧ 1 ╣╘ñ╦ñ─ñ¡ 32 Ñ╨ÑñÑ╚ñ╦Ñ╒Ñ⌐í╝Ñ▐Ñ├Ñ╚ñ╡ñ∞íó│╞Ñ╨ÑñÑ╚ñ≥ ASCII ╩╕╗·(└Φ╞¼ñ╦ 1 Ñ╓ÑΘÑ≤Ñ»ñ¼╔╒ñ¡ñ▐ñ╣)ñ½íó┐σ╩┐Ñ┐Ñ╓(\t)ñ¬ñΦñ╙▓■╣╘(\n)ñ╩ñ╔ñ╬└⌐╕µ╩╕╗·ñ╬ñ┐ñßñ╬ 2 ╩╕╗·ñ╬ C ╕└╕∞Ñ¿Ñ╣Ñ▒í╝Ñ╫Ñ╖í╝Ñ▒Ñ≤Ñ╣ñ╚ñ╖ñ╞╝¿ñ╖ñ▐ñ╣íú▓≥╝ßñ¼▓─╟╜ñ╟ñ╩ññ╛∞╣τíóÑ╨ÑñÑ╚ñ╧ 2 ╩╕╗· ñ╬ 16 ┐╩╔╜╕╜ñ╟╝¿ñ╡ñ∞ñ▐ñ╣íú(-r ñ¼ñ╩ññ╛∞╣τñ╟ñΓíóÑ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñ┐│╞ read ñ╦┬╨ñ╖ñ╞╞■╜╨╬╧Ñ╨Ñ├Ñ╒Ñíñ╬║╟╜Θñ╬ 16 Ñ╨ÑñÑ╚ñ¼╝¿ñ╡ñ∞ñ▐ñ╣íú) ╛╩╬¼├═ñ╧ -r!all ñ╟ñ╣íú

-w [!] fd,. . .
╗╪─Ωñ╡ñ∞ñ┐╟ñ░╒ñ╬Ñ╒ÑíÑñÑδ╡¡╜╥╗╥ñ╦┤╪ñ╣ñδ│╞ write ñ╦┬╨ñ╖ñ╞╞■╜╨╬╧Ñ╨Ñ├Ñ╒Ñíñ╬╞Γ═╞ñ≥╝¿ñ╖ñ▐ñ╣(-r ╗▓╛╚)íú╛╩╬¼├═ñ╧ -w!all ñ╟ñ╣íú

-o outfile
Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╦╗╚═╤ñ╣ñδÑ╒ÑíÑñÑδñ╟ñ╣íú╛╩╬¼╗■ñ╦ñ╧íó╔╕╜αÑ¿ÑΘí╝╜╨╬╧ñ╦╜╨╬╧ñ╡ñ∞ñ▐ñ╣íú

ѬÑ╫Ñ╖ÑτÑ≤ -tíó-v ñ¬ñΦñ╙ -x ñ¼╝⌡ñ▒╔╒ñ▒ñδ syscall ╠╛ñ╦ñ─ñññ╞ñ╧íó┬Φ 2 ╛╧ñ╬Ñ▐Ñ╦ÑσÑóÑδÑ┌í╝Ñ╕ñ≥╗▓╛╚ñ╖ñ╞ñ»ñ└ñ╡ññíúÑ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδ╚╓╣µñ╟ñΓ╝⌡ñ▒╔╒ñ▒ñΘñ∞ñ▐ñ╣íú

truss ñ≥╗╚═╤ñ╖ñ╞╗╪─Ωñ╡ñ∞ñ┐Ñ│Ñ▐Ñ≤Ñ╔ñ≥╡»╞░ñ¬ñΦñ╙Ñ╚Ñ∞í╝Ñ╣ñ╖ñ┐╛∞╣τíó-o ѬÑ╫Ñ╖ÑτÑ≤ñ≥╗╚═╤ñ╣ñδñ½íóñ▐ñ┐ñ╧╔╕╜αÑ¿ÑΘí╝ñ≥├╝╦÷ñ╟ñ╧ñ╩ññÑ╒ÑíÑñÑδñ╦┼╛┴≈ñ╣ñδñ╚íótruss ñ╧Ñ╧Ñ≤Ñ░ÑóÑ├Ñ╫íó│ΣñΩ╣■ñ▀íóñ¬ñΦñ╙╜¬╬╗Ñ╖Ñ░Ñ╩Ñδñ≥╠╡╗δñ╖ñ╞╝┬╣╘ñ╡ñ∞ñ▐ñ╣íúñ│ñ∞ñ╧íó├╝╦÷ñ½ñΘ│ΣñΩ╣■ñ▀Ñ╖Ñ░Ñ╩Ñδñ╚╜¬╬╗Ñ╖Ñ░Ñ╩Ñδñ≥╝⌡ñ▒╝Φñδ┬╨╧├╖┐Ñ╫ÑφÑ░ÑΘÑαñ╬Ñ╚Ñ∞í╝Ñ╣ñ≥═╞░╫ñ╦ñ╖ñ▐ñ╣íú

Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ≥├╝╦÷ñ╦┼╛┴≈ñ╖ñ┐ñ▐ñ▐ñ╦ñ╖ñ┐╛∞╣τíóñ▐ñ┐ñ╧┤√┬╕ñ╬Ñ╫ÑφÑ╗Ñ╣ñ≥Ñ╚Ñ∞í╝Ñ╣ñ╣ñδ╛∞╣τ(-p ѬÑ╫Ñ╖ÑτÑ≤)íótruss ñ╧Ñ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñ┐ñ╣ñ┘ñ╞ñ╬Ñ╫ÑφÑ╗Ñ╣ñ╚┤√┬╕ñ╬Ñ╫ÑφÑ╗Ñ╣ñ≥▓≥╩ⁿñ╖íó╜¬╬╗ñ╡ñ╗ñδñ│ñ╚ñ╦ñΦñ├ñ╞Ñ╧Ñ≤Ñ░ÑóÑ├Ñ╫íó│ΣñΩ╣■ñ▀íóñ¬ñΦñ╙╜¬╬╗Ñ╖Ñ░Ñ╩Ñδñ╦▒■┼·ñ╖ñ▐ñ╣íúñ│ñ∞ñ╦ñΦñ├ñ╞íóѵí╝Ñ╢ñ╧▓ß┼┘ñ╬Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ≥╜¬╬╗ñ╖íó┴░ñ╦┬╕║▀ñ╖ñ┐Ñ╫ÑφÑ╗Ñ╣ñ≥▓≥╩ⁿñ╟ñ¡ñ▐ñ╣íú▓≥╩ⁿñ╡ñ∞ñ┐Ñ╫ÑφÑ╗Ñ╣ñ╧íó▓┐ñ╬▒╞╢┴ñΓñ╩ñ»ñ╜ñ∞ñ▐ñ╟ñ╔ñ¬ñΩ╔ß─╠ñ╦╜Φ═²ñ≥┬│ñ▒ñ▐ñ╣íú

╗╚═╤╬π

▓╝╡¡ñ╬╬πñ╟ñ╧├╝╦÷╛σñ╬ find(1) Ñ│Ñ▐Ñ≤Ñ╔ñ╬Ñ╚Ñ∞í╝Ñ╣ñ≥└╕└«ñ╖ñ▐ñ╣íú
 
   truss find . -print >find.out 

ñ▐ñ┐ñ╧íóopeníócloseíóreadíówrite ñ╬│╞Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╬Ñ╚Ñ∞í╝Ñ╣ñ└ñ▒ñ≥╣╘ñªñ┐ñßñ╦ñ╧▓╝╡¡ñ╬ñΦñªñ╦╗╪─Ωñ╖ñ▐ñ╣íú

 
   truss -t open,close,read,write find . -print > find.out 

ñ│ñ∞ñ╧íóÑ╒ÑíÑñÑδ truss.out ñ╟ spell(1) Ñ│Ñ▐Ñ≤Ñ╔ñ╬Ñ╚Ñ∞í╝Ñ╣ñ≥└╕└«ñ╖ñ▐ñ╣íú

 
   truss -f -o truss.out spell document 

spell ñ╧Ñ╖ѺÑδÑ╣Ñ»ÑΩÑ╫Ñ╚ñ╟ñ╣íúñ╖ñ┐ñ¼ñ├ñ╞íóÑ╖ѺÑδñ└ñ▒ñ╟ñ╩ñ»íóÑ╖ѺÑδñ╦ñΦñ├ñ╞└╕└«ñ╡ñ∞ñδÑ╫ÑφÑ╗Ñ╣ñΓÑ╚Ñ∞í╝Ñ╣ñ╣ñδñ┐ñßñ╦ñ╧ -f Ñ╒ÑΘÑ░ñ¼╔¼═╫ñ╟ñ╣íú(spell Ñ╣Ñ»ÑΩÑ╫Ñ╚ñ╧ 8 ñ─ñ╬╢ª┬╕ñ╣ñδÑ╫ÑφÑ╗Ñ╣ñ╬Ñ╤ÑñÑ╫ÑΘÑñÑ≤ñ≥╝┬╣╘ñ╖ñ▐ñ╣íú)

▓╝╡¡ñ╬╬πñ╧íó╞├ñ╦Ñ╚Ñ∞í╝Ñ╣╜╨╬╧▓≥└╧ñ¼┬τ╩╤ñ╩╛∞╣τñ╟ñ╣íú

 
   truss nroff -mm document > nroff.out 

ñ│ñ∞ñ╧íó╜╨╬╧ñ╬ 97% ñ¼ lseekíóread ñ¬ñΦñ╙ write ñ╬Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ≥─╠├╬ñ╣ñδñ½ñΘñ╟ñ╣íúñ│ñ∞ñ≥╛╩╬¼ñ╣ñδñ╦ñ╧íó▓╝╡¡ñ╬ñΦñªñ╦╗╪─Ωñ╖ñ▐ñ╣íú

 
   truss -t !lseek,read,write nroff -mm document > nroff.out 

ñ│ñ╬╬πñ╧íó(ѵí╝Ñ╢ñ¼╞├╕óѵí╝Ñ╢ñ╬╛∞╣τ)Ñ╫ÑφÑ╗Ñ╣ #1 ñ╬ÑóÑ»Ñ╞ÑúÑ╙Ñ╞Ñú init(1M) ñ≥╛▄║┘ñ╦Ñ╚Ñ∞í╝Ñ╣ñ╖ñ▐ñ╣íú

 
   truss -p -v all 1 

truss ñ╬│ΣñΩ╣■ñ▀ñ≥╣╘ñªñ╚íóinit ñ¼─╠╛∩╞░║εñ╦╩╓ñ╡ñ∞ñ▐ñ╣íú

Ñ╒ÑíÑñÑδ

/proc/nnnnn
Ñ╫ÑφÑ╗Ñ╣Ñ╒ÑíÑñÑδ

├φ░╒

┬Φ 2 ╛╧ñ╬Ñ▐Ñ╦ÑσÑóÑδÑ┌í╝Ñ╕ñ╟╡¡╜╥ñ╡ñ∞ñ╞ñññδÑ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╬ñ╩ñ½ñ╦ñ╧íó╝┬║▌ñ╬ѬÑ┌Ñ∞í╝Ñ╞ÑúÑ≤Ñ░Ñ╖Ñ╣Ñ╞ÑαÑñÑ≤Ñ┐Ñ╒Ѻí╝Ñ╣ñ╚ñ╧░█ñ╩ñδñΓñ╬ñ¼ñóñΩñ▐ñ╣íú┬Φ 2 ╛╧ñ╬└Γ╠└ñ╚Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╧┬┐╛»ñ»ññ░πñª╛∞╣τñΓñóñΩñ▐ñ╣íú

(Ñ┌í╝Ñ╕╛π│▓ñ≥╜ⁿñ¡)ñ╣ñ┘ñ╞ñ╬Ñ▐Ñ╖Ñ≤╛π│▓ñ╧íó╛π│▓ñ¼╚»└╕ñ╖ñ┐Ñ╫ÑφÑ╗Ñ╣ñ╪ñ╬Ñ╖Ñ░Ñ╩Ñδñ╬┼╛╡¡ñ╦╜¬ñ∩ñΩñ▐ñ╣íúÑ╖Ñ░Ñ╩Ñδñ≥Ñ╫ÑφÑ╗Ñ╣ñ¼Ñ╓ÑφÑ├Ñ»ñ╖ñ╩ññ╛∞╣τíó(Ñ┌í╝Ñ╕╛π│▓ñ≥╜ⁿñ¡)│╞Ñ▐Ñ╖Ñ≤╛π│▓ñ¼─╠├╬ñ╡ñ∞ñ┐─╛╕σñ╦íó╝⌡┐«Ñ╖Ñ░Ñ╩Ñδñ¼─╠├╬ñ╡ñ∞ñ▐ñ╣íú

ѬÑ┌Ñ∞í╝Ñ╞ÑúÑ≤Ñ░Ñ╖Ñ╣Ñ╞Ñαñ╧Ñ╫ÑφÑ╗Ñ╣ñ╬Ñ╚Ñ∞í╝Ñ╣ñ╦░∞─Ωñ╬Ñ╗Ñ¡ÑσÑΩÑ╞Ñú└⌐╠≤ñ≥▓▌ñ╖ñ▐ñ╣íú╞├ñ╦íóѵí╝Ñ╢ñ¼╞╔ñ▀╜╨ñ╗ñ╩ññѬÑ╓Ñ╕ѺѻÑ╚Ñ╒ÑíÑñÑδ(a.out)ñ≥╗²ñ─ñññ║ñ∞ñ╬Ñ│Ñ▐Ñ≤Ñ╔ñΓíóñ╜ñ╬ѵí╝Ñ╢ñ╧Ñ╚Ñ∞í╝Ñ╣ñ╟ñ¡ñ▐ñ╗ñ≤íúÑ│Ñ▐Ñ≤Ñ╔ set-uid ñ¬ñΦñ╙ set-gid ñ╧╞├╕óѵí╝Ñ╢ñ╖ñ½Ñ╚Ñ∞í╝Ñ╣ñ╟ñ¡ñ▐ñ╗ñ≤íú╞├╕óѵí╝Ñ╢ñ¼╝┬╣╘ñ╣ñδ╛∞╣τñ≥╜ⁿñ¡íótruss ñ╧ set-id ñ▐ñ┐ñ╧╞╔ñ▀╜╨ñ╖╔╘▓─╟╜ñ╩ѬÑ╓Ñ╕ѺѻÑ╚Ñ╒ÑíÑñÑδñ╬ exec(2) ñ≥╝┬╣╘ñ╣ñδñññ║ñ∞ñ╬Ñ╫ÑφÑ╗Ñ╣ñ╬└⌐╕µñΓ╝║ñññ▐ñ╣íúñ╜ñ╬ñΦñªñ╩Ñ╫ÑφÑ╗Ñ╣ñ╧ truss ñ½ñΘ╞╚╬⌐ñ╖ñ╞íóexec ñ╬Ñ▌ÑñÑ≤Ñ╚ñ½ñΘ─╠╛∩ñ╔ñ¬ñΩ╜Φ═²ñ≥┬│ñ▒ñ▐ñ╣íú

┬╛ñ╬└⌐╕µÑ╫ÑφÑ╗Ñ╣ñ╚ñ╬╛╫╞═ñ≥╚≥ñ▒ñδñ┐ñßñ╦íótruss ñ╧ /proc ÑñÑ≤Ñ┐Ñ╒Ѻí╝Ñ╣ñ≥─╠ñ╖ñ╞╩╠ñ╬Ñ╫ÑφÑ╗Ñ╣ñ╦ñΦñ├ñ╞└⌐╕µñ╡ñ∞ñ╞ñññδÑ╫ÑφÑ╗Ñ╣ñ≥Ñ╚Ñ∞í╝Ñ╣ñ╖ñ▐ñ╗ñ≤íúñ│ñ╬ñ┐ñßíótruss ñ╧┬╛ñ╬╛∞╣τñ╚╞▒══ñ╦ proc(4) ñ≥┤≡ñ╦ñ╖ñ┐Ñ╟Ñ╨Ñ├Ѽñ╦┼¼═╤ñ╟ñ¡ñ▐ñ╣íú

Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╦ñ╧íó(8 Ñ▌Ñ╕Ñ╖ÑτÑ≤ñ┤ñ╚ñ╦)╔╕╜αÑ┐Ñ╓Ñ╣Ñ╚Ñ├Ñ╫ñ¼└▀─Ωñ╡ñ∞ñ╞ñññδñ╚▓╛─Ωñ╖ñ╞íóÑ┐Ñ╓╩╕╗·ñ¼┤▐ñ▐ñ∞ñ▐ñ╣íú

╩ú┐⌠ñ╬Ñ╫ÑφÑ╗Ñ╣ñ╦┬╨ñ╣ñδÑ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╧╕╖╠⌐ñ╦╗■┤╓╜τñ╦ñ╧└╕└«ñ╡ñ∞ñ▐ñ╗ñ≤íú╬πñ¿ñ╨íóÑ╤ÑñÑ╫ñ╦┤╪ñ╖ñ╞ñ╬ read ñ╧íó┬╨▒■ñ╣ñδ write ñ╬┴░ñ╦─╠├╬ñ╡ñ∞ñ▐ñ╣íú╟ñ░╒ñ╬ 1 Ñ╫ÑφÑ╗Ñ╣ñ╦┬╨ñ╖ñ╞ñ╧íó╜╨╬╧ñ╧╕╖╠⌐ñ╦╗■┤╓╜τñ╦╣╘ñ╩ñ∩ñ∞ñ▐ñ╣íú

Ñ╖Ñ╣Ñ╞Ñαñ╧╗╥ñ╬Ñ╚Ñ∞í╝Ñ╣ñ≥═╫╡ßñ╡ñ∞ñδñ╚íóѵí╝Ñ╢ñ┤ñ╚ñ╬Ñ╫ÑφÑ╗Ñ╣Ñ╣ÑφÑ├Ñ╚ñ≥╗╚ññ▓╠ñ┐ñ╣ñ½ñΓñ╖ñ∞ñ▐ñ╗ñ≤íú╩ú┐⌠ñ╬Ñ╫ÑφÑ╗Ñ╣ñ≥Ñ╚Ñ∞í╝Ñ╣ñ╣ñδñ╚ñ¡íótruss ñ╧Ñ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñδ│╞Ñ╫ÑφÑ╗Ñ╣ñ╦┬╨ñ╖ñ╞ 1 ñ─ñ╬└⌐╕µÑ╫ÑφÑ╗Ñ╣ñ╚ñ╖ñ╞╝┬╣╘ñ╖ñ▐ñ╣íú╬πñ¿ñ╨╛σ╡¡ñ╬ spell Ñ│Ñ▐Ñ≤Ñ╔ñ╧íóspell ╝½┐╚ñ¼ 9 ñ─ñ╬Ñ╫ÑφÑ╗Ñ╣Ñ╣ÑφÑ├Ñ╚ñ≥╗╚ñññ▐ñ╣íú1 ñ─ñ╧Ñ╖ѺÑδ═╤ñ╟ñóñΩíó8 ñ─ñ╧ 8 ÑßÑ≤Ñ╨ñ╬Ñ╤ÑñÑ╫ÑΘÑñÑ≤═╤ñ╟ñ╣íútruss ñ╧ñ│ñ∞ñ╦ 9 Ñ╫ÑφÑ╗Ñ╣ñ≥─╔▓├ñ╖íó╣τ╖╫ñ╧ 18 Ñ╫ÑφÑ╗Ñ╣ñ╦ñ╩ñΩñ▐ñ╣íúñ│ñ∞ñ╧ѵí╝Ñ╢ñ┤ñ╚ñ╦ 25 Ñ╫ÑφÑ╗Ñ╣ñ╚ñññªÑ╖Ñ╣Ñ╞Ñαñ¼▓▌ñ╣─╠╛∩ñ╬└⌐╕┬ñ╦╢ßñ»íó┤φ╕▒ñ╟ñ╣íú

truss ñ╧╩ú┐⌠ñ╬Ñ╫ÑφÑ╗Ñ╣ñ≥╜Φ═²ñ╣ñδñ╚ñ¡(-f ѬÑ╫Ñ╖ÑτÑ≤ñ▐ñ┐ñ╧╩ú┐⌠ñ╬``pid''ñ≥╚╝ñª -p)íó╢ª═╤ÑßÑΓÑΩñ¬ñΦñ╙Ñ╗Ñ▐Ñ╒Ñ⌐ñ≥╗╚ñññ▐ñ╣íúñ│ñ∞ñΘñ¼╔¼═╫ñ╟ñóñδñ¼Ñ╖Ñ╣Ñ╞Ñα╞Γñ╟╣╜└«ñ╡ñ∞ñ╞ñññ╩ñññ╚ñ¡íótruss ñ╧╖┘╣≡ÑßÑ├Ñ╗í╝Ñ╕ñ≥╚»╣╘ñ╖ñ╞╝┬╣╘ñ≥╖╤┬│ñ╖ñ▐ñ╣íúñ┐ñ└ñ╖íóñ│ñ╬╛∞╣τíóÑ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╧╕φñ├ñ┐ñΓñ╬ñ╚ñ╩ñΩíó-c ѬÑ╫Ñ╖ÑτÑ≤ñ╬╜╨╬╧ñ╧Ñ╚Ñ├Ñ╫Ñ∞Ñ┘Ñδñ╬Ñ│Ñ▐Ñ≤Ñ╔ñ½║╟╜Θñ╬``pid''ñ└ñ▒ñ≥─╠├╬ñ╖íó╗╥ñ╧┐⌠ñ¿ñΘñ∞ñ▐ñ╗ñ≤íú

ñ╣ñ┘ñ╞ñ╬▓─╟╜ñ╩Ñ╖Ñ╣Ñ╞ÑαÑ│í╝Ñδñ╟┼╧ñ╡ñ∞ñδñ╣ñ┘ñ╞ñ╬▓─╟╜ñ╩╣╜┬ñ┬╬ñ¼ -v ѬÑ╫Ñ╖ÑτÑ≤ñ╟╔╜╝¿ñ╡ñ∞ñδñ∩ñ▒ñ╟ñ╧ñóñΩñ▐ñ╗ñ≤íú

┤╪╧ó╣α╠▄

intro(2), proc(4)
SCO UnixWare Forum Beta Release (BL12) -- September 1997
© 1997 The Santa Cruz Operation, Inc. All rights reserved.