feat: add simple inotify prototype

This commit is contained in:
2024-08-02 19:11:12 +02:00
parent 94a4ac27c5
commit 6c3ad9ffa5
10 changed files with 212 additions and 60 deletions
+17
View File
@@ -0,0 +1,17 @@
#ifndef SCI_UTIL_H
#define SCI_UTIL_H
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <sys/errno.h>
#include <unistd.h>
#define ASSERT_SYSCALL_SUCCESS(fd) \
do { \
if ((fd) == -1) { \
fprintf(stderr, "Assertion failed: %s, errno: %d, error: %s\n", #fd, errno, strerror(errno)); \
assert(fd != -1); \
} \
} while (0)
#endif