+
+#ifdef SVR4
+#ifdef HAVE_MP_PROCFS
+extern int mp_ioctl (int f, int c, void *a, int s);
+#define IOCTL(f,c,a) mp_ioctl (f, c, a, sizeof *a)
+#define IOCTL_STATUS(t) \
+ pread (t->pfd_stat, &t->status, sizeof t->status, 0)
+#define IOCTL_WSTOP(t) \
+ (IOCTL (t->pfd, PCWSTOP, (char *)NULL) < 0 ? -1 : \
+ IOCTL_STATUS (t))
+#define PR_WHY pr_lwp.pr_why
+#define PR_WHAT pr_lwp.pr_what
+#define PR_REG pr_lwp.pr_context.uc_mcontext.gregs
+#define PR_FLAGS pr_lwp.pr_flags
+#define PR_SYSCALL pr_lwp.pr_syscall
+#define PIOCSTIP PCSTOP
+#define PIOCSET PCSET
+#define PIOCRESET PCRESET
+#define PIOCSTRACE PCSTRACE
+#define PIOCSFAULT PCSFAULT
+#define PIOCWSTOP PCWSTOP
+#define PIOCSTOP PCSTOP
+#define PIOCSENTRY PCSENTRY
+#define PIOCSEXIT PCSEXIT
+#define PIOCRUN PCRUN
+#else
+#define IOCTL ioctl
+#define IOCTL_STATUS(t) ioctl (t->pfd, PIOCSTATUS, &t->status)
+#define IOCTL_WSTOP(t) ioctl (t->pfd, PIOCWSTOP, &t->status)
+#define PR_WHY pr_why
+#define PR_WHAT pr_what
+#define PR_REG pr_reg
+#define PR_FLAGS pr_flags
+#define PR_SYSCALL pr_syscall
+#endif
+#endif
+#ifdef FREEBSD
+#define IOCTL ioctl
+#define IOCTL_STATUS(t) ioctl (t->pfd, PIOCSTATUS, &t->status)
+#define IOCTL_WSTOP(t) ioctl (t->pfd, PIOCWAIT, &t->status)
+#define PIOCRUN PIOCCONT
+#define PIOCWSTOP PIOCWAIT
+#define PR_WHY why
+#define PR_WHAT val
+#define PR_FLAGS state
+/* from /usr/src/sys/miscfs/procfs/procfs_vnops.c,
+ status.state = 0 for running, 1 for stopped */
+#define PR_ASLEEP 1
+#define PR_SYSENTRY S_SCE
+#define PR_SYSEXIT S_SCX
+#define PR_SIGNALLED S_SIG
+#define PR_FAULTED S_CORE
+#endif
+