+ ret = g_chdir_raw(path);
+
+ strace("chdir(%s) = %ld\n", path, ret);
+ return g_syscall_error(ret);
+}
+
+static ssize_t w_readlink(const char *path, char *buf, size_t bufsiz)
+{
+ long ret;
+
+#ifndef DL
+ if (path != NULL && strncmp(path, "/proc/", 6) == 0
+ && strcmp(strrchr(path, '/'), "/exe") == 0)
+ {
+ ret = snprintf(buf, bufsiz, "%s", bin_path);
+ if (ret > bufsiz)
+ ret = bufsiz;
+ }
+ else
+#endif
+ ret = g_readlink_raw(path, buf, bufsiz);
+
+ strace("readlink(%s, %s, %zd) = %ld\n", path, buf, bufsiz, ret);
+ return g_syscall_error(ret);