The Pedigree Project 0.1
process-accounting.h
1/* Copyright (c) 2026, Pedigree Developers. */
2#ifndef POSIX_PROCESS_ACCOUNTING_H
3#define POSIX_PROCESS_ACCOUNTING_H
4
5#include "pedigree/kernel/time/Time.h"
6
7class PosixProcess;
8
10 explicit ProcessAccountingLifetime(bool fromFork = false)
11 : birth(Time::getTimeNanoseconds()), started(Time::getTicks()), forked(fromFork) {}
12 const Time::Timestamp birth;
13 const Time::Timestamp started;
14 const bool forked;
15 uint64_t virtualKilobytes = 0;
16};
17
18int posix_acct(const char* path);
19void posix_account_process_exit(PosixProcess& process, const ProcessAccountingLifetime& lifetime);
20void posix_stop_accounting();
21
22#endif