+ (void)VFS_STATFS(acctp->v_mount, &sb, (struct proc *)0);
+ if (sb.f_bavail <= acctsuspend * sb.f_blocks / 100) {
+ savacctp = acctp;
+ acctp = NULL;
+ log(LOG_NOTICE, "Accounting suspended\n");
+ }
+ }
+ timeout(acctwatch, NULL, acctchkfreq * hz);
+}
+
+/*
+ * This routine calculates an accounting record for a process and,
+ * if accounting is enabled, writes it to the accounting file.
+ */
+acct_process(p)
+ register struct proc *p;
+{
+ register struct rusage *ru;
+ struct vnode *vp;
+ struct timeval t, ut, st;
+ int error, i, s;
+ struct acct acctbuf;
+ register struct acct *ap = &acctbuf;
+
+ s = splclock();
+ if ((vp = acctp) == NULL) {
+ splx(s);
+ return (0);