Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acct fixedstruct needs special handling for comp_t and "clock tick" values #263

Open
jtmoon79 opened this issue Mar 24, 2024 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers P1 important

Comments

@jtmoon79
Copy link
Owner

jtmoon79 commented Mar 24, 2024

clock tick fields

From man acct

The ac_utime, ac_stime, and ac_etime fields measure time in "clock ticks"; divide these values by sysconf(_SC_CLK_TCK) to convert them to seconds.

comp_t fields

File format acct has field type comp_t that needs special handling

From man acct

The comp_t data type is a floating-point value consisting of a 3-bit, base-8 exponent, and a 13-bit mantissa.
A value, c, of this type can be converted to a (long) integer as follows:
v = (c & 0x1fff) << (((c >> 13) & 0x7) * 3);

From file fixedstruct.rs

//       /*
//        * Accounting structures; these use a comp_t type which is a 3 bits base 8
//        * exponent, 13 bit fraction ``floating point'' number.  Units are 1/AHZ
//        * seconds.
//        */
set_buffer_at_or_err_number!(buffer, at, acct.ac_utime, netbsd_x8632::comp_t);

Currently, a comp_t is displayed as 16-bit integer.

@jtmoon79 jtmoon79 added bug Something isn't working enhancement New feature or request good first issue Good for newcomers P0 most important labels Mar 24, 2024
@jtmoon79 jtmoon79 changed the title acct type comp_t needs special handling acct fixedstruct needs special handling for comp_t and "clock tick" values Mar 24, 2024
@jtmoon79 jtmoon79 removed the bug Something isn't working label Jun 24, 2024
@jtmoon79 jtmoon79 added P1 important and removed P0 most important labels Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers P1 important
Projects
None yet
Development

No branches or pull requests

1 participant