{ "/dev/fb1", FAKEDEV_FB1 },
{ "/dev/fb/1", FAKEDEV_FB1 },
{ "/dev/mmuhack", FAKEDEV_MMUHACK },
- { "/dev/tty", FAKEDEV_TTY0 },
+ { "/dev/tty", FAKEDEV_TTY },
{ "/dev/tty0", FAKEDEV_TTY0 },
+ { "/dev/touchscreen/wm97xx", FAKEDEV_WM97XX },
+ { "/etc/pointercal", FAKEDEV_WM97XX_P },
+ { "/dev/input/mice", -ENODEV },
#ifdef PND
- { "/dev/input/event*", -1 }, // hide for now, may cause dupe events
+ { "/dev/input/event*", -ENODEV }, // hide for now, may cause dupe events
#endif
};
-static long w_open_raw(const char *pathname, int flags, mode_t mode)
+long w_open_raw(const char *pathname, int flags, mode_t mode)
{
long ret;
int i;
}
}
- if (i == ARRAY_SIZE(takeover_devs))
- ret = g_open_raw(pathname, flags, mode);
+ if (i == ARRAY_SIZE(takeover_devs)) {
+ const char *w_path = emu_wrap_path(pathname);
+ ret = g_open_raw(w_path, flags, mode);
+ emu_wrap_path_free(w_path, pathname);
+ }
if (ret >= 0) {
for (i = 0; emu_interesting_fds[i].name != NULL; i++) {
{
long ret;
- if (fd == FAKEDEV_GPIO)
- ret = emu_read_gpiodev(buf, count);
+ if (FAKEDEV_MEM <= fd && fd < FAKEDEV_FD_BOUNDARY)
+ ret = emu_do_read(fd, buf, count);
else
ret = g_read_raw(fd, buf, count);
- //strace("read(%d, %p, %ld) = %ld\n", fd, buf, count, ret);
+ //strace("read(%d, %p, %zd) = %ld\n", fd, buf, count, ret);
return ret;
}
return emu_do_execve(file, argv, environ);
}
-// static note: this can't safely return because of the way it's patched in
-// static note2: can't be used, execve hangs?
-static UNUSED int w_execve(const char *filename, char *const argv[],
- char *const envp[])
+long w_execve_raw(const char *filename, char * const argv[],
+ char * const envp[])
{
strace("execve(%s, %p, %p) = ?\n", filename, argv, envp);
return emu_do_execve(filename, argv, envp);
}
+static UNUSED int w_execve(const char *filename, char * const argv[],
+ char * const envp[])
+{
+ long ret = w_execve_raw(filename, argv, envp);
+ return g_syscall_error(ret);
+}
+
static int w_chdir(const char *path)
{
long ret;
{
long ret;
+#ifndef DL
if (path != NULL && strncmp(path, "/proc/", 6) == 0
&& strcmp(strrchr(path, '/'), "/exe") == 0)
{
ret = bufsiz;
}
else
+#endif
ret = g_readlink_raw(path, buf, bufsiz);
strace("readlink(%s, %s, %zd) = %ld\n", path, buf, bufsiz, ret);
MAKE_WRAP_SYM_N(execle);
MAKE_WRAP_SYM_N(execv);
MAKE_WRAP_SYM_N(execvp);
-MAKE_WRAP_SYM(execve);
+MAKE_WRAP_SYM_N(execve);
MAKE_WRAP_SYM_N(chdir);
MAKE_WRAP_SYM_N(readlink);
typeof(mmap) mmap2 __attribute__((alias("w_mmap")));
REAL_FUNC_NP(tcsetattr),
REAL_FUNC_NP(system),
// exec* - skipped
- REAL_FUNC_NP(execve),
+ //REAL_FUNC_NP(execve),
//REAL_FUNC_NP(chdir),
};
#define tcgetattr p_real_tcgetattr
#define tcsetattr p_real_tcsetattr
#define system p_real_system
-#define execve p_real_execve
+//#define execve p_real_execve
//#define chdir p_real_chdir
#undef MAKE_WRAP_SYM
int real_execve(const char *filename, char *const argv[],
char *const envp[])
{
- return execve(filename, argv, envp);
+ long ret = g_execve_raw(filename, argv, envp);
+ return g_syscall_error(ret);
}
int real_chdir(const char *path)