]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
iovec-util: introduce iovec_equal()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 17 Apr 2026 22:19:27 +0000 (07:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 18 Apr 2026 22:27:42 +0000 (07:27 +0900)
src/basic/iovec-util.h

index 00cbb89a7790bd89519090a108d1412abd5b89fb..21aad9edfc196b9a49d65aff59df2eab6d963121 100644 (file)
@@ -38,6 +38,9 @@ char* set_iovec_string_field_free(struct iovec *iovec, size_t *n_iovec, const ch
 void iovec_array_free(struct iovec *iovec, size_t n_iovec) _nonnull_if_nonzero_(1, 2);
 
 int iovec_memcmp(const struct iovec *a, const struct iovec *b) _pure_;
+static inline bool iovec_equal(const struct iovec *a, const struct iovec *b) {
+        return iovec_memcmp(a, b) == 0;
+}
 
 struct iovec* iovec_memdup(const struct iovec *source, struct iovec *ret);