If the kernel was compiled with the process accounting option enabled,
the system call
acct("/somewhere/accountingfile");
will start the process accounting. Each time a process terminates
a record for this process is appended to the accounting file.
The accounting structure
struct acct is also described in the file
/usr/include/linux/acct.h .