Skip to content

Commit

Permalink
Lab util: sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
foyoodo committed Mar 7, 2021
1 parent 40db4f0 commit aa8d91d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ UPROGS=\
$U/_mkdir\
$U/_rm\
$U/_sh\
$U/_sleep\
$U/_stressfs\
$U/_usertests\
$U/_grind\
Expand Down
16 changes: 16 additions & 0 deletions user/sleep.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "kernel/types.h"
#include "user/user.h"

int
main(int argc, char *argv[])
{

if (argc != 2) {
fprintf(2, "Usage: sleep ticks...\n");
exit(1);
}

sleep(atoi(argv[1]));

exit(0);
}

0 comments on commit aa8d91d

Please sign in to comment.