linux-pid-attach.c on non-Linux hosts

Mark Wielaard mjw at redhat.com
Tue Apr 22 11:28:20 UTC 2014


Hi Kurt,

On Mon, 2014-04-21 at 22:39 +0200, Kurt Roeckx wrote:
> It seems linux-pid-attach.c doesn't build on any of the non-Linux
> hosts, which is probably normal given it's name.  FreeBSD has a
> problem with the everything related to pthread while Hurd seems
> to only have a problem with syscall __NR_tkill.
> 
> How do you suggest I deal with that?

I think libdwfl functions that rely on the specifics of GNU/Linux
(kernel/modules, core file format, proc fs, signals/ptrace) can just
return NULL and fail on other platforms. So just ifdef out the code in
that file. And implement dwfl_linux_proc_attach and the internal
functions __libdwfl_ptrace_attach __libdwfl_ptrace_detach
dwfl_linux_proc_attach __libdwfl_get_pid_arg as always failing in that
case.

Cheers,

Mark



More information about the elfutils-devel mailing list