Commit 96515edd authored by Stewart Brodie's avatar Stewart Brodie
Browse files

Sets sockets as taskwindow-friendly so machine doesn't halt when using the tool.

parent ac05d186
...@@ -47,6 +47,8 @@ static char RcsId[] = "$Header$"; ...@@ -47,6 +47,8 @@ static char RcsId[] = "$Header$";
#ifdef __riscos #ifdef __riscos
#include "riscos.h" #include "riscos.h"
#include "kernel.h"
#define OS_Upcall (0x33)
#endif #endif
#include "sys/errno.h" #include "sys/errno.h"
#include "netdb.h" #include "netdb.h"
...@@ -528,6 +530,14 @@ main(int argc, char **argv) ...@@ -528,6 +530,14 @@ main(int argc, char **argv)
exit(3); exit(3);
} }
#ifdef __riscos
{
int one = 1;
(void) ioctl(icmp_sock, FIOSLEEPTW, &one);
(void) ioctl(sock, FIOSLEEPTW, &one);
}
#endif
if( !Broadcast ) if( !Broadcast )
{ {
/* /*
...@@ -658,7 +668,23 @@ main(int argc, char **argv) ...@@ -658,7 +668,23 @@ main(int argc, char **argv)
dc.tv_sec = repeat_delay / 1000000; dc.tv_sec = repeat_delay / 1000000;
dc.tv_usec = repeat_delay % 1000000; dc.tv_usec = repeat_delay % 1000000;
#ifdef __riscos
{
struct timeval tc;
gettimeofday(&tc, NULL);
dc.tv_usec += tc.tv_usec;
dc.tv_sec += tc.tv_sec + (dc.tv_usec / 1000000);
dc.tv_usec = dc.tv_usec % 1000000;
while (tc.tv_sec < dc.tv_sec ||
(tc.tv_sec == dc.tv_sec && tc.tv_usec < dc.tv_usec)) {
_kernel_swi_regs r = { 6 };
(void) _kernel_swi(OS_Upcall, &r, &r);
gettimeofday(&tc, NULL);
}
}
#else
(void)select(0, NULL, NULL, NULL, &dc); (void)select(0, NULL, NULL, NULL, &dc);
#endif
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment