2 #include "../loader/realfuncs.h"
10 int make_local_path(char *buf, size_t size, const char *file)
15 ret = readlink("/proc/self/exe", buf, size - 1);
22 p = strrchr(buf, '/');
27 if (strstr(p, ".so")) {
28 p = getenv("GINGE_ROOT");
32 p = buf + strlen(buf);
35 snprintf(p, size - (p - buf), "%s", file);
40 fprintf(stderr, "ginge: can't determine root, buf: \"%s\"\n", buf);