*/
#include <common/compat/string.h>
+#include <common/random.h>
+#include <common/error.h>
+
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
}
if (!lttng_uuid_is_init) {
- /*
- * We don't need cryptographic quality randomness to
- * generate UUIDs, seed rand with the epoch.
- */
- const time_t epoch = time(NULL);
-
- if (epoch == (time_t) -1) {
- ret = -1;
+ seed_t new_seed;
+
+ ret = lttng_produce_best_effort_random_seed(&new_seed);
+ if (ret) {
+ ERR("Failed to initialize random seed while generating UUID");
goto end;
}
- srand(epoch);
+ srand(new_seed);
lttng_uuid_is_init = true;
}