aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-29 03:13:54 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-29 20:12:57 -0400
commit999b474b8aa49f522984b2f4c1d954a2229882b9 (patch)
tree79bda7b6988afe95d46381f72b3c7c89a37c3095 /sim
parentc42ed5fca27571c25cd266f7cef25e13494f440e (diff)
downloadgdb-999b474b8aa49f522984b2f4c1d954a2229882b9.zip
gdb-999b474b8aa49f522984b2f4c1d954a2229882b9.tar.gz
gdb-999b474b8aa49f522984b2f4c1d954a2229882b9.tar.bz2
sim: callback: add check for HAVE_KILL
Fix building on systems w/out a kill function (e.g. Windows).
Diffstat (limited to 'sim')
-rw-r--r--sim/common/ChangeLog4
-rw-r--r--sim/common/callback.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 7b21b00..da6511c 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,9 @@
2021-06-29 Mike Frysinger <vapier@gentoo.org>
+ * callback.c [!HAVE_KILL] (os_kill): Return ENOSYS.
+
+2021-06-29 Mike Frysinger <vapier@gentoo.org>
+
* sim-model.c (model_option_handler): Make machp const.
(sim_model_lookup): Likewise.
(sim_mach_lookup): Likewise.
diff --git a/sim/common/callback.c b/sim/common/callback.c
index f773de1..39d068c 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -544,11 +544,16 @@ os_getpid (host_callback *p)
static int
os_kill (host_callback *p, int pid, int signum)
{
+#ifdef HAVE_KILL
int result;
result = kill (pid, signum);
p->last_errno = errno;
return result;
+#else
+ p->last_errno = ENOSYS;
+ return -1;
+#endif
}
static int