From: Martin Galvan <omgalvan.86@gmail.com>
To: kernelnewbies@kernelnewbies.org
Subject: Parent PID for kthreads?
Date: Wed, 11 Sep 2019 15:54:50 -0300 [thread overview]
Message-ID: <CAN19L9F43HbKvZsTfWFso6pccLQx3mfE7Pj17kx0tvKtK8i3Ww@mail.gmail.com> (raw)
Hi all,
I'm looking for a way to determine the PID of the process on which
kthread_create is invoked to spawn a new kthread. The newly created
kthreads all show current->parent->pid == 2, which I understand
corresponds to kthreadd. current->tgid doesn't seem to be set to the
main process' PID either. Is there a way to determine this from within
the kthread? Thanks!
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
reply other threads:[~2019-09-11 18:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=CAN19L9F43HbKvZsTfWFso6pccLQx3mfE7Pj17kx0tvKtK8i3Ww@mail.gmail.com \
--to=omgalvan.86@gmail.com \
--cc=kernelnewbies@kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).