[PATCH] [V2] add options to ps(1) to display lwp data

Matthew Dillon dillon at apollo.backplane.com
Wed Aug 15 01:38:33 PDT 2007

:It wasn't ment to be a pointer, just an identifier.  And the td pointer is a perfect identifier.  Of course, it doesn't format as nicely as a small number, but so what.  pid == -1 means kernel, tid *always* means thread identifier.
:  simon

    It can't be negative and I don't want to hack around the fact by masking
    it with 0x7fffffff, because that requires visibility into the machine
    layer to work properly in 64 bit environments.  Also, there's nothing
    that says the TID is going to be the same or similar in size to a pointer,
    and userland does in fact need the TID because that's what you specify
    when you send signals.

    We can't just use a thread pointer between userland and the kernel.
    The kernel has to validate the ID passed to it either way so it just
    doesn't save any work at all to do that.


More information about the Submit mailing list