Initial commit

This commit is contained in:
2026-04-08 18:44:34 -05:00
commit 91c920f442
6 changed files with 213 additions and 0 deletions

27
tests/01_daemon.c Normal file
View File

@@ -0,0 +1,27 @@
#include "../include/daemon.h"
#include <stdlib.h>
#include <syslog.h>
#include <unistd.h>
int main()
{
skeleton_daemon();
while (1)
{
//TODO: Insert daemon code here.
syslog (LOG_NOTICE, "First daemon started.");
// Calculate 1 GB in bytes (1024 * 1024 * 1024)
size_t mem_size = 1024 * 1024 * 1024;
// Allocate the memory
char *data = (char*)malloc(mem_size);
sleep (20);
free(data);
break;
}
syslog (LOG_NOTICE, "First daemon terminated.");
closelog();
return EXIT_SUCCESS;
}