*rand_r(3)* is marked as obsolet by POSIX 2008. I believe *erand48(3)* would be a more modern fit. The *rrdtool plugin* currently uses *rand(3)*. I think it'll be best to move this to a separate module and use that here.