From owner-svn-src-head@freebsd.org Mon Jun 12 20:14:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74480C7709E; Mon, 12 Jun 2017 20:14:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2BC7CF86; Mon, 12 Jun 2017 20:14:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5CKEiSD071091; Mon, 12 Jun 2017 20:14:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5CKEitK071089; Mon, 12 Jun 2017 20:14:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201706122014.v5CKEitK071089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 12 Jun 2017 20:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319868 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jun 2017 20:14:45 -0000 Author: markj Date: Mon Jun 12 20:14:44 2017 New Revision: 319868 URL: https://svnweb.freebsd.org/changeset/base/319868 Log: Add a helper function for comparing struct uuids. Submitted by: Domagoj Stolfa MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11138 Modified: head/sys/kern/kern_uuid.c head/sys/sys/uuid.h Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Mon Jun 12 19:54:42 2017 (r319867) +++ head/sys/kern/kern_uuid.c Mon Jun 12 20:14:44 2017 (r319868) @@ -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))); +} Modified: head/sys/sys/uuid.h ============================================================================== --- head/sys/sys/uuid.h Mon Jun 12 19:54:42 2017 (r319867) +++ head/sys/sys/uuid.h Mon Jun 12 20:14:44 2017 (r319868) @@ -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);