Perhaps something like this?
That would potentially cover it, except for one thing. Back to an earlier message:
> > In neither variation are we checking that the existing directory actually has the requested mode.
> POSIX says this is how it should be.
The document linked by Matthew asserts that "mkdir -m mode" should behave "as if" chmod() is called after creating the directory.