arch-arm: Replace call to `tmpnam()` by a deterministic one
authorHoa Nguyen <hoanguyen@ucdavis.edu>
Fri, 25 Sep 2020 22:26:40 +0000 (15:26 -0700)
committerHoa Nguyen <hoanguyen@ucdavis.edu>
Tue, 6 Oct 2020 20:07:26 +0000 (20:07 +0000)
commite504ce6bc65aa3a4ab06eca1b2c8ec9e435b6561
tree2d6e6b57f50cc82540cac225bdc74ce0dd051c82
parent713069071df4f92b8b67284347f152d0574cbbb1
arch-arm: Replace call to `tmpnam()` by a deterministic one

According to the documentation, the use of tmpnam() should be
avoided.

This commit generates a temporary filename by concat-ing the
object name with an index that is internally tracked, the index
is increased until a filename that is not being used is found.

JIRA: https://gem5.atlassian.net/browse/GEM5-206

Change-Id: Ibfe604d741b6b7d7b02fc051add217f95f81d05e
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35195
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/semihosting.cc
src/arch/arm/semihosting.hh