Based on sys/acct.h (V1, not V3) I need to gather some user usage statistics based on a parser that parser the acct file line by line. The parser will run and parse the entire file every N seconds and I need to gather user statistics accumulated since the last run (N seconds back). I'm not sure what will be the most appropriate way to do it based on the info provided by sys/acct.h.
Maybe something like this:
if ((ac_btime + ac_etime) < (current_time - N)) { gather; }
Also comp_t is said to be "floating-point value consisting of a 3-bit, base-8 exponent, and a 13-bit mantissa", but I think u_int16_t is just a unsigned short int. Should I be converting it to long it with the provided formula or not?