We should implement time as a command. This is sometimes implemented as a shell builtin in addition, but lets begin with a standalone program.
One thing to think about is how time should get and display information on how long it took a child to run. The simplest thing would be to record the time at which we issued the spawn syscall to the time we received SIGCHLD. It might be better tho to extend the kernel to keep track of this info, and implement a standard syscall like getrusage to access that info from time.
We should implement time as a command. This is sometimes implemented as a shell builtin in addition, but lets begin with a standalone program.
One thing to think about is how time should get and display information on how long it took a child to run. The simplest thing would be to record the time at which we issued the
spawn
syscall to the time we receivedSIGCHLD
. It might be better tho to extend the kernel to keep track of this info, and implement a standard syscall likegetrusage
to access that info from time.