diff -uNr pinentry-1.1.0/pinentry/pinentry-emacs.c pinentry-1.1.0.mod/pinentry/pinentry-emacs.c
--- pinentry-1.1.0/pinentry/pinentry-emacs.c	2017-12-03 18:13:05.000000000 +0200
+++ pinentry-1.1.0.mod/pinentry/pinentry-emacs.c	2019-03-01 18:38:36.250899637 +0200
@@ -134,7 +134,7 @@
 	}
       else
 #endif
-	tmpdir = "/tmp";
+	tmpdir = "@TERMUX_PREFIX@/tmp";
     }
 
   socket_name_storage = malloc (strlen (tmpdir)