diff options
author | Mark Johnston <markj@FreeBSD.org> | 2017-06-12 20:14:44 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2017-06-12 20:14:44 +0000 |
commit | 56060a373e3f64e10e9b0d9291ae1afcd898bb62 (patch) | |
tree | 6a5e8dddf9a49d0fcfc3ee944c6f63330d13e832 | |
parent | 2fcfba285e0b93761e1989d025e1c14fb4fcfe3b (diff) | |
download | src-56060a373e3f64e10e9b0d9291ae1afcd898bb62.tar.gz src-56060a373e3f64e10e9b0d9291ae1afcd898bb62.zip |
Add a helper function for comparing struct uuids.
Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11138
Notes
Notes:
svn path=/head/; revision=319868
-rw-r--r-- | sys/kern/kern_uuid.c | 7 | ||||
-rw-r--r-- | sys/sys/uuid.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_uuid.c b/sys/kern/kern_uuid.c index 0953d901a592..028bc2d0d67a 100644 --- a/sys/kern/kern_uuid.c +++ b/sys/kern/kern_uuid.c @@ -424,3 +424,10 @@ parse_uuid(const char *str, struct uuid *uuid) (c[3] & 0xc0) != 0x80 && /* variant 1? */ (c[3] & 0xe0) != 0xc0) ? EINVAL : 0); /* variant 2? */ } + +int +uuidcmp(const struct uuid *uuid1, const struct uuid *uuid2) +{ + + return (memcmp(uuid1, uuid2, sizeof(struct uuid))); +} diff --git a/sys/sys/uuid.h b/sys/sys/uuid.h index 0748f6114853..97971fd79112 100644 --- a/sys/sys/uuid.h +++ b/sys/sys/uuid.h @@ -65,6 +65,7 @@ int snprintf_uuid(char *, size_t, struct uuid *); int printf_uuid(struct uuid *); int sbuf_printf_uuid(struct sbuf *, struct uuid *); int parse_uuid(const char *, struct uuid *); +int uuidcmp(const struct uuid *, const struct uuid *); void be_uuid_dec(void const *buf, struct uuid *uuid); void be_uuid_enc(void *buf, struct uuid const *uuid); |