mirror of
https://github.com/termux-pacman/glibc-packages.git
synced 2025-08-26 22:52:23 +00:00
- updated to 2.41 - added the glibc32 subpackage - updated fakesyscall handling scheme - moved all disabled syscalls to fakesyscall list - added new syscalls to fakesyscall list - disabled removal of old locales in `locale-gen` - implemented syslog function, which is configured to work with the android log system - implemented analog variables `LD_*` to customize glibc environment without affecting bionic environment ('GLIBC_LD_*') - improved source code for flexible glibc compilation
1105 lines
37 KiB
Diff
1105 lines
37 KiB
Diff
diff --git a/bits/syslog-path.h b/bits/syslog-path.h
|
|
index b948672e..9ba1efff 100644
|
|
--- a/bits/syslog-path.h
|
|
+++ b/bits/syslog-path.h
|
|
@@ -23,6 +23,6 @@
|
|
#ifndef _BITS_SYSLOG_PATH_H
|
|
#define _BITS_SYSLOG_PATH_H 1
|
|
|
|
-#define _PATH_LOG "/dev/log"
|
|
+#define _PATH_LOG "/dev/socket/logdw"
|
|
|
|
#endif /* bits/syslog-path.h */
|
|
diff --git a/dirent/bug-readdir1.c b/dirent/bug-readdir1.c
|
|
index 4c3521db..06b6faa7 100644
|
|
--- a/dirent/bug-readdir1.c
|
|
+++ b/dirent/bug-readdir1.c
|
|
@@ -14,7 +14,7 @@ main (void)
|
|
struct dirent* ent;
|
|
|
|
/* open a dir stream */
|
|
- dirp = opendir ("/tmp");
|
|
+ dirp = opendir ("@TERMUX_PREFIX_CLASSICAL@/tmp");
|
|
if (dirp == NULL)
|
|
{
|
|
if (errno == ENOENT)
|
|
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
|
|
index 1432187e..f29a8b66 100644
|
|
--- a/elf/ldconfig.c
|
|
+++ b/elf/ldconfig.c
|
|
@@ -48,7 +48,7 @@
|
|
#include <dl-procinfo.h>
|
|
|
|
#ifndef LD_SO_CONF
|
|
-# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
|
|
+# define LD_SO_CONF SYSCONFDIR "/" LD_SO ".conf"
|
|
#endif
|
|
|
|
/* Get libc version number. */
|
|
diff --git a/elf/rtld.c b/elf/rtld.c
|
|
index 00bec153..bc37ac08 100644
|
|
--- a/elf/rtld.c
|
|
+++ b/elf/rtld.c
|
|
@@ -360,7 +360,7 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
|
|
._dl_fpu_control = _FPU_DEFAULT,
|
|
._dl_pagesize = EXEC_PAGESIZE,
|
|
._dl_inhibit_cache = 0,
|
|
- ._dl_profile_output = "/var/tmp",
|
|
+ ._dl_profile_output = "@TERMUX_PREFIX@/var/tmp",
|
|
|
|
/* Function pointers. */
|
|
._dl_debug_printf = _dl_debug_printf,
|
|
@@ -1822,7 +1822,7 @@ dl_main (const ElfW(Phdr) *phdr,
|
|
open(). So we do this first. If it succeeds we do almost twice
|
|
the work but this does not matter, since it is not for production
|
|
use. */
|
|
- static const char preload_file[] = "/etc/ld.so.preload";
|
|
+ static const char preload_file[] = "@TERMUX_PREFIX@/etc/ld.so.preload";
|
|
if (__glibc_unlikely (__access (preload_file, R_OK) == 0))
|
|
{
|
|
/* Read the contents of the file. */
|
|
diff --git a/elf/sprof.c b/elf/sprof.c
|
|
index 4baff86d..2e948526 100644
|
|
--- a/elf/sprof.c
|
|
+++ b/elf/sprof.c
|
|
@@ -618,7 +618,7 @@ load_shobj (const char *name)
|
|
*++cp = '\0';
|
|
|
|
/* First add the debuginfo file name only. */
|
|
- static const char usrlibdebug[]= "/usr/lib/debug/";
|
|
+ static const char usrlibdebug[]= "@TERMUX_PREFIX@/lib/debug/";
|
|
char *workbuf = (char *) alloca (sizeof (usrlibdebug)
|
|
+ (cp - realname)
|
|
+ strlen (debuginfo_fname));
|
|
@@ -768,8 +768,8 @@ load_profdata (const char *name, struct shobj *shobj)
|
|
/* A file with the given name does not exist in the current
|
|
directory, try it in the default location where the profiling
|
|
files are created. */
|
|
- ext_name = (char *) alloca (strlen (name) + sizeof "/var/tmp/");
|
|
- stpcpy (stpcpy (ext_name, "/var/tmp/"), name);
|
|
+ ext_name = (char *) alloca (strlen (name) + sizeof "@TERMUX_PREFIX@/var/tmp/");
|
|
+ stpcpy (stpcpy (ext_name, "@TERMUX_PREFIX@/var/tmp/"), name);
|
|
name = ext_name;
|
|
|
|
fd = open (ext_name, O_RDONLY);
|
|
diff --git a/hesiod/hesiod.c b/hesiod/hesiod.c
|
|
index fe61d0d5..9f8f7a8a 100644
|
|
--- a/hesiod/hesiod.c
|
|
+++ b/hesiod/hesiod.c
|
|
@@ -60,7 +60,7 @@
|
|
#include "hesiod.h"
|
|
#include "hesiod_p.h"
|
|
|
|
-#define _PATH_HESIOD_CONF "/etc/hesiod.conf"
|
|
+#define _PATH_HESIOD_CONF "@TERMUX_PREFIX@/etc/hesiod.conf"
|
|
|
|
/* Forward */
|
|
|
|
diff --git a/include/shm-directory.h b/include/shm-directory.h
|
|
index 1c0f9fcc..2f5517f2 100644
|
|
--- a/include/shm-directory.h
|
|
+++ b/include/shm-directory.h
|
|
@@ -23,7 +23,7 @@
|
|
#include <stdbool.h>
|
|
|
|
/* The directory that contains shared POSIX objects. */
|
|
-#define SHMDIR _PATH_DEV "shm/"
|
|
+#define SHMDIR "@TERMUX_PREFIX_CLASSICAL@/tmp/"
|
|
|
|
struct shmdir_name
|
|
{
|
|
diff --git a/io/bug-ftw3.c b/io/bug-ftw3.c
|
|
index 19740f49..214af2b0 100644
|
|
--- a/io/bug-ftw3.c
|
|
+++ b/io/bug-ftw3.c
|
|
@@ -18,8 +18,8 @@ cb (const char *fname, const struct stat *st, int flag)
|
|
int
|
|
main (void)
|
|
{
|
|
- char tmp[] = "/tmp/ftwXXXXXX";
|
|
- char tmp2[] = "/tmp/ftwXXXXXX/ftwXXXXXX";
|
|
+ char tmp[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/ftwXXXXXX";
|
|
+ char tmp2[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/ftwXXXXXX/ftwXXXXXX";
|
|
char *dname;
|
|
char *dname2;
|
|
int r;
|
|
diff --git a/io/bug-ftw4.c b/io/bug-ftw4.c
|
|
index 4e3e3cd5..98420206 100644
|
|
--- a/io/bug-ftw4.c
|
|
+++ b/io/bug-ftw4.c
|
|
@@ -35,7 +35,7 @@ cb (const char *name, const struct stat64 *st, int type)
|
|
int
|
|
main (void)
|
|
{
|
|
- char name[32] = "/tmp/ftwXXXXXX", *p;
|
|
+ char name[32] = "@TERMUX_PREFIX_CLASSICAL@/tmp/ftwXXXXXX", *p;
|
|
int ret, i, result = 0, fd, fd1, fd2;
|
|
|
|
if (mkdtemp (name) == NULL)
|
|
diff --git a/libio/oldiopopen.c b/libio/oldiopopen.c
|
|
index f024c4b7..c7a08fe4 100644
|
|
--- a/libio/oldiopopen.c
|
|
+++ b/libio/oldiopopen.c
|
|
@@ -106,7 +106,7 @@ _IO_old_proc_open (FILE *fp, const char *command, const char *mode)
|
|
for (p = old_proc_file_chain; p; p = p->next)
|
|
__close (_IO_fileno ((FILE *) p));
|
|
|
|
- execl ("/bin/sh", "sh", "-c", command, (char *) 0);
|
|
+ execl ("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, (char *) 0);
|
|
_exit (127);
|
|
}
|
|
__close (child_end);
|
|
diff --git a/libio/stdio.h b/libio/stdio.h
|
|
index 602f53a9..2b6e665a 100644
|
|
--- a/libio/stdio.h
|
|
+++ b/libio/stdio.h
|
|
@@ -118,7 +118,7 @@ typedef __fpos64_t fpos64_t;
|
|
|
|
#if defined __USE_MISC || defined __USE_XOPEN
|
|
/* Default path prefix for `tempnam' and `tmpnam'. */
|
|
-# define P_tmpdir "/tmp"
|
|
+# define P_tmpdir "@TERMUX_PREFIX_CLASSICAL@/tmp"
|
|
#endif
|
|
|
|
#define L_tmpnam 20
|
|
diff --git a/manual/examples/filecli.c b/manual/examples/filecli.c
|
|
index f6ce1174..9ca9ac0a 100644
|
|
--- a/manual/examples/filecli.c
|
|
+++ b/manual/examples/filecli.c
|
|
@@ -22,8 +22,8 @@
|
|
#include <sys/socket.h>
|
|
#include <sys/un.h>
|
|
|
|
-#define SERVER "/tmp/serversocket"
|
|
-#define CLIENT "/tmp/mysocket"
|
|
+#define SERVER "@TERMUX_PREFIX_CLASSICAL@/tmp/serversocket"
|
|
+#define CLIENT "@TERMUX_PREFIX_CLASSICAL@/tmp/mysocket"
|
|
#define MAXMSG 512
|
|
#define MESSAGE "Yow!!! Are we having fun yet?!?"
|
|
|
|
diff --git a/manual/examples/filesrv.c b/manual/examples/filesrv.c
|
|
index 09c80c59..74c0c728 100644
|
|
--- a/manual/examples/filesrv.c
|
|
+++ b/manual/examples/filesrv.c
|
|
@@ -21,7 +21,7 @@
|
|
#include <sys/socket.h>
|
|
#include <sys/un.h>
|
|
|
|
-#define SERVER "/tmp/serversocket"
|
|
+#define SERVER "@TERMUX_PREFIX_CLASSICAL@/tmp/serversocket"
|
|
#define MAXMSG 512
|
|
|
|
int
|
|
diff --git a/manual/examples/ofdlocks.c b/manual/examples/ofdlocks.c
|
|
index 08a978ad..74dc9223 100644
|
|
--- a/manual/examples/ofdlocks.c
|
|
+++ b/manual/examples/ofdlocks.c
|
|
@@ -23,7 +23,7 @@
|
|
#include <fcntl.h>
|
|
#include <pthread.h>
|
|
|
|
-#define FILENAME "/tmp/foo"
|
|
+#define FILENAME "@TERMUX_PREFIX_CLASSICAL@/tmp/foo"
|
|
#define NUM_THREADS 3
|
|
#define ITERATIONS 5
|
|
|
|
@@ -39,7 +39,7 @@ thread_start (void *arg)
|
|
.l_len = 1,
|
|
};
|
|
|
|
- fd = open ("/tmp/foo", O_RDWR | O_CREAT, 0666);
|
|
+ fd = open ("@TERMUX_PREFIX_CLASSICAL@/tmp/foo", O_RDWR | O_CREAT, 0666);
|
|
|
|
for (i = 0; i < ITERATIONS; i++)
|
|
{
|
|
diff --git a/nis/ypclnt.c b/nis/ypclnt.c
|
|
index b3e987b6..5845cfef 100644
|
|
--- a/nis/ypclnt.c
|
|
+++ b/nis/ypclnt.c
|
|
@@ -33,7 +33,7 @@
|
|
|
|
/* This should only be defined on systems with a BSD compatible ypbind */
|
|
#ifndef BINDINGDIR
|
|
-# define BINDINGDIR "/var/yp/binding"
|
|
+# define BINDINGDIR "@TERMUX_PREFIX@/var/yp/binding"
|
|
#endif
|
|
|
|
struct dom_binding
|
|
diff --git a/nscd/nscd-client.h b/nscd/nscd-client.h
|
|
index 2520e65f..f08c3fb7 100644
|
|
--- a/nscd/nscd-client.h
|
|
+++ b/nscd/nscd-client.h
|
|
@@ -35,13 +35,13 @@
|
|
#define NSCD_VERSION 2
|
|
|
|
/* Path of the file where the PID of the running system is stored. */
|
|
-#define _PATH_NSCDPID "/var/run/nscd/nscd.pid"
|
|
+#define _PATH_NSCDPID "@TERMUX_PREFIX@/var/run/nscd/nscd.pid"
|
|
|
|
/* Path for the Unix domain socket. */
|
|
-#define _PATH_NSCDSOCKET "/var/run/nscd/socket"
|
|
+#define _PATH_NSCDSOCKET "@TERMUX_PREFIX@/var/run/nscd/socket"
|
|
|
|
/* Path for the configuration file. */
|
|
-#define _PATH_NSCDCONF "/etc/nscd.conf"
|
|
+#define _PATH_NSCDCONF "@TERMUX_PREFIX@/etc/nscd.conf"
|
|
|
|
/* Maximum allowed length for the key. */
|
|
#define MAXKEYLEN 1024
|
|
diff --git a/nss/bug-erange.c b/nss/bug-erange.c
|
|
index b709418b..0aff48d1 100644
|
|
--- a/nss/bug-erange.c
|
|
+++ b/nss/bug-erange.c
|
|
@@ -37,7 +37,7 @@ main (void)
|
|
{
|
|
printf ("gethostbyname_r failed: %s (errno: %m)\n", strerror (res));
|
|
|
|
- if (access ("/etc/resolv.conf", R_OK))
|
|
+ if (access ("@TERMUX_PREFIX@/etc/resolv.conf", R_OK))
|
|
{
|
|
puts ("DNS probably not set up");
|
|
return 0;
|
|
diff --git a/nss/db-Makefile b/nss/db-Makefile
|
|
index 99d2b4c2..a873953e 100644
|
|
--- a/nss/db-Makefile
|
|
+++ b/nss/db-Makefile
|
|
@@ -17,11 +17,11 @@
|
|
# License along with the GNU C Library; if not, see
|
|
# <https://www.gnu.org/licenses/>.
|
|
|
|
-DATABASES = $(wildcard /etc/passwd /etc/group /etc/ethers /etc/protocols \
|
|
- /etc/rpc /etc/services /etc/shadow /etc/gshadow \
|
|
- /etc/netgroup)
|
|
+DATABASES = $(wildcard @TERMUX_PREFIX@/etc/passwd @TERMUX_PREFIX@/etc/group @TERMUX_PREFIX@/etc/ethers @TERMUX_PREFIX@/etc/protocols \
|
|
+ @TERMUX_PREFIX@/etc/rpc @TERMUX_PREFIX@/etc/services @TERMUX_PREFIX@/etc/shadow @TERMUX_PREFIX@/etc/gshadow \
|
|
+ @TERMUX_PREFIX@/etc/netgroup)
|
|
|
|
-VAR_DB = /var/db
|
|
+VAR_DB = @TERMUX_PREFIX@/var/db
|
|
|
|
AWK = awk
|
|
MAKEDB = makedb --quiet
|
|
@@ -29,7 +29,7 @@ MAKEDB = makedb --quiet
|
|
all: $(patsubst %,$(VAR_DB)/%.db,$(notdir $(DATABASES)))
|
|
|
|
|
|
-$(VAR_DB)/passwd.db: /etc/passwd
|
|
+$(VAR_DB)/passwd.db: @TERMUX_PREFIX@/etc/passwd
|
|
@printf %s "$(patsubst %.db,%,$(@F))... "
|
|
@$(AWK) 'BEGIN { FS=":"; OFS=":" } \
|
|
/^[ \t]*$$/ { next } \
|
|
@@ -39,7 +39,7 @@ $(VAR_DB)/passwd.db: /etc/passwd
|
|
$(MAKEDB) -o $@ -
|
|
@echo "done."
|
|
|
|
-$(VAR_DB)/group.db: /etc/group
|
|
+$(VAR_DB)/group.db: @TERMUX_PREFIX@/etc/group
|
|
@printf %s "$(patsubst %.db,%,$(@F))... "
|
|
@$(AWK) 'BEGIN { FS=":"; OFS=":" } \
|
|
/^[ \t]*$$/ { next } \
|
|
@@ -61,7 +61,7 @@ $(VAR_DB)/group.db: /etc/group
|
|
$(MAKEDB) -o $@ -
|
|
@echo "done."
|
|
|
|
-$(VAR_DB)/ethers.db: /etc/ethers
|
|
+$(VAR_DB)/ethers.db: @TERMUX_PREFIX@/etc/ethers
|
|
@printf %s "$(patsubst %.db,%,$(@F))... "
|
|
@$(AWK) '/^[ \t]*$$/ { next } \
|
|
/^[ \t]*#/ { next } \
|
|
@@ -70,7 +70,7 @@ $(VAR_DB)/ethers.db: /etc/ethers
|
|
$(MAKEDB) -o $@ -
|
|
@echo "done."
|
|
|
|
-$(VAR_DB)/protocols.db: /etc/protocols
|
|
+$(VAR_DB)/protocols.db: @TERMUX_PREFIX@/etc/protocols
|
|
@printf %s "$(patsubst %.db,%,$(@F))... "
|
|
@$(AWK) '/^[ \t]*$$/ { next } \
|
|
/^[ \t]*#/ { next } \
|
|
@@ -81,7 +81,7 @@ $(VAR_DB)/protocols.db: /etc/protocols
|
|
$(MAKEDB) -o $@ -
|
|
@echo "done."
|
|
|
|
-$(VAR_DB)/rpc.db: /etc/rpc
|
|
+$(VAR_DB)/rpc.db: @TERMUX_PREFIX@/etc/rpc
|
|
@printf %s "$(patsubst %.db,%,$(@F))... "
|
|
@$(AWK) '/^[ \t]*$$/ { next } \
|
|
/^[ \t]*#/ { next } \
|
|
@@ -92,7 +92,7 @@ $(VAR_DB)/rpc.db: /etc/rpc
|
|
$(MAKEDB) -o $@ -
|
|
@echo "done."
|
|
|
|
-$(VAR_DB)/services.db: /etc/services
|
|
+$(VAR_DB)/services.db: @TERMUX_PREFIX@/etc/services
|
|
@printf %s "$(patsubst %.db,%,$(@F))... "
|
|
@$(AWK) 'BEGIN { FS="[ \t/]+" } \
|
|
/^[ \t]*$$/ { next } \
|
|
@@ -108,7 +108,7 @@ $(VAR_DB)/services.db: /etc/services
|
|
$(MAKEDB) -o $@ -
|
|
@echo "done."
|
|
|
|
-$(VAR_DB)/shadow.db: /etc/shadow
|
|
+$(VAR_DB)/shadow.db: @TERMUX_PREFIX@/etc/shadow
|
|
@printf %s "$(patsubst %.db,%,$(@F))... "
|
|
@$(AWK) 'BEGIN { FS=":"; OFS=":" } \
|
|
/^[ \t]*$$/ { next } \
|
|
@@ -128,7 +128,7 @@ $(VAR_DB)/shadow.db: /etc/shadow
|
|
echo; \
|
|
fi
|
|
|
|
-$(VAR_DB)/gshadow.db: /etc/gshadow
|
|
+$(VAR_DB)/gshadow.db: @TERMUX_PREFIX@/etc/gshadow
|
|
@printf %s "$(patsubst %.db,%,$(@F))... "
|
|
@$(AWK) 'BEGIN { FS=":"; OFS=":" } \
|
|
/^[ \t]*$$/ { next } \
|
|
@@ -148,7 +148,7 @@ $(VAR_DB)/gshadow.db: /etc/gshadow
|
|
echo; \
|
|
fi
|
|
|
|
-$(VAR_DB)/netgroup.db: /etc/netgroup
|
|
+$(VAR_DB)/netgroup.db: @TERMUX_PREFIX@/etc/netgroup
|
|
@printf %s "$(patsubst %.db,%,$(@F))... "
|
|
@$(AWK) 'BEGIN { ini=1 } \
|
|
/^[ \t]*$$/ { next } \
|
|
diff --git a/nss/getaddrinfo.c b/nss/getaddrinfo.c
|
|
index 21e899ff..f31298a7 100644
|
|
--- a/nss/getaddrinfo.c
|
|
+++ b/nss/getaddrinfo.c
|
|
@@ -1726,7 +1726,7 @@ in6aicmp (const void *p1, const void *p2)
|
|
|
|
|
|
/* Name of the config file for RFC 3484 sorting (for now). */
|
|
-#define GAICONF_FNAME "/etc/gai.conf"
|
|
+#define GAICONF_FNAME "@TERMUX_PREFIX@/etc/gai.conf"
|
|
|
|
|
|
/* Non-zero if we are supposed to reload the config file automatically
|
|
diff --git a/nss/lckpwdf.c b/nss/lckpwdf.c
|
|
index 0e72cdc8..b77450e9 100644
|
|
--- a/nss/lckpwdf.c
|
|
+++ b/nss/lckpwdf.c
|
|
@@ -29,7 +29,7 @@
|
|
|
|
|
|
/* Name of the lock file. */
|
|
-#define PWD_LOCKFILE "/etc/.pwd.lock"
|
|
+#define PWD_LOCKFILE "@TERMUX_PREFIX@/etc/.pwd.lock"
|
|
|
|
/* How long to wait for getting the lock before returning with an
|
|
error. */
|
|
diff --git a/nss/nss_compat/compat-grp.c b/nss/nss_compat/compat-grp.c
|
|
index 86a46d06..03252716 100644
|
|
--- a/nss/nss_compat/compat-grp.c
|
|
+++ b/nss/nss_compat/compat-grp.c
|
|
@@ -108,7 +108,7 @@ internal_setgrent (ent_t *ent, int stayopen, int needent)
|
|
|
|
if (ent->stream == NULL)
|
|
{
|
|
- ent->stream = __nss_files_fopen ("/etc/group");
|
|
+ ent->stream = __nss_files_fopen ("@TERMUX_PREFIX@/etc/group");
|
|
|
|
if (ent->stream == NULL)
|
|
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
|
|
diff --git a/nss/nss_compat/compat-initgroups.c b/nss/nss_compat/compat-initgroups.c
|
|
index faff0e09..e270d5e7 100644
|
|
--- a/nss/nss_compat/compat-initgroups.c
|
|
+++ b/nss/nss_compat/compat-initgroups.c
|
|
@@ -122,7 +122,7 @@ internal_setgrent (ent_t *ent)
|
|
else
|
|
ent->blacklist.current = 0;
|
|
|
|
- ent->stream = __nss_files_fopen ("/etc/group");
|
|
+ ent->stream = __nss_files_fopen ("@TERMUX_PREFIX@/etc/group");
|
|
|
|
if (ent->stream == NULL)
|
|
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
|
|
diff --git a/nss/nss_compat/compat-pwd.c b/nss/nss_compat/compat-pwd.c
|
|
index 7da6dc99..8270d898 100644
|
|
--- a/nss/nss_compat/compat-pwd.c
|
|
+++ b/nss/nss_compat/compat-pwd.c
|
|
@@ -223,7 +223,7 @@ internal_setpwent (ent_t *ent, int stayopen, int needent)
|
|
|
|
if (ent->stream == NULL)
|
|
{
|
|
- ent->stream = __nss_files_fopen ("/etc/passwd");
|
|
+ ent->stream = __nss_files_fopen ("@TERMUX_PREFIX@/etc/passwd");
|
|
|
|
if (ent->stream == NULL)
|
|
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
|
|
diff --git a/nss/nss_compat/compat-spwd.c b/nss/nss_compat/compat-spwd.c
|
|
index 77844382..798dcf2f 100644
|
|
--- a/nss/nss_compat/compat-spwd.c
|
|
+++ b/nss/nss_compat/compat-spwd.c
|
|
@@ -178,7 +178,7 @@ internal_setspent (ent_t *ent, int stayopen, int needent)
|
|
|
|
if (ent->stream == NULL)
|
|
{
|
|
- ent->stream = __nss_files_fopen ("/etc/shadow");
|
|
+ ent->stream = __nss_files_fopen ("@TERMUX_PREFIX@/etc/shadow");
|
|
|
|
if (ent->stream == NULL)
|
|
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
|
|
diff --git a/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c
|
|
index 8baa8aa6..d05ca45f 100644
|
|
--- a/nss/nss_files/files-XXX.c
|
|
+++ b/nss/nss_files/files-XXX.c
|
|
@@ -39,7 +39,7 @@
|
|
|
|
#define ENTNAME_r CONCAT(ENTNAME,_r)
|
|
|
|
-#define DATAFILE "/etc/" DATABASE
|
|
+#define DATAFILE "@TERMUX_PREFIX@/etc/" DATABASE
|
|
|
|
#ifdef NEED_H_ERRNO
|
|
# include <netdb.h>
|
|
diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
|
|
index 29744901..bea9d474 100644
|
|
--- a/nss/nss_files/files-alias.c
|
|
+++ b/nss/nss_files/files-alias.c
|
|
@@ -42,7 +42,7 @@ internal_setent (FILE **stream)
|
|
|
|
if (*stream == NULL)
|
|
{
|
|
- *stream = __nss_files_fopen ("/etc/aliases");
|
|
+ *stream = __nss_files_fopen ("@TERMUX_PREFIX@/etc/aliases");
|
|
|
|
if (*stream == NULL)
|
|
status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
|
|
@@ -58,7 +58,7 @@ internal_setent (FILE **stream)
|
|
enum nss_status
|
|
_nss_files_setaliasent (void)
|
|
{
|
|
- return __nss_files_data_setent (nss_file_aliasent, "/etc/aliases");
|
|
+ return __nss_files_data_setent (nss_file_aliasent, "@TERMUX_PREFIX@/etc/aliases");
|
|
}
|
|
libc_hidden_def (_nss_files_setaliasent)
|
|
|
|
@@ -338,7 +338,7 @@ _nss_files_getaliasent_r (struct aliasent *result, char *buffer, size_t buflen,
|
|
|
|
struct nss_files_per_file_data *data;
|
|
enum nss_status status = __nss_files_data_open (&data, nss_file_aliasent,
|
|
- "/etc/aliases", errnop, NULL);
|
|
+ "@TERMUX_PREFIX@/etc/aliases", errnop, NULL);
|
|
if (status != NSS_STATUS_SUCCESS)
|
|
return status;
|
|
|
|
diff --git a/nss/nss_files/files-init.c b/nss/nss_files/files-init.c
|
|
index c282299f..159330d4 100644
|
|
--- a/nss/nss_files/files-init.c
|
|
+++ b/nss/nss_files/files-init.c
|
|
@@ -41,12 +41,12 @@ register_file (void (*cb) (size_t, struct traced_file *),
|
|
void
|
|
_nss_files_init (void (*cb) (size_t, struct traced_file *))
|
|
{
|
|
- register_file (cb, pwddb, "/etc/passwd", 0);
|
|
- register_file (cb, grpdb, "/etc/group", 0);
|
|
- register_file (cb, hstdb, "/etc/hosts", 0);
|
|
- register_file (cb, hstdb, "/etc/resolv.conf", 1);
|
|
- register_file (cb, servdb, "/etc/services", 0);
|
|
- register_file (cb, netgrdb, "/etc/netgroup", 0);
|
|
+ register_file (cb, pwddb, "@TERMUX_PREFIX@/etc/passwd", 0);
|
|
+ register_file (cb, grpdb, "@TERMUX_PREFIX@/etc/group", 0);
|
|
+ register_file (cb, hstdb, "/system/etc/hosts", 0);
|
|
+ register_file (cb, hstdb, "@TERMUX_PREFIX@/etc/resolv.conf", 1);
|
|
+ register_file (cb, servdb, "@TERMUX_PREFIX@/etc/services", 0);
|
|
+ register_file (cb, netgrdb, "@TERMUX_PREFIX@/etc/netgroup", 0);
|
|
}
|
|
libc_hidden_def (_nss_files_init)
|
|
|
|
diff --git a/nss/nss_files/files-initgroups.c b/nss/nss_files/files-initgroups.c
|
|
index 64078a8e..c8a54ca6 100644
|
|
--- a/nss/nss_files/files-initgroups.c
|
|
+++ b/nss/nss_files/files-initgroups.c
|
|
@@ -33,7 +33,7 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
|
|
long int *size, gid_t **groupsp, long int limit,
|
|
int *errnop)
|
|
{
|
|
- FILE *stream = __nss_files_fopen ("/etc/group");
|
|
+ FILE *stream = __nss_files_fopen ("@TERMUX_PREFIX@/etc/group");
|
|
if (stream == NULL)
|
|
{
|
|
*errnop = errno;
|
|
diff --git a/nss/nss_files/files-netgrp.c b/nss/nss_files/files-netgrp.c
|
|
index 843ec19b..d3337651 100644
|
|
--- a/nss/nss_files/files-netgrp.c
|
|
+++ b/nss/nss_files/files-netgrp.c
|
|
@@ -27,7 +27,7 @@
|
|
#include "netgroup.h"
|
|
#include <nss_files.h>
|
|
|
|
-#define DATAFILE "/etc/netgroup"
|
|
+#define DATAFILE "@TERMUX_PREFIX@/etc/netgroup"
|
|
|
|
libc_hidden_proto (_nss_files_endnetgrent)
|
|
|
|
diff --git a/posix/annexc.c b/posix/annexc.c
|
|
index 9c02ab5c..43acd34a 100644
|
|
--- a/posix/annexc.c
|
|
+++ b/posix/annexc.c
|
|
@@ -26,7 +26,7 @@
|
|
|
|
#define HEADER_MAX 256
|
|
|
|
-static char macrofile[] = "/tmp/annexc.XXXXXX";
|
|
+static char macrofile[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/annexc.XXXXXX";
|
|
|
|
/* <aio.h>. */
|
|
static const char *const aio_syms[] =
|
|
diff --git a/posix/bug-getopt1.c b/posix/bug-getopt1.c
|
|
index a5a37116..a42dfde3 100644
|
|
--- a/posix/bug-getopt1.c
|
|
+++ b/posix/bug-getopt1.c
|
|
@@ -40,7 +40,7 @@ one_test (const char *fmt, int argc, char *argv[], int expected[argc - 1])
|
|
static int
|
|
do_test (void)
|
|
{
|
|
- char fname[] = "/tmp/bug-getopt1.XXXXXX";
|
|
+ char fname[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/bug-getopt1.XXXXXX";
|
|
int fd = mkstemp (fname);
|
|
if (fd == -1)
|
|
{
|
|
diff --git a/posix/bug-getopt2.c b/posix/bug-getopt2.c
|
|
index 8f92f0c6..069a1ff5 100644
|
|
--- a/posix/bug-getopt2.c
|
|
+++ b/posix/bug-getopt2.c
|
|
@@ -38,7 +38,7 @@ one_test (const char *fmt, int argc, char *argv[], int expected[argc - 1])
|
|
static int
|
|
do_test (void)
|
|
{
|
|
- char fname[] = "/tmp/bug-getopt2.XXXXXX";
|
|
+ char fname[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/bug-getopt2.XXXXXX";
|
|
int fd = mkstemp (fname);
|
|
if (fd == -1)
|
|
{
|
|
diff --git a/posix/bug-getopt3.c b/posix/bug-getopt3.c
|
|
index 45a8d3ec..32b15899 100644
|
|
--- a/posix/bug-getopt3.c
|
|
+++ b/posix/bug-getopt3.c
|
|
@@ -49,7 +49,7 @@ one_test (const char *fmt, int argc, char *argv[], int n, int expected[n],
|
|
static int
|
|
do_test (void)
|
|
{
|
|
- char fname[] = "/tmp/bug-getopt3.XXXXXX";
|
|
+ char fname[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/bug-getopt3.XXXXXX";
|
|
int fd = mkstemp (fname);
|
|
if (fd == -1)
|
|
{
|
|
diff --git a/posix/bug-getopt4.c b/posix/bug-getopt4.c
|
|
index c5e3c149..e54f2169 100644
|
|
--- a/posix/bug-getopt4.c
|
|
+++ b/posix/bug-getopt4.c
|
|
@@ -53,7 +53,7 @@ one_test (const char *fmt, int argc, char *argv[], int n, int expected[n])
|
|
static int
|
|
do_test (void)
|
|
{
|
|
- char fname[] = "/tmp/bug-getopt4.XXXXXX";
|
|
+ char fname[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/bug-getopt4.XXXXXX";
|
|
int fd = mkstemp (fname);
|
|
if (fd == -1)
|
|
{
|
|
diff --git a/posix/bug-getopt5.c b/posix/bug-getopt5.c
|
|
index 4f67d9b2..11645956 100644
|
|
--- a/posix/bug-getopt5.c
|
|
+++ b/posix/bug-getopt5.c
|
|
@@ -48,7 +48,7 @@ one_test (const char *fmt, int argc, char *argv[], int n, int expected[n])
|
|
static int
|
|
do_test (void)
|
|
{
|
|
- char fname[] = "/tmp/bug-getopt5.XXXXXX";
|
|
+ char fname[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/bug-getopt5.XXXXXX";
|
|
int fd = mkstemp (fname);
|
|
if (fd == -1)
|
|
{
|
|
diff --git a/posix/bug-regex9.c b/posix/bug-regex9.c
|
|
index 68f591de..99e1ca80 100644
|
|
--- a/posix/bug-regex9.c
|
|
+++ b/posix/bug-regex9.c
|
|
@@ -23,7 +23,7 @@
|
|
#include <stdlib.h>
|
|
|
|
|
|
-static const char text[] = "#! /bin/sh";
|
|
+static const char text[] = "#! @TERMUX_PREFIX@/bin/sh";
|
|
|
|
int
|
|
main (void)
|
|
diff --git a/resolv/netdb.h b/resolv/netdb.h
|
|
index 5b5a8878..6d4c92bb 100644
|
|
--- a/resolv/netdb.h
|
|
+++ b/resolv/netdb.h
|
|
@@ -40,12 +40,12 @@
|
|
#include <bits/netdb.h>
|
|
|
|
/* Absolute file name for network data base files. */
|
|
-#define _PATH_HEQUIV "/etc/hosts.equiv"
|
|
-#define _PATH_HOSTS "/etc/hosts"
|
|
-#define _PATH_NETWORKS "/etc/networks"
|
|
-#define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf"
|
|
-#define _PATH_PROTOCOLS "/etc/protocols"
|
|
-#define _PATH_SERVICES "/etc/services"
|
|
+#define _PATH_HEQUIV "@TERMUX_PREFIX@/etc/hosts.equiv"
|
|
+#define _PATH_HOSTS "@TERMUX_PREFIX@/etc/hosts"
|
|
+#define _PATH_NETWORKS "@TERMUX_PREFIX@/etc/networks"
|
|
+#define _PATH_NSSWITCH_CONF "@TERMUX_PREFIX@/etc/nsswitch.conf"
|
|
+#define _PATH_PROTOCOLS "@TERMUX_PREFIX@/etc/protocols"
|
|
+#define _PATH_SERVICES "@TERMUX_PREFIX@/etc/services"
|
|
|
|
|
|
__BEGIN_DECLS
|
|
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
|
|
index 186af816..d2e09c5b 100644
|
|
--- a/resolv/res_hconf.c
|
|
+++ b/resolv/res_hconf.c
|
|
@@ -48,7 +48,7 @@
|
|
# define fgets_unlocked __fgets_unlocked
|
|
#endif
|
|
|
|
-#define _PATH_HOSTCONF "/etc/host.conf"
|
|
+#define _PATH_HOSTCONF "@TERMUX_PREFIX@/etc/host.conf"
|
|
|
|
/* Environment vars that all user to override default behavior: */
|
|
#define ENV_HOSTCONF "RESOLV_HOST_CONF"
|
|
diff --git a/resolv/resolv.h b/resolv/resolv.h
|
|
index b8a0f66a..b7974333 100644
|
|
--- a/resolv/resolv.h
|
|
+++ b/resolv/resolv.h
|
|
@@ -91,7 +91,7 @@
|
|
*/
|
|
|
|
#ifndef _PATH_RESCONF
|
|
-#define _PATH_RESCONF "/etc/resolv.conf"
|
|
+#define _PATH_RESCONF "@TERMUX_PREFIX@/etc/resolv.conf"
|
|
#endif
|
|
|
|
struct res_sym {
|
|
diff --git a/stdio-common/bug7.c b/stdio-common/bug7.c
|
|
index c9c2ef51..053f7227 100644
|
|
--- a/stdio-common/bug7.c
|
|
+++ b/stdio-common/bug7.c
|
|
@@ -8,7 +8,7 @@ int
|
|
main (int argc, char *argv[])
|
|
{
|
|
int lose = 0;
|
|
- char filename[] = "/tmp/bug7.XXXXXX";
|
|
+ char filename[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/bug7.XXXXXX";
|
|
FILE *fp;
|
|
|
|
int fd = mkstemp (filename);
|
|
@@ -36,8 +36,8 @@ main (int argc, char *argv[])
|
|
{
|
|
FILE *file1;
|
|
FILE *file2;
|
|
- char filename1[] = "/tmp/bug7.XXXXXX";
|
|
- char filename2[] = "/tmp/bug7.XXXXXX";
|
|
+ char filename1[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/bug7.XXXXXX";
|
|
+ char filename2[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/bug7.XXXXXX";
|
|
int ch;
|
|
|
|
int fd1 = mkstemp (filename1);
|
|
diff --git a/stdio-common/scanf14.c b/stdio-common/scanf14.c
|
|
index d942e213..4e49e7f3 100644
|
|
--- a/stdio-common/scanf14.c
|
|
+++ b/stdio-common/scanf14.c
|
|
@@ -82,7 +82,7 @@ main (void)
|
|
|
|
const char *tmpdir = getenv ("TMPDIR");
|
|
if (tmpdir == NULL || tmpdir[0] == '\0')
|
|
- tmpdir = "/tmp";
|
|
+ tmpdir = "@TERMUX_PREFIX_CLASSICAL@/tmp";
|
|
|
|
char fname[strlen (tmpdir) + sizeof "/tst-scanf14.XXXXXX"];
|
|
sprintf (fname, "%s/tst-scanf14.XXXXXX", tmpdir);
|
|
diff --git a/stdio-common/scanf15.c b/stdio-common/scanf15.c
|
|
index b620e23a..dc28b45d 100644
|
|
--- a/stdio-common/scanf15.c
|
|
+++ b/stdio-common/scanf15.c
|
|
@@ -65,7 +65,7 @@ main (void)
|
|
|
|
const char *tmpdir = getenv ("TMPDIR");
|
|
if (tmpdir == NULL || tmpdir[0] == '\0')
|
|
- tmpdir = "/tmp";
|
|
+ tmpdir = "@TERMUX_PREFIX_CLASSICAL@/tmp";
|
|
|
|
char fname[strlen (tmpdir) + sizeof "/tst-scanf15.XXXXXX"];
|
|
sprintf (fname, "%s/tst-scanf15.XXXXXX", tmpdir);
|
|
diff --git a/stdio-common/scanf16.c b/stdio-common/scanf16.c
|
|
index 17e77702..0d5f5187 100644
|
|
--- a/stdio-common/scanf16.c
|
|
+++ b/stdio-common/scanf16.c
|
|
@@ -113,7 +113,7 @@ main (void)
|
|
|
|
const char *tmpdir = getenv ("TMPDIR");
|
|
if (tmpdir == NULL || tmpdir[0] == '\0')
|
|
- tmpdir = "/tmp";
|
|
+ tmpdir = "@TERMUX_PREFIX_CLASSICAL@/tmp";
|
|
|
|
char fname[strlen (tmpdir) + sizeof "/tst-scanf16.XXXXXX"];
|
|
sprintf (fname, "%s/tst-scanf16.XXXXXX", tmpdir);
|
|
diff --git a/stdio-common/scanf17.c b/stdio-common/scanf17.c
|
|
index 2589de10..44cc26a7 100644
|
|
--- a/stdio-common/scanf17.c
|
|
+++ b/stdio-common/scanf17.c
|
|
@@ -96,7 +96,7 @@ main (void)
|
|
|
|
const char *tmpdir = getenv ("TMPDIR");
|
|
if (tmpdir == NULL || tmpdir[0] == '\0')
|
|
- tmpdir = "/tmp";
|
|
+ tmpdir = "@TERMUX_PREFIX_CLASSICAL@/tmp";
|
|
|
|
char fname[strlen (tmpdir) + sizeof "/tst-scanf17.XXXXXX"];
|
|
sprintf (fname, "%s/tst-scanf17.XXXXXX", tmpdir);
|
|
diff --git a/stdio-common/scanf18.c b/stdio-common/scanf18.c
|
|
index faf25556..0804e188 100644
|
|
--- a/stdio-common/scanf18.c
|
|
+++ b/stdio-common/scanf18.c
|
|
@@ -88,7 +88,7 @@ main (void)
|
|
|
|
const char *tmpdir = getenv ("TMPDIR");
|
|
if (tmpdir == NULL || tmpdir[0] == '\0')
|
|
- tmpdir = "/tmp";
|
|
+ tmpdir = "@TERMUX_PREFIX_CLASSICAL@/tmp";
|
|
|
|
char fname[strlen (tmpdir) + sizeof "/tst-scanf14.XXXXXX"];
|
|
sprintf (fname, "%s/tst-scanf14.XXXXXX", tmpdir);
|
|
diff --git a/stdio-common/scanf19.c b/stdio-common/scanf19.c
|
|
index 1905d32e..eebdb1e1 100644
|
|
--- a/stdio-common/scanf19.c
|
|
+++ b/stdio-common/scanf19.c
|
|
@@ -118,7 +118,7 @@ main (void)
|
|
|
|
const char *tmpdir = getenv ("TMPDIR");
|
|
if (tmpdir == NULL || tmpdir[0] == '\0')
|
|
- tmpdir = "/tmp";
|
|
+ tmpdir = "@TERMUX_PREFIX_CLASSICAL@/tmp";
|
|
|
|
char fname[strlen (tmpdir) + sizeof "/tst-scanf16.XXXXXX"];
|
|
sprintf (fname, "%s/tst-scanf16.XXXXXX", tmpdir);
|
|
diff --git a/stdio-common/tmpdir.c b/stdio-common/tmpdir.c
|
|
index 53debf06..66bdcf2b 100644
|
|
--- a/stdio-common/tmpdir.c
|
|
+++ b/stdio-common/tmpdir.c
|
|
@@ -34,7 +34,7 @@
|
|
# ifdef _P_tmpdir /* native Windows */
|
|
# define P_tmpdir _P_tmpdir
|
|
# else
|
|
-# define P_tmpdir "/tmp"
|
|
+# define P_tmpdir "@TERMUX_PREFIX_CLASSICAL@/tmp"
|
|
# endif
|
|
#endif
|
|
|
|
@@ -133,8 +133,8 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
|
|
#endif
|
|
if (direxists (P_tmpdir))
|
|
dir = P_tmpdir;
|
|
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
|
|
- dir = "/tmp";
|
|
+ else if (strcmp (P_tmpdir, "@TERMUX_PREFIX_CLASSICAL@/tmp") != 0 && direxists ("@TERMUX_PREFIX_CLASSICAL@/tmp"))
|
|
+ dir = "@TERMUX_PREFIX_CLASSICAL@/tmp";
|
|
else
|
|
{
|
|
__set_errno (ENOENT);
|
|
diff --git a/stdio-common/tstscanf.c b/stdio-common/tstscanf.c
|
|
index bb3e55db..bb7aaf51 100644
|
|
--- a/stdio-common/tstscanf.c
|
|
+++ b/stdio-common/tstscanf.c
|
|
@@ -62,7 +62,7 @@ main (int argc, char **argv)
|
|
|
|
if (argc == 2 && !strcmp (argv[1], "-opipe"))
|
|
{
|
|
- out = popen ("/bin/cat", "w");
|
|
+ out = popen ("@TERMUX_PREFIX@/bin/cat", "w");
|
|
if (out == NULL)
|
|
{
|
|
perror ("popen: /bin/cat");
|
|
@@ -71,7 +71,7 @@ main (int argc, char **argv)
|
|
}
|
|
else if (argc == 3 && !strcmp (argv[1], "-ipipe"))
|
|
{
|
|
- sprintf (buf, "/bin/cat %s", argv[2]);
|
|
+ sprintf (buf, "@TERMUX_PREFIX@/bin/cat %s", argv[2]);
|
|
in = popen (buf, "r");
|
|
if (in == NULL)
|
|
{
|
|
diff --git a/stdio-common/xbug.c b/stdio-common/xbug.c
|
|
index 06f74aff..034f510c 100644
|
|
--- a/stdio-common/xbug.c
|
|
+++ b/stdio-common/xbug.c
|
|
@@ -60,7 +60,7 @@ main(int argc, char *argv[])
|
|
|
|
unsetenv ("LD_LIBRARY_PATH");
|
|
|
|
- if (!(input = popen("/bin/cat", "r")))
|
|
+ if (!(input = popen("@TERMUX_PREFIX@/bin/cat", "r")))
|
|
fprintf(stderr, "cannot run \n");
|
|
|
|
ReadFile(&buffer, input);
|
|
diff --git a/stdlib/isomac.c b/stdlib/isomac.c
|
|
index dc48aa62..76b2ecac 100644
|
|
--- a/stdlib/isomac.c
|
|
+++ b/stdlib/isomac.c
|
|
@@ -74,7 +74,7 @@
|
|
|
|
#define HEADER_MAX 256
|
|
|
|
-static char macrofile[] = "/tmp/isomac.XXXXXX";
|
|
+static char macrofile[] = "@TERMUX_PREFIX_CLASSICAL@/tmp/isomac.XXXXXX";
|
|
|
|
/* ISO C header names including Amendment 1 (without ".h" suffix). */
|
|
static char *header[] =
|
|
diff --git a/support/support_fuse.c b/support/support_fuse.c
|
|
index a70a74c8..95c8c1d3 100644
|
|
--- a/support/support_fuse.c
|
|
+++ b/support/support_fuse.c
|
|
@@ -671,7 +671,7 @@ init (void)
|
|
/* The test_dir test driver variable is not yet set at this point. */
|
|
const char *tmpdir = getenv ("TMPDIR");
|
|
if (tmpdir == NULL || tmpdir[0] == '\0')
|
|
- tmpdir = "/tmp";
|
|
+ tmpdir = "@TERMUX_PREFIX_CLASSICAL@/tmp";
|
|
|
|
char *prefix = xasprintf ("%s/glibc-tst-fuse.", tmpdir);
|
|
support_fuse_mountpoints = support_fuse_mkdir (prefix);
|
|
diff --git a/support/support_test_main.c b/support/support_test_main.c
|
|
index bd6c728f..a3edd8e0 100644
|
|
--- a/support/support_test_main.c
|
|
+++ b/support/support_test_main.c
|
|
@@ -351,7 +351,7 @@ support_test_main (int argc, char **argv, const struct test_config *config)
|
|
{
|
|
test_dir = getenv ("TMPDIR");
|
|
if (test_dir == NULL || test_dir[0] == '\0')
|
|
- test_dir = "/tmp";
|
|
+ test_dir = "@TERMUX_PREFIX_CLASSICAL@/tmp";
|
|
}
|
|
if (support_set_test_dir != NULL)
|
|
support_set_test_dir (test_dir);
|
|
diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
|
|
index 0ee65713..549fca17 100644
|
|
--- a/sysdeps/generic/dl-cache.h
|
|
+++ b/sysdeps/generic/dl-cache.h
|
|
@@ -34,8 +34,14 @@
|
|
((flags) == 1 || (flags) == _DL_CACHE_DEFAULT_ID)
|
|
#endif
|
|
|
|
+#ifdef MULTILIB_GLIBC
|
|
+# define LD_SO "ld32.so"
|
|
+#else
|
|
+# define LD_SO "ld.so"
|
|
+#endif
|
|
+
|
|
#ifndef LD_SO_CACHE
|
|
-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
|
|
+# define LD_SO_CACHE SYSCONFDIR "/" LD_SO ".cache"
|
|
#endif
|
|
|
|
#ifndef add_system_dir
|
|
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
|
|
index 7bc87886..6533b0a5 100644
|
|
--- a/sysdeps/generic/ldconfig.h
|
|
+++ b/sysdeps/generic/ldconfig.h
|
|
@@ -48,7 +48,12 @@
|
|
#define FLAG_LARCH_FLOAT_ABI_DOUBLE 0x1200
|
|
|
|
/* Name of auxiliary cache. */
|
|
-#define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
|
|
+#ifdef MULTILIB_GLIBC
|
|
+# define _LDCONFIG_NAME "ldconfig32"
|
|
+#else
|
|
+# define _LDCONFIG_NAME "ldconfig"
|
|
+#endif
|
|
+#define _PATH_LDCONFIG_AUX_CACHE "@TERMUX_PREFIX@/var/cache/" _LDCONFIG_NAME "/aux-cache"
|
|
|
|
/* Declared in cache.c. */
|
|
extern void print_cache (const char *cache_name);
|
|
diff --git a/sysdeps/generic/paths.h b/sysdeps/generic/paths.h
|
|
index 893b4c22..6c38ca05 100644
|
|
--- a/sysdeps/generic/paths.h
|
|
+++ b/sysdeps/generic/paths.h
|
|
@@ -33,43 +33,43 @@
|
|
#define _PATHS_H_
|
|
|
|
/* Default search path. */
|
|
-#define _PATH_DEFPATH "/usr/bin:/bin"
|
|
+#define _PATH_DEFPATH "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX_CLASSICAL@/bin:/system/bin"
|
|
/* All standard utilities path. */
|
|
#define _PATH_STDPATH \
|
|
- "/usr/bin:/bin:/usr/sbin:/sbin"
|
|
+ "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX_CLASSICAL@/bin:/system/bin"
|
|
|
|
-#define _PATH_BSHELL "/bin/sh"
|
|
+#define _PATH_BSHELL "@TERMUX_PREFIX@/bin/sh"
|
|
#define _PATH_CONSOLE "/dev/console"
|
|
-#define _PATH_CSHELL "/bin/csh"
|
|
-#define _PATH_DEVDB "/var/run/dev.db"
|
|
+#define _PATH_CSHELL "@TERMUX_PREFIX@/bin/csh"
|
|
+#define _PATH_DEVDB "@TERMUX_PREFIX@/var/run/dev.db"
|
|
#define _PATH_DEVNULL "/dev/null"
|
|
#define _PATH_DRUM "/dev/drum"
|
|
-#define _PATH_GSHADOW "/etc/gshadow"
|
|
+#define _PATH_GSHADOW "@TERMUX_PREFIX@/etc/gshadow"
|
|
#define _PATH_KMEM "/dev/kmem"
|
|
-#define _PATH_LASTLOG "/var/log/lastlog"
|
|
-#define _PATH_MAILDIR "/var/mail"
|
|
-#define _PATH_MAN "/usr/share/man"
|
|
+#define _PATH_LASTLOG "@TERMUX_PREFIX@/var/log/lastlog"
|
|
+#define _PATH_MAILDIR "@TERMUX_PREFIX@/var/mail"
|
|
+#define _PATH_MAN "@TERMUX_PREFIX@/share/man"
|
|
#define _PATH_MEM "/dev/mem"
|
|
-#define _PATH_MNTTAB "/etc/fstab"
|
|
-#define _PATH_MOUNTED "/var/run/mtab"
|
|
-#define _PATH_NOLOGIN "/etc/nologin"
|
|
-#define _PATH_PRESERVE "/var/lib"
|
|
-#define _PATH_RWHODIR "/var/spool/rwho"
|
|
-#define _PATH_SENDMAIL "/usr/sbin/sendmail"
|
|
-#define _PATH_SHADOW "/etc/shadow"
|
|
-#define _PATH_SHELLS "/etc/shells"
|
|
+#define _PATH_MNTTAB "@TERMUX_PREFIX@/etc/fstab"
|
|
+#define _PATH_MOUNTED "@TERMUX_PREFIX@/var/run/mtab"
|
|
+#define _PATH_NOLOGIN "@TERMUX_PREFIX@/etc/nologin"
|
|
+#define _PATH_PRESERVE "@TERMUX_PREFIX@/var/lib"
|
|
+#define _PATH_RWHODIR "@TERMUX_PREFIX@/var/spool/rwho"
|
|
+#define _PATH_SENDMAIL "@TERMUX_PREFIX@/bin/sendmail"
|
|
+#define _PATH_SHADOW "@TERMUX_PREFIX@/etc/shadow"
|
|
+#define _PATH_SHELLS "@TERMUX_PREFIX@/etc/shells"
|
|
#define _PATH_TTY "/dev/tty"
|
|
#define _PATH_UNIX "/vmunix"
|
|
-#define _PATH_UTMP "/var/run/utmp"
|
|
-#define _PATH_UTMP_DB "/var/run/utmp.db"
|
|
-#define _PATH_VI "/usr/bin/vi"
|
|
-#define _PATH_WTMP "/var/log/wtmp"
|
|
+#define _PATH_UTMP "@TERMUX_PREFIX@/var/run/utmp"
|
|
+#define _PATH_UTMP_DB "@TERMUX_PREFIX@/var/run/utmp.db"
|
|
+#define _PATH_VI "@TERMUX_PREFIX@/bin/vi"
|
|
+#define _PATH_WTMP "@TERMUX_PREFIX@/var/log/wtmp"
|
|
|
|
/* Provide trailing slash, since mostly used for building pathnames. */
|
|
#define _PATH_DEV "/dev/"
|
|
-#define _PATH_TMP "/tmp/"
|
|
-#define _PATH_VARDB "/var/db/"
|
|
-#define _PATH_VARRUN "/var/run/"
|
|
-#define _PATH_VARTMP "/var/tmp/"
|
|
+#define _PATH_TMP "@TERMUX_PREFIX_CLASSICAL@/tmp/"
|
|
+#define _PATH_VARDB "@TERMUX_PREFIX@/var/db/"
|
|
+#define _PATH_VARRUN "@TERMUX_PREFIX@/var/run/"
|
|
+#define _PATH_VARTMP "@TERMUX_PREFIX@/var/tmp/"
|
|
|
|
#endif /* !_PATHS_H_ */
|
|
diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
|
|
index 2c33569f..6fa00b4a 100644
|
|
--- a/sysdeps/posix/system.c
|
|
+++ b/sysdeps/posix/system.c
|
|
@@ -31,7 +31,7 @@
|
|
#include <not-cancel.h>
|
|
#include <internal-signals.h>
|
|
|
|
-#define SHELL_PATH "/bin/sh" /* Path of the shell. */
|
|
+#define SHELL_PATH "@TERMUX_PREFIX@/bin/sh" /* Path of the shell. */
|
|
#define SHELL_NAME "sh" /* Name to give it. */
|
|
|
|
|
|
diff --git a/sysdeps/unix/confstr.h b/sysdeps/unix/confstr.h
|
|
index 15859c3b..3bc390f5 100644
|
|
--- a/sysdeps/unix/confstr.h
|
|
+++ b/sysdeps/unix/confstr.h
|
|
@@ -1 +1 @@
|
|
-#define CS_PATH "/bin:/usr/bin"
|
|
+#define CS_PATH "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX_CLASSICAL@/bin:/system/bin"
|
|
diff --git a/sysdeps/unix/sysv/linux/gentempfd.c b/sysdeps/unix/sysv/linux/gentempfd.c
|
|
index 1cdadc1f..c3efd981 100644
|
|
--- a/sysdeps/unix/sysv/linux/gentempfd.c
|
|
+++ b/sysdeps/unix/sysv/linux/gentempfd.c
|
|
@@ -26,8 +26,8 @@ __gen_tempfd (int flags)
|
|
{
|
|
int fd = __open (P_tmpdir, O_RDWR | O_TMPFILE | O_EXCL | flags,
|
|
S_IRUSR | S_IWUSR);
|
|
- if (fd < 0 && errno == ENOENT && strcmp (P_tmpdir, "/tmp") != 0)
|
|
- fd = __open ("/tmp", O_RDWR | O_TMPFILE | O_EXCL | flags,
|
|
+ if (fd < 0 && errno == ENOENT && strcmp (P_tmpdir, "@TERMUX_PREFIX_CLASSICAL@/tmp") != 0)
|
|
+ fd = __open ("@TERMUX_PREFIX_CLASSICAL@/tmp", O_RDWR | O_TMPFILE | O_EXCL | flags,
|
|
S_IRUSR | S_IWUSR);
|
|
|
|
return fd;
|
|
diff --git a/sysdeps/unix/sysv/linux/paths.h b/sysdeps/unix/sysv/linux/paths.h
|
|
index 1342ab3a..357120b4 100644
|
|
--- a/sysdeps/unix/sysv/linux/paths.h
|
|
+++ b/sysdeps/unix/sysv/linux/paths.h
|
|
@@ -33,43 +33,43 @@
|
|
#define _PATHS_H_
|
|
|
|
/* Default search path. */
|
|
-#define _PATH_DEFPATH "/usr/bin:/bin"
|
|
+#define _PATH_DEFPATH "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX_CLASSICAL@/bin:/system/bin"
|
|
/* All standard utilities path. */
|
|
#define _PATH_STDPATH \
|
|
- "/usr/bin:/bin:/usr/sbin:/sbin"
|
|
+ "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX_CLASSICAL@/bin:/system/bin"
|
|
|
|
-#define _PATH_BSHELL "/bin/sh"
|
|
+#define _PATH_BSHELL "@TERMUX_PREFIX@/bin/sh"
|
|
#define _PATH_CONSOLE "/dev/console"
|
|
-#define _PATH_CSHELL "/bin/csh"
|
|
-#define _PATH_DEVDB "/var/run/dev.db"
|
|
+#define _PATH_CSHELL "@TERMUX_PREFIX@/bin/csh"
|
|
+#define _PATH_DEVDB "@TERMUX_PREFIX@/var/run/dev.db"
|
|
#define _PATH_DEVNULL "/dev/null"
|
|
#define _PATH_DRUM "/dev/drum"
|
|
-#define _PATH_GSHADOW "/etc/gshadow"
|
|
+#define _PATH_GSHADOW "@TERMUX_PREFIX@/etc/gshadow"
|
|
#define _PATH_KLOG "/proc/kmsg"
|
|
#define _PATH_KMEM "/dev/kmem"
|
|
-#define _PATH_LASTLOG "/var/log/lastlog"
|
|
-#define _PATH_MAILDIR "/var/mail"
|
|
-#define _PATH_MAN "/usr/share/man"
|
|
+#define _PATH_LASTLOG "@TERMUX_PREFIX@/var/log/lastlog"
|
|
+#define _PATH_MAILDIR "@TERMUX_PREFIX@/var/mail"
|
|
+#define _PATH_MAN "@TERMUX_PREFIX@/share/man"
|
|
#define _PATH_MEM "/dev/mem"
|
|
-#define _PATH_MNTTAB "/etc/fstab"
|
|
-#define _PATH_MOUNTED "/etc/mtab"
|
|
-#define _PATH_NOLOGIN "/etc/nologin"
|
|
-#define _PATH_PRESERVE "/var/lib"
|
|
-#define _PATH_RWHODIR "/var/spool/rwho"
|
|
-#define _PATH_SENDMAIL "/usr/sbin/sendmail"
|
|
-#define _PATH_SHADOW "/etc/shadow"
|
|
-#define _PATH_SHELLS "/etc/shells"
|
|
+#define _PATH_MNTTAB "@TERMUX_PREFIX@/etc/fstab"
|
|
+#define _PATH_MOUNTED "@TERMUX_PREFIX@/etc/mtab"
|
|
+#define _PATH_NOLOGIN "@TERMUX_PREFIX@/etc/nologin"
|
|
+#define _PATH_PRESERVE "@TERMUX_PREFIX@/var/lib"
|
|
+#define _PATH_RWHODIR "@TERMUX_PREFIX@/var/spool/rwho"
|
|
+#define _PATH_SENDMAIL "@TERMUX_PREFIX@/bin/sendmail"
|
|
+#define _PATH_SHADOW "@TERMUX_PREFIX@/etc/shadow"
|
|
+#define _PATH_SHELLS "@TERMUX_PREFIX@/etc/shells"
|
|
#define _PATH_TTY "/dev/tty"
|
|
#define _PATH_UNIX "/boot/vmlinux"
|
|
-#define _PATH_UTMP "/var/run/utmp"
|
|
-#define _PATH_VI "/usr/bin/vi"
|
|
-#define _PATH_WTMP "/var/log/wtmp"
|
|
+#define _PATH_UTMP "@TERMUX_PREFIX@/var/run/utmp"
|
|
+#define _PATH_VI "@TERMUX_PREFIX@/bin/vi"
|
|
+#define _PATH_WTMP "@TERMUX_PREFIX@/var/log/wtmp"
|
|
|
|
/* Provide trailing slash, since mostly used for building pathnames. */
|
|
#define _PATH_DEV "/dev/"
|
|
-#define _PATH_TMP "/tmp/"
|
|
-#define _PATH_VARDB "/var/db/"
|
|
-#define _PATH_VARRUN "/var/run/"
|
|
-#define _PATH_VARTMP "/var/tmp/"
|
|
+#define _PATH_TMP "@TERMUX_PREFIX_CLASSICAL@/tmp/"
|
|
+#define _PATH_VARDB "@TERMUX_PREFIX@/var/db/"
|
|
+#define _PATH_VARRUN "@TERMUX_PREFIX@/var/run/"
|
|
+#define _PATH_VARTMP "@TERMUX_PREFIX@/var/tmp/"
|
|
|
|
#endif /* !_PATHS_H_ */
|
|
diff --git a/sysdeps/unix/sysv/linux/riscv/dl-cache.h b/sysdeps/unix/sysv/linux/riscv/dl-cache.h
|
|
index 6e096792..ae22233b 100644
|
|
--- a/sysdeps/unix/sysv/linux/riscv/dl-cache.h
|
|
+++ b/sysdeps/unix/sysv/linux/riscv/dl-cache.h
|
|
@@ -58,7 +58,7 @@
|
|
"/lib32/ilp32", \
|
|
NULL, \
|
|
}; \
|
|
- const size_t lib_len = sizeof ("/lib") - 1; \
|
|
+ const size_t lib_len = sizeof ("@TERMUX_PREFIX@/lib") - 1; \
|
|
size_t len = strlen (dir); \
|
|
char path[len + 10]; \
|
|
const char **ptr; \
|