improved thread safety?

David Collier-Brown davecb at
Sat Jan 19 19:46:26 GMT 2008

> Jelmer Vernooij wrote:
>>>     random
>>>     srandom
>> I'm not sure what to do about these. Are there any better alternatives?

     	Sun says "Newer and better performing random number generators such as
     	addrans() and lcrans() are available" but they're older, solaris-only
	ones. Mac has arc4random(3), and so on...

	I suspect you may need to research portable random number routines,
	as used on multiple platforms by folks like Open SSH

>>> Send me mail if you want data on mt-unsafe, non-posix, or
>>> 32-bit-only only code: the tool is really for porting, but
>>> can inspect for all sorts of other things. 
>> Yeah, I would definitely be interested in that. Is this tool freely
>> available somewhere? It would be interesting to have it running as part
>> of the build process, testsuite or the buildfarm.

	It's described at
	and is available for download, but it's purpose in life
	is to help someone change code *involving human judgment*.

	I like Jeremy's approach of #defining dangerous functions
	into compile errors for long-term and repeatable purposes.

	In fact, my next story at
	is about using port and his techniques to hunt down bugs
	and then prevent them from creeping back.

David Collier-Brown            | Always do right. This will gratify
Sun Microsystems, Toronto      | some people and astonish the rest
davecb at                 |                      -- Mark Twain
(800) 555-9786 x56583 cell: (647) 833-9377 home off: (416) 223-5943 

More information about the samba-technical mailing list