mirror of
https://github.com/systemd/systemd.git
synced 2025-01-13 17:18:18 +03:00
iovec-util: add new iovec_memcmp() helper
This commit is contained in:
parent
39f586873d
commit
bf38e4c0c1
@ -58,3 +58,14 @@ char* set_iovec_string_field(struct iovec *iovec, size_t *n_iovec, const char *f
|
||||
char* set_iovec_string_field_free(struct iovec *iovec, size_t *n_iovec, const char *field, char *value);
|
||||
|
||||
void iovec_array_free(struct iovec *iovec, size_t n_iovec);
|
||||
|
||||
static inline int iovec_memcmp(const struct iovec *a, const struct iovec *b) {
|
||||
|
||||
if (a == b)
|
||||
return 0;
|
||||
|
||||
return memcmp_nn(a ? a->iov_base : NULL,
|
||||
a ? a->iov_len : 0,
|
||||
b ? b->iov_base : NULL,
|
||||
b ? b->iov_len : 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user