--- old/usr/src/head/uuid/uuid.h	2014-04-09 02:10:57.047247419 +0100
+++ new/usr/src/head/uuid/uuid.h	2014-04-09 02:10:57.054989333 +0100
@@ -24,11 +24,13 @@
  * Use is subject to license terms.
  */
 
+/*
+ * Copyright 2014 Andrew Stormont.
+ */
+
 #ifndef	_UUID_H
 #define	_UUID_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -65,6 +67,8 @@
 extern void uuid_copy(uuid_t, uuid_t);
 extern void uuid_clear(uuid_t);
 extern void uuid_unparse(uuid_t, char *);
+extern void uuid_unparse_lower(uuid_t, char *);
+extern void uuid_unparse_upper(uuid_t, char *);
 extern int uuid_compare(uuid_t, uuid_t);
 extern int uuid_is_null(uuid_t);
 extern int uuid_parse(char *, uuid_t);
--- old/usr/src/lib/libuuid/common/mapfile-vers	2014-04-09 02:10:57.244805089 +0100
+++ new/usr/src/lib/libuuid/common/mapfile-vers	2014-04-09 02:10:57.252805280 +0100
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2014 Andrew Stormont.
 #
 
 #
@@ -38,6 +39,12 @@
 
 $mapfile_version 2
 
+SYMBOL_VERSION ILLUMOS_0.1 {
+    global:
+	uuid_unparse_lower;
+	uuid_unparse_upper;
+} SUNW_1.1;
+
 SYMBOL_VERSION SUNW_1.1 {
     global:
 	uuid_clear;
--- old/usr/src/lib/libuuid/common/uuid.c	2014-04-09 02:10:57.438594150 +0100
+++ new/usr/src/lib/libuuid/common/uuid.c	2014-04-09 02:10:57.445498299 +0100
@@ -23,6 +23,7 @@
  * Use is subject to license terms.
  * Copyright 2012 Milan Jurik. All rights reserved.
  * Copyright 2013 Joyent, Inc. All rights reserved.
+ * Copyright 2014 Andrew Stormont.
  */
 
 /*
@@ -578,8 +579,8 @@
  * binary format into a 36-byte string (plus trailing null char)
  * and stores this value in the character string pointed to by out.
  */
-void
-uuid_unparse(uuid_t uu, char *out)
+static void
+uuid_unparse_common(uuid_t uu, char *out, boolean_t upper)
 {
 	struct uuid 	uuid;
 	uint16_t	clock_seq;
@@ -591,26 +592,44 @@
 		return;
 	}
 
-	/* XXX user should have allocated enough memory */
-	/*
-	 * if (strlen(out) < UUID_PRINTABLE_STRING_LENGTH) {
-	 * return;
-	 * }
-	 */
 	string_to_struct(&uuid, uu);
 	clock_seq = uuid.clock_seq_hi_and_reserved;
 	clock_seq = (clock_seq  << 8) | uuid.clock_seq_low;
 	for (i = 0; i < 6; i++) {
-		(void) sprintf(&etheraddr[index++], "%.2x", uuid.node_addr[i]);
+		(void) sprintf(&etheraddr[index++], upper ? "%.2X" : "%.2x",
+		    uuid.node_addr[i]);
 		index++;
 	}
 	etheraddr[index] = '\0';
 
-	(void) snprintf(out, 25, "%08x-%04x-%04x-%04x-",
+	(void) snprintf(out, 25,
+	    upper ? "%08X-%04X-%04X-%04X-" : "%08x-%04x-%04x-%04x-",
 	    uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, clock_seq);
 	(void) strlcat(out, etheraddr, UUID_PRINTABLE_STRING_LENGTH);
 }
 
+void
+uuid_unparse_upper(uuid_t uu, char *out)
+{
+	uuid_unparse_common(uu, out, B_TRUE);
+}
+
+void
+uuid_unparse_lower(uuid_t uu, char *out)
+{
+	uuid_unparse_common(uu, out, B_FALSE);
+}
+
+void
+uuid_unparse(uuid_t uu, char *out)
+{
+	/*
+	 * Historically uuid_unparse on Solaris returns lower case,
+	 * for compatibility we preserve this behaviour.
+	 */
+	uuid_unparse_common(uu, out, B_FALSE);
+}
+
 /*
  * The uuid_is_null function compares the value of the supplied
  * UUID variable uu to the NULL value. If the value is equal
--- old/usr/src/man/man3uuid/Makefile	2014-04-09 02:10:57.656982962 +0100
+++ new/usr/src/man/man3uuid/Makefile	2014-04-09 02:10:57.663846503 +0100
@@ -12,6 +12,7 @@
 #
 # Copyright 2011, Richard Lowe
 # Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2014 Andrew Stormont.
 #
 
 include		$(SRC)/Makefile.master
@@ -28,7 +29,9 @@
 		uuid_is_null.3uuid		\
 		uuid_parse.3uuid		\
 		uuid_time.3uuid			\
-		uuid_unparse.3uuid
+		uuid_unparse.3uuid		\
+		uuid_unparse_lower.3uuid	\
+		uuid_unparse_upper.3uuid
 
 uuid_compare.3uuid		:= LINKSRC = uuid_clear.3uuid
 uuid_copy.3uuid			:= LINKSRC = uuid_clear.3uuid
@@ -39,6 +42,8 @@
 uuid_parse.3uuid		:= LINKSRC = uuid_clear.3uuid
 uuid_time.3uuid			:= LINKSRC = uuid_clear.3uuid
 uuid_unparse.3uuid		:= LINKSRC = uuid_clear.3uuid
+uuid_unparse_lower.3uuid	:= LINKSRC = uuid_clear.3uuid
+uuid_unparse_upper.3uuid	:= LINKSRC = uuid_clear.3uuid
 
 .KEEP_STATE:
 
--- old/usr/src/man/man3uuid/uuid_clear.3uuid	2014-04-09 02:10:57.853858038 +0100
+++ new/usr/src/man/man3uuid/uuid_clear.3uuid	2014-04-09 02:10:57.862302136 +0100
@@ -1,13 +1,15 @@
 '\" te
 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 2014 Andrew Stormont.
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH UUID_CLEAR 3UUID "Jan 16, 2006"
+.TH UUID_CLEAR 3UUID "Apr 9, 2014"
 .SH NAME
 uuid_clear, uuid_compare, uuid_copy, uuid_generate, uuid_generate_random,
-uuid_generate_time, uuid_is_null, uuid_parse, uuid_time, uuid_unparse \-
-universally unique identifier (UUID) operations
+uuid_generate_time, uuid_is_null, uuid_parse, uuid_time, uuid_unparse,
+uuid_unparse_lower, uuid_unparse_upper \- universally unique identifier (UUID)
+operations
 .SH SYNOPSIS
 .LP
 .nf
@@ -62,6 +64,16 @@
 \fBvoid\fR \fBuuid_unparse\fR(\fBuuid_t\fR \fIuu\fR, \fBchar *\fR\fIout\fR);
 .fi
 
+.LP
+.nf
+\fBvoid\fR \fBuuid_unparse_lower\fR(\fBuuid_t\fR \fIuu\fR, \fBchar *\fR\fIout\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBuuid_unparse_upper\fR(\fBuuid_t\fR \fIuu\fR, \fBchar *\fR\fIout\fR);
+.fi
+
 .SH DESCRIPTION
 .sp
 .LP
@@ -121,11 +133,18 @@
 to by \fBret_tv\fR (see \fBgettimeofday\fR(3C)).
 .sp
 .LP
-The \fBuuid_unparse()\fR function converts the specified UUID \fIuu\fR from the
-internal binary format to a string of the length defined in the \fBuuid.h\fR
-macro, \fBUUID_PRINTABLE_STRING_LENGTH\fR, which includes the trailing null
-character. The resulting value is stored in the character string pointed to by
-\fIout\fR.
+The \fBuuid_unparse()\fR and \fBuuid_unparse_lower()\fR functions convert the
+specified UUID \fIuu\fR from the internal binary format to a lower case string
+of the length defined in the \fBuuid.h\fR macro,
+\fBUUID_PRINTABLE_STRING_LENGTH\fR, which includes the trailing null character.
+The resulting value is stored in the character string pointed to by \fIout\fR.
+.sp
+.LP
+The \fBuuid_unparse_upper()\fR function converts the specified UUID \fIuu\fR
+from the internal binary format to a upper case string of the length defined in
+the \fBuuid.h\fR macro, \fBUUID_PRINTABLE_STRING_LENGTH\fR, which includes the
+trailing null character. The resulting value is stored in the character string
+pointed to by \fIout\fR.
 .SH ATTRIBUTES
 .sp
 .LP
--- old/usr/src/pkg/manifests/system-library.man3uuid.inc	2014-04-09 02:10:58.050172199 +0100
+++ new/usr/src/pkg/manifests/system-library.man3uuid.inc	2014-04-09 02:10:58.058599179 +0100
@@ -12,6 +12,7 @@
 #
 # Copyright 2011, Richard Lowe
 # Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2014 Andrew Stormont.
 #
 
 file path=usr/share/man/man3uuid/uuid_clear.3uuid
@@ -26,3 +27,7 @@
 link path=usr/share/man/man3uuid/uuid_parse.3uuid target=uuid_clear.3uuid
 link path=usr/share/man/man3uuid/uuid_time.3uuid target=uuid_clear.3uuid
 link path=usr/share/man/man3uuid/uuid_unparse.3uuid target=uuid_clear.3uuid
+link path=usr/share/man/man3uuid/uuid_unparse_lower.3uuid \
+    target=uuid_clear.3uuid
+link path=usr/share/man/man3uuid/uuid_unparse_upper.3uuid \
+    target=uuid_clear.3uuid
