it works now. I forgot to make it a daemon...
But there're 10 process in the OS, I don't know why.
what's the detailed mean of "2:2345:respawn:/sbin/TEST" ?
Code:
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
if (fork()) return 0;
int i = 0;
while (true) {
if (i++ > 300) break;
sleep(1);
}
return 0;
}