Hacker News new | ask | show | jobs
by JoshTriplett 3221 days ago
> setuid(arc4random_uniform(5000) + 60000)

You really want something to keep track of that UID, and not re-use it, especially with that small a random space to work with. Better to allocate than just choose at random and hope for no collision.