diff --git a/executer/include/uprotocol.h b/executer/include/uprotocol.h index 47540578..87b53892 100644 --- a/executer/include/uprotocol.h +++ b/executer/include/uprotocol.h @@ -79,6 +79,7 @@ struct program_load_desc { unsigned long at_phent; unsigned long at_phnum; unsigned long at_entry; + unsigned long at_clktck; char *args; unsigned long args_len; char *envs; diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c index 96525e5a..500cde0d 100644 --- a/executer/user/mcexec.c +++ b/executer/user/mcexec.c @@ -221,6 +221,7 @@ struct program_load_desc *load_elf(FILE *fp, char **interp_pathp) desc->at_phent = sizeof(phdr); desc->at_phnum = hdr.e_phnum; desc->at_entry = hdr.e_entry; + desc->at_clktck = sysconf(_SC_CLK_TCK); return desc; } diff --git a/kernel/include/syscall.h b/kernel/include/syscall.h index 1eea16fb..055346b2 100644 --- a/kernel/include/syscall.h +++ b/kernel/include/syscall.h @@ -119,6 +119,7 @@ struct program_load_desc { unsigned long at_phent; unsigned long at_phnum; unsigned long at_entry; + unsigned long at_clktck; char *args; unsigned long args_len; char *envs; diff --git a/kernel/process.c b/kernel/process.c index 13f820fb..aa9b852e 100644 --- a/kernel/process.c +++ b/kernel/process.c @@ -1396,6 +1396,8 @@ int init_process_stack(struct process *process, struct program_load_desc *pn, p[s_ind--] = AT_PHDR; p[s_ind--] = 4096; /* AT_PAGESZ */ p[s_ind--] = AT_PAGESZ; + p[s_ind--] = pn->at_clktck; /* AT_CLKTCK */ + p[s_ind--] = AT_CLKTCK; p[s_ind--] = 0; /* envp terminating NULL */ /* envp */ for (arg_ind = envc - 1; arg_ind > -1; --arg_ind) {