| 19 |
#include "log.h" |
#include "log.h" |
| 20 |
#include "io.h" |
#include "io.h" |
| 21 |
#include "fork.h" |
#include "fork.h" |
| 22 |
|
#include "menu.h" |
| 23 |
#include <stdio.h> |
#include <stdio.h> |
| 24 |
#include <string.h> |
#include <string.h> |
| 25 |
|
#include <signal.h> |
| 26 |
#include <unistd.h> |
#include <unistd.h> |
| 27 |
#include <stdlib.h> |
#include <stdlib.h> |
| 28 |
#include <errno.h> |
#include <errno.h> |
| 37 |
{ |
{ |
| 38 |
SYS_child_process_count++; |
SYS_child_process_count++; |
| 39 |
log_std("Child process (%d) start\n", pid); |
log_std("Child process (%d) start\n", pid); |
| 40 |
return 0; |
return pid; |
| 41 |
} |
} |
| 42 |
else if (pid < 0) // Error |
else if (pid < 0) // Error |
| 43 |
{ |
{ |
| 68 |
return -4; |
return -4; |
| 69 |
} |
} |
| 70 |
|
|
| 71 |
|
SYS_child_process_count = 0; |
| 72 |
|
|
| 73 |
bbs_main(); |
bbs_main(); |
| 74 |
|
|
| 75 |
// Child process exit |
// Child process exit |
| 85 |
close(STDOUT_FILENO); |
close(STDOUT_FILENO); |
| 86 |
|
|
| 87 |
log_std("Process exit normally\n"); |
log_std("Process exit normally\n"); |
|
|
|
| 88 |
log_end(); |
log_end(); |
| 89 |
|
|
| 90 |
|
_exit(0); |
| 91 |
|
|
| 92 |
return 0; |
return 0; |
| 93 |
} |
} |