xref: /freebsd/lib/libc/uuid/uuid_create_nil.c (revision d915a14ef094c8dfc1a5aee70e135abfec01d0f1)
165393a86SMarcel Moolenaar /*-
2*d915a14eSPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3*d915a14eSPedro F. Giffuni  *
465393a86SMarcel Moolenaar  * Copyright (c) 2002 Marcel Moolenaar
565393a86SMarcel Moolenaar  * Copyright (c) 2002 Hiten Mahesh Pandya
665393a86SMarcel Moolenaar  * All rights reserved.
765393a86SMarcel Moolenaar  *
865393a86SMarcel Moolenaar  * Redistribution and use in source and binary forms, with or without
965393a86SMarcel Moolenaar  * modification, are permitted provided that the following conditions
1065393a86SMarcel Moolenaar  * are met:
1165393a86SMarcel Moolenaar  * 1. Redistributions of source code must retain the above copyright
1265393a86SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer.
1365393a86SMarcel Moolenaar  * 2. Redistributions in binary form must reproduce the above copyright
1465393a86SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer in the
1565393a86SMarcel Moolenaar  *    documentation and/or other materials provided with the distribution.
1665393a86SMarcel Moolenaar  *
1765393a86SMarcel Moolenaar  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1865393a86SMarcel Moolenaar  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1965393a86SMarcel Moolenaar  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2065393a86SMarcel Moolenaar  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2165393a86SMarcel Moolenaar  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2265393a86SMarcel Moolenaar  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2365393a86SMarcel Moolenaar  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2465393a86SMarcel Moolenaar  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2565393a86SMarcel Moolenaar  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2665393a86SMarcel Moolenaar  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2765393a86SMarcel Moolenaar  * SUCH DAMAGE.
2865393a86SMarcel Moolenaar  *
2965393a86SMarcel Moolenaar  * $FreeBSD$
3065393a86SMarcel Moolenaar  */
3165393a86SMarcel Moolenaar 
3265393a86SMarcel Moolenaar #include <strings.h>
3365393a86SMarcel Moolenaar #include <uuid.h>
3465393a86SMarcel Moolenaar 
3565393a86SMarcel Moolenaar /*
3665393a86SMarcel Moolenaar  * uuid_create_nil() - create a nil UUID.
3765393a86SMarcel Moolenaar  * See also:
3865393a86SMarcel Moolenaar  *	http://www.opengroup.org/onlinepubs/009629399/uuid_create_nil.htm
3965393a86SMarcel Moolenaar  */
4065393a86SMarcel Moolenaar void
4165393a86SMarcel Moolenaar uuid_create_nil(uuid_t *u, uint32_t *status)
4265393a86SMarcel Moolenaar {
4365393a86SMarcel Moolenaar 
4465393a86SMarcel Moolenaar 	if (status)
4565393a86SMarcel Moolenaar 		*status = uuid_s_ok;
4665393a86SMarcel Moolenaar 
4765393a86SMarcel Moolenaar 	bzero(u, sizeof(*u));
4865393a86SMarcel Moolenaar }
49