1
1
iperf3/src/uuid.c

26 строки
431 B
C
Исходник Обычный вид История

2009-07-23 18:22:24 +00:00
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
2009-07-23 18:22:24 +00:00
#if defined(__FreeBSD__)
#include <uuid.h>
#else
#include <uuid/uuid.h>
#endif
void
get_uuid(char *temp)
2009-07-23 18:22:24 +00:00
{
char *s;
uuid_t uu;
#if defined(__FreeBSD__)
uuid_create(&uu, NULL);
uuid_to_string(&uu, &s, 0);
#else
s = (char *) malloc(37); /* UUID is 36 chars + \0 */
uuid_generate(uu);
uuid_unparse(uu, s);
2009-07-23 18:22:24 +00:00
#endif
memcpy(temp, s, 37);
2009-07-23 18:22:24 +00:00
}