]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/bfin/interp.c
sim: bfin: check for kill/pread
[thirdparty/binutils-gdb.git] / sim / bfin / interp.c
index 1f8681df16aeb692ae8a98717d2440e45162cb55..f8669d308809d4a53a189131c7ee7e5694461d44 100644 (file)
@@ -297,6 +297,7 @@ bfin_syscall (SIM_CPU *cpu)
          sc.errcode = TARGET_ENOSYS;
        else
          {
+#ifdef HAVE_PREAD
            char *data = xmalloc (sc.arg2);
 
            /* XXX: Should add a cb->pread.  */
@@ -306,6 +307,9 @@ bfin_syscall (SIM_CPU *cpu)
              sc.errcode = TARGET_EINVAL;
 
            free (data);
+#else
+           sc.errcode = TARGET_ENOSYS;
+#endif
          }
 
        if (sc.errcode)
@@ -495,8 +499,13 @@ bfin_syscall (SIM_CPU *cpu)
        }
       else
        {
+#ifdef HAVE_KILL
          sc.result = kill (sc.arg1, sc.arg2);
          goto sys_finish;
+#else
+         sc.result = -1;
+         sc.errcode = TARGET_ENOSYS;
+#endif
        }
       break;