- /*
- * 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) {
+ try {
+ srand(lttng::random::produce_best_effort_random_seed());
+ } catch (std::exception& e) {
+ ERR("%s",
+ fmt::format("Failed to initialize random seed during generation of UUID: {}",
+ e.what())
+ .c_str());