--- a/files.h.in
+++ b/files.h.in
@@ -33,7 +33,7 @@
 #ifndef WTMP_FILE
 #  if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__linux__) \
         || defined(__FreeBSD_kernel__) || defined(__GLIBC__)
-#    define WTMP_FILE "/var/log/wtmp"
+#    define WTMP_FILE "@TERMUX_PREFIX@/var/log/wtmp"
 #  else
 #    if defined(sun) || defined(AMIX)
 #      define WTMP_FILE "/var/adm/wtmp"
@@ -50,7 +50,7 @@
 #ifndef ACCT_FILE
 #  if defined(__FreeBSD__) || defined(__linux__) \
         || defined(__FreeBSD_kernel__) || defined(__GLIBC__)
-#    define ACCT_FILE "/var/account/pacct"
+#    define ACCT_FILE "@TERMUX_PREFIX@/var/account/pacct"
 #  else
 #    if defined(__NetBSD__)
 #      define ACCT_FILE "/var/log/account/acct"
@@ -71,7 +71,7 @@
 #ifndef SAVACCT_FILE
 #  if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) \
         || defined(__FreeBSD_kernel__) || defined(__GLIBC__)
-#    define SAVACCT_FILE "/var/account/savacct"
+#    define SAVACCT_FILE "@TERMUX_PREFIX@/var/account/savacct"
 #  else
 #    if defined(sun) || defined(AMIX)
 #      define SAVACCT_FILE "/var/adm/savacct"
@@ -88,7 +88,7 @@
 #ifndef USRACCT_FILE
 #  if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__) \
         || defined(__FreeBSD_kernel__) || defined(__GLIBC__)
-#    define USRACCT_FILE "/var/account/usracct"
+#    define USRACCT_FILE "@TERMUX_PREFIX@/var/account/usracct"
 #  else
 #    if defined(sun) || defined(AMIX)
 #      define USRACCT_FILE "/var/adm/usracct"
