mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: KV Pavuram <kvpavuram@yahoo.co.in>
To: Andrew Burgess <aab@cichlid.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Pthreadid, pid
Date: Fri, 1 Jul 2005 06:02:11 +0100 (BST)	[thread overview]
Message-ID: <20050701050211.13974.qmail@web8409.mail.in.yahoo.com> (raw)
In-Reply-To: <200506302001.j5UK1L7w008821@cichlid.com>


Thank you Andrew. It worked.

Pav. 


--- Andrew Burgess <aab@cichlid.com> wrote:

> >When i run a multi-threaded program from gdb, gdb
> >shows "New Thread XXXXXXXX (LWP LLLL)" for each new
> >thread created by the application.
> 
> >However, when I run ps -aelfm, the output shows
> each
> >thread of this application but with a different
> PID.
> 
> >And, getpid () in each thread inside the
> application
> >always retreives the same PID.
> 
> >What is the relation between LWP is given by GDB,
> PID
> >shown by ps call and the PID returned by getpid ().
> 
> >Is there any system call to obtain one from the
> >other??
> 
> see gettid(2)
> 
> you need to include the macro call
> _syscall0(pid_t,gettid)
> in your program as gettid isn't in glibc
> 
> 



		
_______________________________________________________
Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com

       reply	other threads:[~2005-07-01  5:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200506302001.j5UK1L7w008821@cichlid.com>
2005-07-01  5:02 ` KV Pavuram [this message]
2005-06-30 13:14 KV Pavuram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050701050211.13974.qmail@web8409.mail.in.yahoo.com \
    --to=kvpavuram@yahoo.co.in \
    --cc=aab@cichlid.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®