Wed Jul 24 06:11:57 2019 UTC ()
Update uuidgen(2) man page to reflect reality as of five years ago.


(riastradh)
diff -r1.4 -r1.5 src/lib/libc/sys/uuidgen.2

cvs diff -r1.4 -r1.5 src/lib/libc/sys/uuidgen.2 (expand / switch to unified diff)

--- src/lib/libc/sys/uuidgen.2 2005/01/30 18:13:04 1.4
+++ src/lib/libc/sys/uuidgen.2 2019/07/24 06:11:57 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: uuidgen.2,v 1.4 2005/01/30 18:13:04 jwise Exp $ 1.\" $NetBSD: uuidgen.2,v 1.5 2019/07/24 06:11:57 riastradh Exp $
2.\" $FreeBSD: src/lib/libc/sys/uuidgen.2,v 1.7 2003/06/27 13:41:29 yar Exp $ 2.\" $FreeBSD: src/lib/libc/sys/uuidgen.2,v 1.7 2003/06/27 13:41:29 yar Exp $
3.\" Copyright (c) 2002 Marcel Moolenaar 3.\" Copyright (c) 2002 Marcel Moolenaar
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 9.\"
10.\" 1. Redistributions of source code must retain the above copyright 10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer. 11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the 13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution. 14.\" documentation and/or other materials provided with the distribution.
@@ -37,47 +37,34 @@ @@ -37,47 +37,34 @@
37.Sh SYNOPSIS 37.Sh SYNOPSIS
38.In sys/types.h 38.In sys/types.h
39.In sys/uuid.h 39.In sys/uuid.h
40.Ft int 40.Ft int
41.Fn uuidgen "struct uuid *store" "int count" 41.Fn uuidgen "struct uuid *store" "int count"
42.Sh DESCRIPTION 42.Sh DESCRIPTION
43The 43The
44.Fn uuidgen 44.Fn uuidgen
45system call generates 45system call generates
46.Fa count 46.Fa count
47universally unique identifiers (UUIDs) and writes them to the buffer 47universally unique identifiers (UUIDs) and writes them to the buffer
48pointed to by 48pointed to by
49.Fa store . 49.Fa store .
50The identifiers are generated according to the syntax and semantics of the 50The identifiers are randomly generated according to UUID version 4.
51DCE version 1 variant of universally unique identifiers. 
52See below for a more in-depth description of the identifiers. 
53When no IEEE 802 
54address is available for the node field, a random multi-cast address is 
55generated for each invocation of the system call. 
56According to the algorithm of generating time-based UUIDs, this will also 
57force a new random clock sequence, thereby increasing the likelihood for 
58the identifier to be unique. 
59.Pp 
60When multiple identifiers are to be generated, the 
61.Fn uuidgen 
62system call will generate a set of identifiers that is dense in such a way 
63that there is no identifier that is larger than the smallest identifier in the 
64set and smaller than the largest identifier in the set and that is not already 
65in the set. 
66.Pp 51.Pp
67Universally unique identifiers, also known as globally unique identifiers 52Universally unique identifiers, also known as globally unique identifiers
68(GUIDs), have a binary representation of 128-bits. 53(GUIDs), have a binary representation of 128-bits.
69The grouping and meaning of these bits is described by the following 54The grouping and meaning of these bits is based on historical methods
70structure and its description of the fields that follow it: 55of generation from on timestamps and IEEE 802 MAC addresses, and is
 56described by the following structure and its description of the fields
 57that follow it:
71.Bd -literal 58.Bd -literal
72struct uuid { 59struct uuid {
73 uint32_t time_low; 60 uint32_t time_low;
74 uint16_t time_mid; 61 uint16_t time_mid;
75 uint16_t time_hi_and_version; 62 uint16_t time_hi_and_version;
76 uint8_t clock_seq_hi_and_reserved; 63 uint8_t clock_seq_hi_and_reserved;
77 uint8_t clock_seq_low; 64 uint8_t clock_seq_low;
78 uint8_t node[_UUID_NODE_LEN]; 65 uint8_t node[_UUID_NODE_LEN];
79}; 66};
80.Ed 67.Ed
81.Bl -tag -width ".Va clock_seq_hi_and_reserved" 68.Bl -tag -width ".Va clock_seq_hi_and_reserved"
82.It Va time_low 69.It Va time_low
83The least significant 32 bits of a 60-bit timestamp. 70The least significant 32 bits of a 60-bit timestamp.
@@ -122,26 +109,39 @@ system call can fail with: @@ -122,26 +109,39 @@ system call can fail with:
122.Bl -tag -width Er 109.Bl -tag -width Er
123.It Bq Er EFAULT 110.It Bq Er EFAULT
124The buffer pointed to by 111The buffer pointed to by
125.Fa store 112.Fa store
126could not be written to for any or all identifiers. 113could not be written to for any or all identifiers.
127.It Bq Er EINVAL 114.It Bq Er EINVAL
128The 115The
129.Fa count 116.Fa count
130argument is less than 1 or larger than the hard upper limit of 2048. 117argument is less than 1 or larger than the hard upper limit of 2048.
131.El 118.El
132.Sh SEE ALSO 119.Sh SEE ALSO
133.Xr uuidgen 1 , 120.Xr uuidgen 1 ,
134.Xr uuid 3 121.Xr uuid 3
 122.Rs
 123.%A P. Leach
 124.%A M. Mealling
 125.%A R. Salz
 126.%T A Universally Unique IDentifier (UUID) URN Namespace
 127.%R RFC 4122
 128.%I IETF
 129.%D July 2005
 130.Re
135.Sh STANDARDS 131.Sh STANDARDS
136The identifiers are represented and generated in conformance with the DCE 1.1 132The identifiers are represented and generated in conformance with IETF
137RPC specification. 133RFC 4122, based on the historic DCE 1.1 RPC specification of the Open
 134Software Foundation (now the Open Group).
138The 135The
139.Fn uuidgen 136.Fn uuidgen
140system call is itself not part of the specification. 137system call is itself not part of the specification.
141.Sh HISTORY 138.Sh HISTORY
142The 139The
143.Fn uuidgen 140.Fn uuidgen
144system call first appeared in 141system call first appeared in
145.Fx 5.0 142.Fx 5.0
146and was subsequently added to 143and was subsequently added to
147.Nx 2.0 . 144.Nx 2.0 .
 145It was changed to use version 4 UUIDs, i.e. randomly generated UUIDs,
 146in
 147.Nx 8.0 .