From 5f18fcda5282ec878a5a45cca9912356cd0fb464 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sat, 16 Sep 2017 14:29:42 -0400 Subject: [PATCH] crucible: add ioctl_iflags_set to complement ioctl_iflags_get Signed-off-by: Zygo Blaxell --- include/crucible/fd.h | 1 + lib/fd.cc | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/crucible/fd.h b/include/crucible/fd.h index 9818819..f905812 100644 --- a/include/crucible/fd.h +++ b/include/crucible/fd.h @@ -146,6 +146,7 @@ namespace crucible { }; int ioctl_iflags_get(int fd); + void ioctl_iflags_set(int fd, int attr); string st_mode_ntoa(mode_t mode); diff --git a/lib/fd.cc b/lib/fd.cc index 931167f..be6177b 100644 --- a/lib/fd.cc +++ b/lib/fd.cc @@ -496,6 +496,12 @@ namespace crucible { return attr; } + void + ioctl_iflags_set(int fd, int attr) + { + DIE_IF_MINUS_ONE(ioctl(fd, FS_IOC_SETFLAGS, &attr)); + } + string readlink_or_die(const string &path) {