Files
swift-inotify/Sources/CInotify/cinotify.h
T
T. R. Bernstein 3215d2eb5a Describe the errno an error stores, not the current one
The description looked up the message of whatever errno was set when
the description was built, so an error printed later read
"Success (errno 28)".
2026-09-19 00:45:22 +02:00

23 lines
378 B
C

#ifndef CINOTIFY_H
#define CINOTIFY_H
#include <stdlib.h>
#include <sys/inotify.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
static inline int cinotify_deinit(int fd) {
return close(fd);
}
static inline int cinotify_get_errno(void) {
return errno;
}
static inline char* cinotify_error_message(int error_number) {
return strerror(error_number);
}
#endif