Module Name: src Committed By: martin Date: Sun Oct 13 15:50:27 UTC 2024
Modified Files: src/share/man/man5 [netbsd-9]: acct.5 Log Message: Pull up following revision(s) (requested by riastradh in ticket #1910): share/man/man5/acct.5: revision 1.10 share/man/man5/acct.5: revision 1.11 share/man/man5/acct.5: revision 1.12 Explain the state of ASU and ACOMPAT. PR/58515: Kouichi Hashikawa: Sync with the header file reference the correct function called. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.9.78.1 src/share/man/man5/acct.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man5/acct.5 diff -u src/share/man/man5/acct.5:1.9 src/share/man/man5/acct.5:1.9.78.1 --- src/share/man/man5/acct.5:1.9 Fri Dec 22 08:00:20 2006 +++ src/share/man/man5/acct.5 Sun Oct 13 15:50:27 2024 @@ -1,4 +1,4 @@ -.\" $NetBSD: acct.5,v 1.9 2006/12/22 08:00:20 ad Exp $ +.\" $NetBSD: acct.5,v 1.9.78.1 2024/10/13 15:50:27 martin Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)acct.5 8.1 (Berkeley) 6/5/93 .\" -.Dd December 22, 2006 +.Dd August 5, 2024 .Dt ACCT 5 .Os .Sh NAME @@ -43,7 +43,7 @@ The kernel maintains the following information structure for all processes. If a process terminates, and accounting is enabled, the kernel calls the -.Xr acct 2 +.Xr acct_process 9 function call to prepare and append the record to the accounting file. .Bd -literal @@ -52,25 +52,25 @@ to the accounting file. * exponent, 13 bit fraction ``floating point'' number. Units are 1/AHZ * seconds. */ -typedef u_short comp_t; +typedef uint16_t comp_t; struct acct { - char ac_comm[10]; /* name of command */ - comp_t ac_utime; /* user time */ - comp_t ac_stime; /* system time */ - comp_t ac_etime; /* elapsed time */ - time_t ac_btime; /* starting time */ - uid_t ac_uid; /* user id */ - gid_t ac_gid; /* group id */ - short ac_mem; /* memory usage average */ - comp_t ac_io; /* count of IO blocks */ - dev_t ac_tty; /* controlling tty */ -#define AFORK 0x01 /* forked but not execed */ + char ac_comm[16]; /* name of command */ + comp_t ac_utime; /* user time */ + comp_t ac_stime; /* system time */ + comp_t ac_etime; /* elapsed time */ + time_t ac_btime; /* starting time */ + uid_t ac_uid; /* user id */ + gid_t ac_gid; /* group id */ + uint16_t ac_mem; /* memory usage average */ + comp_t ac_io; /* count of IO blocks */ + dev_t ac_tty; /* controlling tty */ +#define AFORK 0x01 /* fork'd but not exec'd */ #define ASU 0x02 /* used super-user permissions */ #define ACOMPAT 0x04 /* used compatibility mode */ #define ACORE 0x08 /* dumped core */ #define AXSIG 0x10 /* killed by a signal */ - char ac_flag; /* accounting flags */ + uint8_t ac_flag; /* accounting flags */ }; /* @@ -79,9 +79,10 @@ struct acct { */ #define AHZ 64 -#ifdef KERNEL -struct vnode *acctp; -#endif +#ifdef _KERNEL +void acct_init(void); +int acct_process(struct lwp *); +endif .Ed .Pp If a terminated process was created by an @@ -92,22 +93,43 @@ is saved in the field and its status is saved by setting one of more of the following flags in .Fa ac_flag : .Dv AFORK , -.Dv ACORE +.Dv ACORE , and -.Dv ASIG . +.Dv AXSIG . .Pp The .Dv ASU -and +flag is not recorded anymore because with the switch to +.Xr kauth 9 , +the superuser model is optional and passing the affected process to every +authorization call in order to record +.Dv ASU +in +.Fa p_acflag , +would require many source changes and would not reflect reality because +the authorization decision might not have been done based on the +.Xr secmodel_suser 9 +model. +.Pp +The +.Dv ACOMPAT +flag was never recorded in +.Nx ; +we could consider setting when the a process is running under emulation, +but this is not currently done. +.Pp +Both the +.Dv ASU +and the .Dv ACOMPAT -flags are no longer recorded by the system, but are retained for source -compatibility. +flags are retained for source compatibility. .Sh SEE ALSO .Xr lastcomm 1 , .Xr acct 2 , .Xr execve 2 , .Xr accton 8 , -.Xr sa 8 +.Xr sa 8 , +.Xr acct_process 9 .Sh HISTORY A .Nm