shlab finished

This commit is contained in:
2025-05-20 22:09:48 +08:00
parent 421a8ac1a4
commit 1b0b28f910
33 changed files with 1933 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
/*
* myspin.c - A handy program for testing your tiny shell
*
* usage: myspin <n>
* Sleeps for <n> seconds in 1-second chunks.
*
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int i, secs;
if (argc != 2) {
fprintf(stderr, "Usage: %s <n>\n", argv[0]);
exit(0);
}
secs = atoi(argv[1]);
for (i=0; i < secs; i++)
sleep(1);
exit(0);
}