We have a patch in the OpenBSD OCaml port to use mkstemp(3) instead of mktemp(3), to avoid insecure temporary file creation. mkstemp(3) is fairly widespread these days. but our patch is guarded by a #define(__OPENBSD__) which probably needs to be replaced with something better.