Which function returns LWP in Linux.



Hi,

For a process, we have different PIDs. For threads under a single
processes, we have different LWP id, but same PID in Linux.
ex.

root@pc:/home/srinivas# ps -eLf
UID PID PPID LWP C STIME TIME CMD
root 100 1 100 0 May13 00:00:02 ./a.out
root 100 1 102 0 May13 00:00:00 ./a.out

getpid() function returns PID of a process.
Which function retuns LWP id for thread?

Sincerely,
Srinivas Nayak
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Optimization help - reading out of /proc on Solaris
    ... I was expecting the pure Ruby ... # pid of session leader ... # usr + sys cpu time for reaped children ... # wait address for sleeping lwp ...
    (comp.lang.ruby)
  • NPTL: pid of a thread and gdb
    ... In NPTL the parent and the thread have the same pid. ... Then on what basis gdb differentiates between the ... case LWP is same as pid). ...
    (Linux-Kernel)
  • Re: Which function returns LWP in Linux.
    ... processes, we have different LWP id, but same PID in Linux. ... getpid() function returns PID of a process. ... Which function retuns LWP id for thread? ...
    (Linux-Kernel)
  • 9.1 coredump
    ... 462986 data packets ... linux: pid 1069: syscall pipe2 not implemented ...
    (freebsd-stable)
  • Re: Is fork() hook ever possible?
    ... child's pid is needed. ... Currently OpenBSD does almost that checking getpid() every time ... application, we have standard API only - fork() and arc4randomfamily, ... This wouldn't work if the application made its own syscall ...
    (freebsd-current)