31#define SYSFS_MAX_FILENAME_LEN (SYSFS_MAX_FILENAME_SIZE + 5)
32 char fname[SYSFS_MAX_FILENAME_LEN] =
"/sys/";
40 strlcat(fname, path,
sizeof(fname));
43 int fd = open(fname, O_WRONLY);
49 snprintf(sentence,
sizeof(sentence),
"%" PRIu64, value);
50 ssize_t
len = strlen(sentence);
52 if (write(fd, sentence,
len) !=
len) {
53 SCLogError(
"Could not write to file: %s", fname);
size_t strlcat(char *, const char *src, size_t siz)
#define SCLogWarning(...)
Macro used to log WARNING messages.
#define SCLogError(...)
Macro used to log ERROR messages.
TmEcode SysFsWriteValue(const char *path, int64_t value)
#define SYSFS_MAX_FILENAME_SIZE