Plan 9 from Bell Labs’s /usr/web/sources/contrib/oraccha/iperf3/uuid.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include <stdio.h>
#include <stdlib.h>
#include<string.h>
#if 0
#if defined(__FreeBSD__)
#include <uuid.h>
#else
#include <uuid/uuid.h>
#endif
#endif

/* XXX: this code is not portable: not all versions of linux install libuuidgen
	by default
 * if not installed, may need to do something like this:
 *   yum install libuuid-devel
 *   apt-get install apt-get install
*/


void
get_uuid(char *temp)
{
#if 1
    temp = NULL;
#else
    char     *s;
    uuid_t    uu;

#if defined(__FreeBSD__)
    uuid_create(&uu, NULL);
    uuid_to_string(&uu, &s, 0);
#else
    s = (char *) malloc(37);
    uuid_generate(uu);
    uuid_unparse(uu, s);
#endif
    memcpy(temp, s, 37);
#endif
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.