Thanks for all the excellent suggestions. Right now I'm using filenames of the format <unix time>.<pid>.<counter>. I'm opening the files in a loop with O_CREAT and O_EXCL and if the initial open fails I increment the counter and keep trying until it works. I think that will be more than adequate for my needs.
Comment on Re: What's the best way to avoid name collisions when creating files?
And it is nice to have useful info in the filename, I use date time pid for my maildir stuff and it lets me easily identify message dates and times... actually been useful a couple of times for things like spam stats.