/* kern_resource.c 4.2 %G% */
* Perform process accounting functions.
register struct inode
*ip
;
uap
= (struct a
*)u
.u_ap
;
if((ip
->i_mode
& IFMT
) != IFREG
) {
* On exit, write a record on the accounting file.
register struct inode
*ip
;
for (i
=0; i
<sizeof(acctbuf
.ac_comm
); i
++)
acctbuf
.ac_comm
[i
] = u
.u_comm
[i
];
acctbuf
.ac_utime
= compress((long)u
.u_vm
.vm_utime
);
acctbuf
.ac_stime
= compress((long)u
.u_vm
.vm_stime
);
acctbuf
.ac_etime
= compress((long)(time
- u
.u_start
));
acctbuf
.ac_btime
= u
.u_start
;
acctbuf
.ac_uid
= u
.u_ruid
;
acctbuf
.ac_gid
= u
.u_rgid
;
if (i
= u
.u_vm
.vm_utime
+ u
.u_vm
.vm_stime
)
acctbuf
.ac_mem
= (u
.u_vm
.vm_ixrss
+ u
.u_vm
.vm_idsrss
) / i
;
acctbuf
.ac_io
= compress((long)(u
.u_vm
.vm_inblk
+ u
.u_vm
.vm_oublk
));
acctbuf
.ac_tty
= u
.u_ttyd
;
acctbuf
.ac_flag
= u
.u_acflag
;
u
.u_base
= (caddr_t
)&acctbuf
;
u
.u_count
= sizeof(acctbuf
);
* Produce a pseudo-floating point representation
* with 3 bits base-8 exponent, 13 bits fraction.
register exp
= 0, round
= 0;
* lock user into core as much
* as possible. swapping may still
uap
= (struct a
*)u
.u_ap
;