forked from goldshtn/linux-tracing-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.c
More file actions
29 lines (27 loc) · 623 Bytes
/
Copy pathserver.c
File metadata and controls
29 lines (27 loc) · 623 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <unistd.h>
#include <stdio.h>
void read_config() {
int success = 0;
while (!success) {
FILE *fp;
fp = fopen("/etc/tracing-server-example.conf", "r");
if (fp) {
success = 1;
printf("[*] Read configuration successfully.\n");
fclose(fp);
} else {
usleep(1);
}
}
}
int main() {
printf("[*] Server starting...\n");
read_config();
printf("[*] Server started successfully.\n");
while (1) {
printf("[*] Processing request... ");
sleep(1);
printf("DONE.\n");
}
return 0;
}