--- a/src/core/util/posix/tmpfile.cc
+++ b/src/core/util/posix/tmpfile.cc
@@ -43,7 +43,7 @@ FILE* gpr_tmpfile(const char* prefix, char** tmp_filename) {

   if (tmp_filename != nullptr) *tmp_filename = nullptr;

-  gpr_asprintf(&filename_template, "/tmp/%s_XXXXXX", prefix);
+  gpr_asprintf(&filename_template, "@TERMUX_PREFIX@/tmp/%s_XXXXXX", prefix);
   CHECK_NE(filename_template, nullptr);

   fd = mkstemp(filename_template);
