summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2022-05-31 15:35:21 +0200
committerEugene Syromyatnikov <evgsyr@gmail.com>2022-06-07 19:33:49 +0200
commitd4e9bfe32c4052511d15ee0aa0626ce28564eda2 (patch)
tree8c61b51c6f0210e4fe8ba790014b0767f3b5a6fb
parent12dca391683d60984475ec659876c91e6e691149 (diff)
downloadstrace-d4e9bfe32c4052511d15ee0aa0626ce28564eda2.tar.gz
src: make CHECK_IOCTL_SIZE generally available.
* src/seccomp_ioctl.c (CHECK_IOCTL_SIZE): Move it... * src/macros.h (CHECK_IOCTL_SIZE): ...here.
-rw-r--r--src/macros.h5
-rw-r--r--src/seccomp_ioctl.c5
2 files changed, 5 insertions, 5 deletions
diff --git a/src/macros.h b/src/macros.h
index fc563ce2d..7edb8c405 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -141,6 +141,11 @@ is_filled(const char *ptr, char fill, size_t size)
static_assert(sizeof(type_) == (sz_), \
"Unexpected size of " #type_ "(" #sz_ " expected)")
+/** Checks that ioctl code's size field contains the expected value. */
+#define CHECK_IOCTL_SIZE(ioc_, sz_) \
+ static_assert(_IOC_SIZE(ioc_) == (sz_), \
+ "Unexpected size field value in " #ioc_ " (" #sz_" expected)")
+
# ifdef WORDS_BIGENDIAN
# define BE16(val_) val_
# define BE32(val_) val_
diff --git a/src/seccomp_ioctl.c b/src/seccomp_ioctl.c
index bb6a31426..20617bd5c 100644
--- a/src/seccomp_ioctl.c
+++ b/src/seccomp_ioctl.c
@@ -15,11 +15,6 @@
#define SECCOMP_IOCTL_NOTIF_ID_VALID_WRONG_DIR SECCOMP_IOR(2, __u64)
-/** Checks that ioctl code's size field contains the expected value. */
-#define CHECK_IOCTL_SIZE(ioc_, sz_) \
- static_assert(_IOC_SIZE(ioc_) == (sz_), \
- "Unexpected size field value in " #ioc_ " (" #sz_" expected)")
-
static void
print_struct_seccomp_data(struct tcb *const tcp,
const struct seccomp_data *const data)