--- a/src/osdep/unix/env_unix.c
+++ b/src/osdep/unix/env_unix.c
@@ -124,7 +124,7 @@
  * systems.
  */
 
-static const char *tmpdir = "/tmp";
+static const char *tmpdir = "@TERMUX_PREFIX@/tmp";
 
 /* Do not change shlock_mode.  Doing so can cause mailbox corruption and
  * denial of service.  It also defeats the entire purpose of the shared