[libcxx-commits] [libcxx] [libcxx] Add fallback to standard C when `unistd` is unavailable (PR #102005)

Joseph Huber via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 5 09:18:34 PDT 2024


jhuber6 wrote:

I do know that usage of `tmpnam` is discouraged because it's a little broken, and then I'd need to implement it for the GPU... I wonder if we could instead do something like.
```
char[] = P_tmpdir "/libcxx.XXXXX";
```
And manually replace the `X` with some random number. Problem is that there's no way to know if the file already exists without more complex file IO. Guess you could check if it's empty after opening it for writing?

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


More information about the libcxx-commits mailing list