Skip to content
  1. Feb 09, 2014
  2. Jul 04, 2013
  3. Mar 02, 2013
  4. Mar 01, 2013
    • Jason Miller's avatar
      Implement in-process PRNG for mkostemp · 88eb09b2
      Jason Miller authored and Stelian Ionescu's avatar Stelian Ionescu committed
      Instead of using /dev/urandom, use an in-process 32-bit xorshift.
      
      The xorshift is a very fast but not particularly strong PRNG with a
      period of (1- (expt 2 32)).  It has only a single 32-bit word for seed
      data, so that multithreaded code should play very nicely on CPUs that
      can store those atomically.  For CPUs that cannot, it should still be
      safe, since it can recover from any value in the seed.
      
      We reseed from the pid and current time when we hit a collision.  This
      is necessary for code like this to not be slow:
      
          mkstemp(...)
          fork()
          mkstemp(...)
      
      since the child process(es) will inherit the seed of the parent and
      collide a lot otherwise.
      88eb09b2
  5. Jun 27, 2012
  6. Jun 13, 2012
  7. Nov 08, 2011
  8. Nov 02, 2011
  9. Sep 08, 2011
  10. Sep 06, 2011
  11. Sep 05, 2011
  12. Aug 23, 2011
  13. Aug 19, 2011
  14. Jul 06, 2011
  15. Mar 15, 2011
  16. Jan 02, 2011
  17. Dec 29, 2010
  18. Dec 28, 2010
  19. Dec 27, 2010
  20. Dec 26, 2010
  21. Dec 20, 2010
  22. Nov 04, 2010
  23. Oct 28, 2010
  24. Oct 26, 2010
  25. Oct 24, 2010
  26. Oct 23, 2010
  27. Oct 12, 2010