POSIX does not seem to specify mktemp(1).
It looks like most modern systems have it, but the available functionality and the semantics of the options vary between implementations (so particular invocations may not be portable):
- mktemp(1) from OpenBSD — mktemp(1) originated in OpenBSD 2.1
- mktemp(1) from FreeBSD
- mktemp(1) from Mac OS X — almost always the same as from FreeBSD
- mktemp(1) from Todd C. Miller of sudo fame
- mktemp(1) from Solaris
- mktemp(1) from GNU coreutils
- mktemp(1) from HP/UX — this one seems particularly divergent from most of the others listed here
So if you want a portable solution you may need to stick to functionality and options that mean the same thing on all of your platforms of interest.