Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ acct(5) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

acct

utmp, wtmp, .ilog

acctcom

acct

Purpose

     Provides the accounting file format for each process.

Synopsis

     #include <sys/acct.h>

Description

     The accounting files  provide a means to  monitor the use
     of the  system.  These files  also serve as a  method for
     billing each process for  processor usage, materials, and
     services.   The  acct  system  call  produces  accounting
     files.   The <sys/acct.h>  file  defines  the records  in
     these files.  The content of the records are:

          /* Accounting structures */
          typedef ushort comp_t;     /* floating point */
                     /* 13-bit fraction, 3-bit exponent */

          struct acct
          {
               char  ac_flag;    /* Accounting flag */
               char  ac_stat;    /* Exit status */
               ushort  ac_uid;   /* Accounting user-ID */
               ushort  ac_gid;   /* Accounting group-ID */
               dev_t  ac_tty;    /* control typewriter */
               time_t  ac_btime; /* Beginning time */
               comp_t  ac_utime; /* accounting user time in clock ticks */
               comp_t  ac_stime; /* accounting system time in clock ticks */
               comp_t  ac_etime; /* accounting elapsed time in clock ticks */
               comp_t  ac_mem;   /* memory usage */
               comp_t  ac_io;    /* chars transferred */
               comp_t  ac_rw;    /* blocks read or written */
               char  ac_comm[8]; /* command name */
          };

          extern struct  acct  acctbuf;
          extern struct  inode  *acctp; /* i-node of accounting file */

          #define AFORK  01            /* has executed fork, but no exec */
          #define ASU    02            /* used superuser authority */
          #define ACCTF  0300          /* record type: 00 = acct */

     The fields are as follows:

     ac_comm   This field contains the  command name.  A child
               process,  created   by  a  fork   system  call,
               receives  this  information   from  the  parent
               process.   An  exec  system  call  resets  this
               field.

     ac_flag   This field  indicates whether the  process used
               superuser authority, or it  was created using a
               fork command  but not  yet followed by  an exec
               system call.  The fork  command turns the AFORK
               flag in this field on  and the exec system call
               turns the AFORK flag off.

     ac_mem    This  field contains  memory  usage.  For  each
               clock tick, the system  updates this field with
               the current process size and charges usage time
               to   the   process.    This  is   computed   as
               ((data size)  + (text size))  / (number  of in-
               memory processes using text)

     The following  structure (not part of  acct.h) represents
     the  total   accounting  format   used  by   the  various
     accounting commands:

       /* Float arrays below contain prime time and non-prime time
          components */

          struct tacct {
            uid_t  ta_uid;            /* user-ID */
            char   ta_name[8];        /* login name */
            float  ta_cpu[2];         /* cum. CPU time, p/np (mins) */
            float  ta_kcore[2];       /* cum. kcore-mins, p/np */
            float  ta_io[2];          /* cum. chars xferred (512s) */
            float  ta_rw[2];          /* cum. blocks read/written */
            float  ta_con[2];         /* cum. connect time, p/np, mins */
            float  ta_du;             /* cum. disk usage */
            long   ta_qsys;           /* queuing sys charges (pgs) */
            float  ta_fee;            /* fee for special services */
            long   ta_pc;             /* count of processes */
            unsigned short  ta_sc;    /* count of login sessions */
            unsigned short  ta_dc;    /* count of disk samples */
          };

File

     /usr/include/sys/acct.h

Related Information

     In this book:  "acct" and "utmp, wtmp, .ilog."

     The acctcom command in AIX Operating System Commands Ref-
     erence.

     The  acct, acctcms,  acctcon, acctmerg,  acctprc, acctsh,
     diskusg, and  runacct procedures in AIX  Operating System
     Commands Reference.

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