+ allow net.c to compile on systems without AF_INET6
+ Only use long_to_sigset on Linux systems
+ UnixWare treats sigmask_t and sigmask_t* as the same thing
+ + Add pollhack
Fri Nov 26 01:28:09 CET 1999 Wichert Akkerman <wakkerma@debian.org>
#define UNIXWARE 2
#define HAVE_POLLABLE_PROCFS 1
+On UnixWare using the -f option to follow forked children sometimes shows
+many "unfinished" system calls as strace bounces between each runnable child.
+A crude workaround for this is available by adding
+
+ #define POLL_HACK 1
+
+to the config.h file. This forces strace to check whether the last process
+has finished a system call before polling other processes for events.
+
Wichert Akkerman <wakkerma@debian.org>
static int
trace()
{
+#ifdef POLL_HACK
+ struct tcb *in_syscall;
+#endif
struct tcb *tcp;
int pfd;
int what;
#endif /* !HAVE_POLLABLE_PROCFS */
default:
#ifdef HAVE_POLLABLE_PROCFS
+#ifdef POLL_HACK
+ /* On some systems (e.g. UnixWare) we get too much ugly
+ "unfinished..." stuff when multiple proceses are in
+ syscalls. Here's a nasty hack */
+
+ if (in_syscall) {
+ struct pollfd pv;
+ tcp = in_syscall;
+ in_syscall = NULL;
+ pv.fd = tcp->pfd;
+ pv.events = POLLWANT;
+ if ((what = poll (&pv, 1, 1)) < 0) {
+ if (interrupted)
+ return 0;
+ continue;
+ }
+ else if (what == 1 && pv.revents & POLLWANT) {
+ goto FOUND;
+ }
+ }
+#endif
+
if (poll(pollv, nprocs, INFTIM) < 0) {
if (interrupted)
return 0;
fprintf(stderr, "unknown pfd: %u\n", pfd);
exit(1);
}
+ FOUND:
/* Get the status of the process. */
if (!interrupted) {
ioctl_result = IOCTL_WSTOP (tcp);
}
break;
case PR_SYSENTRY:
+#ifdef POLL_HACK
+ in_syscall = tcp;
+#endif
case PR_SYSEXIT:
if (trace_syscall(tcp) < 0) {
fprintf(stderr, "syscall trouble\n");