[libc-commits] [libc] [libc] implement mkstemp (PR #199220)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Tue May 26 13:59:04 PDT 2026


================
@@ -0,0 +1,182 @@
+//===-- Unittests for mkstemp ---------------------------------------------===//
----------------
michaelrj-google wrote:

it would be useful if there was a way to change the randomness of `mkstemp` to force it to give the same result. That way you could check that the loop works properly.

One way to do that would be to move the mkstemp logic into an internal function that takes its random function as a template argument. That way you could set it to a "random" function that will always follow the same pattern (e.g. "AAAAAA", "AAAAAB", etc.)

https://github.com/llvm/llvm-project/pull/199220


More information about the libc-commits mailing list