The BSD libc function mkstemp (and mkdtemp) will return as many random
characters as are given as 'X' in the suffix of the given template.
Therefore, the BSD version of the mktemp utility allows the user to
define the random suffix length by padding more or less 'X' characters
as the template argument.

However, both Glibc and Musl versions of mkstemp (and mkdtemp) count
exactly six 'X' characters in the template definition. If less 'X'
characters are given the function call will fail, while if more 'X'
characters are given they are passed through unchanged.

The GNU coreutils version of the mktemp utility in fact does not call
mkstemp (or mkdtemp), but rolls it's own functions to replace all of
the 'X' characters in the template argument with random characters, in
effect mimic'ing the BSD behavior.

The BSD version of the utility, when ported to Linux, will not use more
than six random characters in the suffix and will error if asked to use
less than six. This is due to differences in the libc implementation.

This version of the mktemp utility does not attempt to mimic the BSD
behavior but uses the mkstemp/mkdtemp functions "as is" from Glibc. This
results in compact, clean code in comparison. Behavior is similar, but
not identical, to the established versions. This may, in worst case
scenarios, cause certain scripts to fail.
