Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

acct.h(4)  —  File Formats

OSF

NAME

acct.h − Account include files

SYNOPSIS

#include <sys/acct.h>

#include <utmp.h>

DESCRIPTION

The /usr/include/sys/acct.h header file defines a type acct structure for accounting information used by various accounting files. The information in the acct.h structure is used in records in accounting files having various fixed formats. 

The various accounting files provide the means to monitor system use and performance and to pass charges to system users. These accounting files also serve as the permanent record of billing information for each process, CPU real time, allocated resources, and services. The acct command is used to produce desired accounting files. 

The /usr/include/utmp.h header file defines the record format for data written to the /var/adm/wtmp accounting login/logout database file whenever any user logs in or out. The type utmp structure defined in the /usr/include/utmp.h header file has the following members:

char ut_user[32]
The user login name listed in the /etc/passwd file. 

char ut_id[14]
The user identification from the /etc/inittab ID file. 

char ut_line[32]
The device name (console or tty43, for example).

short ut_type
This is a flag that defines the type of entry. The type of entry flag symbolic names are as follows:

EMPTYNo valid entry. 

RUN_LVLRun level changed by the init program. 

BOOT_TIME
Boot time entry, generated by the init program. 

OLD_TIME
Used by the date program when the system time is changed. 

NEW_TIME
Used by the date program when the system time is changed. 

INIT_PROCESS
Process spawned by the init program. 

LOGIN_PROCESS
A getty process waiting for login. 

USER_PROCESS
A user process.

DEAD_PROCESS
Terminated process.

ACCOUNTING
Private flag for accounting programs.

pid_t ut_pid
Process ID number.

short ut_exit.e_termination
Process termination status of a process whose ut_type member value is DEAD PROCESS. 

short ut_exit.e_exit
Process exit status of a process whose ut_type member value is DEAD PROCESS. 

time_t ut_time
Time that entry was made.

char ut_host[64]
Host machine name.

The /usr/include/sys/acct.h header file defines the record format for the data written to the process accounting database file when a process completes.  The type acct structure defined in the acct.h header file contains the following members:

char ac_flag
An accounting flag for the process for which the accounting record is written. The accounting flag symbolic names are as follows:

AFORKThe process has been created using a fork() system call, but an exec() system call has not yet concluded. The exec() system call resets the AFORK flag. 

ASUSuperuser privileges have been invoked. 

ACOMPATCompatibility mode used. 

ACOREDumped core. 

AXSIGProcess killed by a signal. 

char ac_stat
Exit status. A flag that indicates how the process terminated.

uid_t ac_uid
The user ID of the process for which the accounting record is written.

gid_t ac_gid
The group ID of the process for which the accounting record is written.

dev_t ac_tty
The terminal from which the process was started.

time_t ac_btime
Beginning time. The time at which the process began.

comp_t ac_utime
The amount of user time (in a compressed format) used by the process.

comp_t ac_stime
The amount of system time (in a compressed format) used by the process.

comp_t ac_etime
The amount of elapsed time (in a compressed format) since the command ran.

short ac_mem
The average amount of memory used by the process.

comp_t ac_io
The number of characters (in a compressed format) transferred by the process.

comp_t ac_rw
The number of blocks (in a compressed format) read or written by the process.

char ac_comm[8]
The name of the command that was used to start the process. A child process created by a fork() system call receives up to 8 bytes from the parent process. An exec() system call changes the name in this field. 

Compressed data, which is a condensed floating-point representation, may be expanded to normal floating point by using the expacct() routine. 

The type tacct structure, which is not a part of the /usr/include/utmp.h or the /usr/include/sys/acct.h header file definitions, is defined in a private tacct.h header file. The type tacct structure members define a format for storage of all information available from both the /var/adm/wtmp login/logoff and /var/adm/pacct process accounting databases, whose members are used by various accounting commands to produce an output file to be used in an accounting report (see the acctmerg command). Members of the type tacct structure whose data types are specified as an array of two double elements have both prime-time and non-prime time values. The type tacct structure has the following members:

uid_t ta_uid
User ID.

char ta_name[NSZ]
A field for the login name having the same number of characters NSZ as the ut_user member of the utmp structure. 

double ta_cpu[2]
Cumulative CPU time in minutes.

double ta_kcore[2]
Cumulative Kcore minutes.

double ta_io[2]
Cumulative number of characters transferred in blocks of 512 bytes.

double ta_rw[2]
Cumultive number of blocks read and written.

double ta_con[2]
Cumulative connect time in minutes.

double ta_du
Cumulative disk usage time in minutes.

long ta_qsys
Queueing system (printer) fee in number of pages.

double ta_fee
Special services fee.

long ta_pcA count of the number of processes. 

unsigned short ta_sc
A count of the number of login sessions.

unsigned short ta_dc
A count of the number of disk samples.

FILES

/usr/include/sys/acct.h, /usr/include/utmp.h
Accounting header files that define formats for writing accounting files.

/var/adm/wtmp
The active login/logoff database file.

/var/adm/pacct
The active process accounting database file.

RELATED INFORMATION

Commands: acct/∗, acctcms, acctcom, acctcon, acctdisk, acctmerg, acctprc, runacct, sa

Functions: acct(), fork(), exec(), expacct()

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