fc_srand rename to fc_safe_srand and fc_rand rename to fc_safe_rand

master
YuQing 2026-06-08 16:45:00 +08:00
parent 963423df59
commit 592424c114
3 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
Version 1.85 2026-06-08
* add functions fc_srand and fc_rand for more security under Linux
* add functions fc_safe_srand and fc_safe_rand for more security under Linux
Version 1.84 2026-01-16
* fast_task_queue.h: add function free_queue_task_arg_offset

View File

@ -4558,7 +4558,7 @@ const char *double2str(const double d, const int scale,
#define __NR_getrandom 318
#endif
void fc_srand()
void fc_safe_srand()
{
uint32_t seed;
@ -4569,7 +4569,7 @@ void fc_srand()
}
}
int fc_rand()
int fc_safe_rand()
{
uint32_t n;

View File

@ -1868,11 +1868,11 @@ static inline size_t fc_iov_get_bytes(const
}
#ifdef OS_LINUX
void fc_srand();
int fc_rand();
void fc_safe_srand();
int fc_safe_rand();
#else
#define fc_srand() set_rand_seed()
#define fc_rand() rand()
#define fc_safe_srand() set_rand_seed()
#define fc_safe_rand() rand()
#endif
#ifdef __cplusplus