Make target_strerror() return 'const char *' rather than just 'char *';
this will allow us to return constant strings from it for some special
cases.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
extern THREAD CPUState *thread_cpu;
void cpu_loop(CPUArchState *env);
-char *target_strerror(int err);
+const char *target_strerror(int err);
int get_osversion(void);
void init_qemu_uname_release(void);
void fork_start(void);
static void
print_syscall_ret_addr(const struct syscallname *name, abi_long ret)
{
- char *errstr = NULL;
+ const char *errstr = NULL;
if (ret < 0) {
errstr = target_strerror(-ret);
print_syscall_ret(int num, abi_long ret)
{
int i;
- char *errstr = NULL;
+ const char *errstr = NULL;
for(i=0;i<nsyscalls;i++)
if( scnames[i].nr == num ) {
return (abi_ulong)ret >= (abi_ulong)(-4096);
}
-char *target_strerror(int err)
+const char *target_strerror(int err)
{
if ((err >= ERRNO_TABLE_SIZE) || (err < 0)) {
return NULL;