tsacct: add 64-bit btime field
As there is only a 32-bit ac_btime field in taskstat and we should handle dates after the overflow, add a new field with the same information but 64-bit width that can hold a full time64_t. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
@@ -36,6 +36,7 @@ void bacct_add_tsk(struct user_namespace *user_ns,
|
||||
/* Convert to seconds for btime (note y2106 limit) */
|
||||
btime = ktime_get_real_seconds() - div_u64(delta, USEC_PER_SEC);
|
||||
stats->ac_btime = clamp_t(time64_t, btime, 0, U32_MAX);
|
||||
stats->ac_btime64 = btime;
|
||||
|
||||
if (thread_group_leader(tsk)) {
|
||||
stats->ac_exitcode = tsk->exit_code;
|
||||
|
||||
Reference in New Issue
Block a user