- Copyright 1997, 1998, 2002, 2004, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright 1997-2020 Free Software Foundation, Inc.
/* Utility of cb_syscall to fetch a path name or other string from the target.
The result is 0 for success or a host errno value. */
/* Utility of cb_syscall to fetch a path name or other string from the target.
The result is 0 for success or a host errno value. */
-static int
-get_string (cb, sc, buf, buflen, addr)
- host_callback *cb;
- CB_SYSCALL *sc;
- char *buf;
- int buflen;
- TADDR addr;
+int
+cb_get_string (host_callback *cb, CB_SYSCALL *sc, char *buf, int buflen,
+ TADDR addr)
path name along with the syscall request, and cache the file
name somewhere (or otherwise tweak this as desired). */
unsigned int count = (*sc->read_mem) (cb, sc, addr, p, 1);
path name along with the syscall request, and cache the file
name somewhere (or otherwise tweak this as desired). */
unsigned int count = (*sc->read_mem) (cb, sc, addr, p, 1);
-get_path (cb, sc, addr, bufp)
- host_callback *cb;
- CB_SYSCALL *sc;
- TADDR addr;
- char **bufp;
+get_path (host_callback *cb, CB_SYSCALL *sc, TADDR addr, char **bufp)
- result = get_string (cb, sc, buf, MAX_PATH_LEN - sysroot_len, addr);
+ result = cb_get_string (cb, sc, buf, MAX_PATH_LEN - sysroot_len, addr);
{
result = (int) (*cb->write_stdout) (cb, buf, bytes_read);
(*cb->flush_stdout) (cb);
}
{
result = (int) (*cb->write_stdout) (cb, buf, bytes_read);
(*cb->flush_stdout) (cb);
}
{
result = (int) (*cb->write_stderr) (cb, buf, bytes_read);
(*cb->flush_stderr) (cb);
{
result = (int) (*cb->write_stderr) (cb, buf, bytes_read);
(*cb->flush_stderr) (cb);