In article <20170908115647.ga29...@mail.duskware.de>,
Martin Husemann  <mar...@duskware.de> wrote:
>On Fri, Sep 08, 2017 at 12:55:37PM +0200, Thomas Klausner wrote:
>> What's the best answer for NetBSD?
>
>If the kernel is 64bit:
>kvm_getproc2() and check the process flags for P_32.
>
>If not: all of them ;-}
>
>I would find it more interesting to answer "what is the emulation it runs
>under", so you have, say: netbsd native x86_64 processes, netbsd_compat32 
>i386 processes, 32 bit linux, 64 bit linux, .... (but I don't know an
>easy answer for that).

If you can attach to it with ktrace, the first record is an emul record.
If you have procfs cat /proc/<pid>/emul

christos

Reply via email to