create project structure

This commit is contained in:
2024-11-23 18:47:32 +03:00
parent 75f3e942e6
commit 15c07a898b
13 changed files with 221 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include "mysyslog.h"
static volatile int keep_running = 1;
void int_handler(int dummy) {
keep_running = 0;
}
int main() {
signal(SIGINT, int_handler);
signal(SIGTERM, int_handler);
const char* path = "/var/log/mysyslog.log";
int driver = 1; // Default to text driver
int format = 1; // Default to text format
while (keep_running) {
mysyslog("Daemon log message", INFO, driver, format, path);
sleep(60); // Log every minute
}
return 0;
}