Um, why do we want a function that fails? It's possible to create a working tmpfile() function (which I suppose is what we really want) without either mkstemp() or mktemp() being available in the libc. The only thing that needs to be available and atomic is open().