Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pstat(C) — OpenDesktop 2.0.0a

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

alarm(S)

chmod(S)

filesystem(FP)

lseek(S)

nice(C)

ps(C)

stat(S)


 pstat(C)                        19 June 1992                        pstat(C)


 Name

    pstat - reports system information

 Syntax

    pstat [ -aipf ] [ -u|-U ubase1 ubase2 ] [ -n namelist ] [ -s swapfile ]
    [ file ]

 Description

    The pstat command interprets the contents of certain system tables.
    pstat searches for these tables in /dev/mem and /dev/kmem.  With the file
    given, the tables are sought in the specified file rather than /dev/mem.
    The required namelist is taken from /unix.

    pstat without options prints information for all three tables:  the inode
    table, the process table, and the file table.

    Options are:

    -a     Must be used with -p.  Describe all process slots rather than just
           active ones.

    -i     Prints the inode table with these headings:

           LOC         The core location of this table entry.

           FLAGS       Miscellaneous state variables:

                       L      Locked

                       U      Update time must be corrected

                       A      Access time must be corrected

                       M      File system is mounted here

                       W      Wanted by another process (L flag is on)

                       T      Contains a text (executable image) file

                       C      Changed time must be corrected

           CNT         Number of open file table entries for this inode.

           DEVICE      Major and minor device number of file system in which
                       this inode resides.

           INO         I-number within the device.

           FS          Filesystem type.  1 indicates UNIX.

           MODE        Mode bits, see chmod(S).

           NLK         Number of links to this inode.

           UID         User ID of owner.

           SIZE/DEV    Number of bytes in an ordinary file, or major and
                       minor device of special file.

    -p     Prints process table for active processes with these headings:

           LOC    The core location of this table entry.

           S      Run state encoded thus:

                  0   No process.

                  1   Awaiting an event.

                  2   Running.

                  3   Process terminated but not waited for.

                  4   Process stopped by debugger.

                  5   Intermediate state in process creation.

                  6   Process is being run on a processor.

                  7   Process being xswapped.

           F      Miscellaneous state variables, ORed together:

                  0x00000001    System (resident) process.

                  0x00000002    Process is being traced.

                  0x00000004    Ptraced process has been given to parent by
                                wait(S); Don't return this process to parent
                                again until it runs first.

                  0x00000008    Process cannot be awakened by a signal.

                  0x00000010    In core.

                  0x00000020    Process cannot be swapped.

                  0x00000040    Set when signal goes remote.

                  0x00000080    Process in stream poll or doing select().

                  0x00000100    Process is being stopped via /proc.

                  0x00000200    Signal or syscall tracing via /proc.

                  0x00000400    Doing I/O via /proc, so don't run.

                  0x00000800    Stop on exec.

                  0x00001000    Process is open via /proc.

                  0x00002000    U-block in core.

                  0x00004000    Set process running on last /proc close.

                  0x00008000    Proc asleep, stop not allowed.

                  0x00010000    Process is exiting via ptrace(S).  0x00020000
                                Proc is stopped within a call to sleep(C).

                  0x00040000    U-block is being swapped in or out.

                  0x00080000    Waiting for u-block swap to complete.

                  0x00100000    Restore old mask after taking signal.

                  0x00200000    Child of a fork, but no exec yet.

           PRI    Scheduling priority, see nice(C).

           SIG    Signals received (signals 1-16 coded in bits 0-15).

           UID    Real user ID.

           TIM    Time resident in seconds; times over 127 coded as 127.

           CPU    Weighted integral of CPU time, for scheduler.

           NI     Nice level, see nice(C).

           PGRP   Process number of root of process group (the opener of the
                  controlling terminal).

           PID    The process ID number.

           PPID   The process ID of parent process.

           ADDR1
           ADDR2  If in core, the physical page frame numbers of the u-area
                  of the process. These numbers can be translated into the
                  addresses of the u-area, which is split and stored in two
                  pages.  If swapped out, the position in the swap area is
                  measured in multiples of 1024 bytes.

           WCHAN  Wait channel number of a waiting process.

           LINK   Link pointer in list of runnable processes.

           INODP  Pointer to location of shared inode.

           CLKT   Countdown for alarm(S) measured in seconds.

    -f     Prints the open file table with these headings:

           LOC    The core location of this table entry.

           FLAGS  Miscellaneous state variables:

                  R      Open for reading

                  W      Open for writing
                  A      Open for append

                  N      No delay (non-blocking)

                  S      Synchronized write operation

           CNT    Number of processes that know this open file.

           INO    The location of the inode table entry for this file.

           OFFS   The file offset, see lseek(S).

    -u ubase1 ubase2
           Prints information about a user process.  Information is drawn
           from the user area as defined in /usr/include/user.h.  ubase1 and
           ubase2 are the physical page frame numbers of the u-area of the
           process.  The numbers may be obtained by using the long listing
           (-l option) of the ps(C) command.  If the addresses ubase1 and
           ubase2 do not correspond to a valid u-page, then pstat exits with
           an error.

    -U ubase1 ubase2
           -U is the same as -u, only it gets the u-area from the swap de-
           vice.

    -n namelist
           Use the file namelist as an alternate namelist in place of /unix.

    -s swapfile
           Use swapfile as the swapfile.  file Source of tables as an
           alternative to /dev/mem.


 Files

    /unix        Default namelist
    /dev/mem     Default source of tables
    /dev/swap    Default swap device

 See also

    alarm(S), chmod(S), filesystem(FP), lseek(S), nice(C), ps(C), stat(S)

    System Administrator's Guide

 Authorization

    The behavior of this utility is affected by assignment of the mem author-
    ization.  If you do not have this authorization, the output will be re-
    stricted to data pertaining to your activities only.  Refer to the
    ``Using a secure system'' chapter of the User's Guide for more details.

 Value added

    pstat is an extension of AT&T System V provided by The Santa Cruz Opera-
    tion, Inc.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026