dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libuuid / common / uuid_misc.h
blobcc95b938219fa246542279c9b57952f5af5b42fc
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _UUID_MISC_H
27 #define _UUID_MISC_H
30 * The copyright in this file is taken from the original Leach
31 * & Salz UUID specification, from which this implementation
32 * is derived.
36 * Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
37 * Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
38 * Digital Equipment Corporation, Maynard, Mass. Copyright (c) 1998
39 * Microsoft. To anyone who acknowledges that this file is provided
40 * "AS IS" without any express or implied warranty: permission to use,
41 * copy, modify, and distribute this file for any purpose is hereby
42 * granted without fee, provided that the above copyright notices and
43 * this notice appears in all source code copies, and that none of the
44 * names of Open Software Foundation, Inc., Hewlett-Packard Company,
45 * or Digital Equipment Corporation be used in advertising or
46 * publicity pertaining to distribution of the software without
47 * specific, written prior permission. Neither Open Software
48 * Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital
49 * Equipment Corporation makes any representations about the
50 * suitability of this software for any purpose.
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
57 #include <uuid/uuid.h>
58 #include <sys/types.h>
59 #include <thread.h>
61 typedef uint64_t uuid_time_t;
64 * data type for UUID generator persistent state
66 typedef struct {
67 uuid_time_t ts; /* saved timestamp */
68 uuid_node_t node; /* saved node ID */
69 uint16_t clock; /* saved clock sequence */
70 } uuid_state_t;
72 typedef struct {
73 mutex_t lock;
74 uuid_state_t state;
75 } shared_buffer_t;
77 #define STATE_LOCATION "/var/sadm/system/uuid_state"
78 #define URANDOM_PATH "/dev/urandom"
79 #define MAX_RETRY 8
80 #define VER1_MASK 0xefff
82 #ifdef __cplusplus
84 #endif
86 #endif /* _UUID_MISC_H */