学习到了 常用函数 system

This commit is contained in:
lzy
2024-05-26 08:24:54 +08:00
parent 6f754aa23d
commit 6f28a3384a
16 changed files with 1066 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
static void int_hander(int s)
{
write(1, "!", 1);
}
int main(int argc, char **argv)
{
int i;
//* ignore SIGINT
// signal(SIGINT, SIG_IGN);
signal(SIGINT, int_hander);
for (i = 0; i < 10; i++)
{
write(1, "*", 1);
sleep(1);
}
exit(0);
}