#include "fd-util.h"
#include "macro.h"
#include "missing_syscall.h"
+#include "parse-util.h"
#include "sparse-endian.h"
#include "stat-util.h"
#include "stdio-util.h"
}
}
+int getxattr_at_bool(int fd, const char *path, const char *name, int flags) {
+ _cleanup_free_ char *v = NULL;
+ int r;
+
+ r = getxattr_at_malloc(fd, path, name, flags, &v);
+ if (r < 0)
+ return r;
+
+ if (memchr(v, 0, r)) /* Refuse embedded NUL byte */
+ return -EINVAL;
+
+ return parse_boolean(v);
+}
+
static int parse_crtime(le64_t le, usec_t *usec) {
uint64_t u;
return getxattr_at_malloc(fd, NULL, name, AT_EMPTY_PATH, ret);
}
+int getxattr_at_bool(int fd, const char *path, const char *name, int flags);
+
int fd_setcrtime(int fd, usec_t usec);
int fd_getcrtime_at(int fd, const char *name, int flags, usec_t *ret);