public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] gettid:Convert gettid01 to new API
Date: Wed, 1 Sep 2021 14:57:21 +0200	[thread overview]
Message-ID: <YS94sad/CSdCWaoA@yuki> (raw)
In-Reply-To: <20210831024617.246758-1-threefifteen.wangkunfeng@huawei.com>

Hi!
Looks good, apart from the license.

Also we should try to validate the tid. I guess that we can do that by
sending a signal and making sure that it has arrived. That could be done
by something as tgkill(getpid(), TST_RET, SIGUSR1); after setting up an
handler for SIGUSR1 that sets a flag if called and then checking if the
flag has been set after we have send the signal.

Also I guess that in the simple case that the process runs a single
thread the pid is the same as tid. We would have to clone a new process
with CLONE_THREAD and run the test from the cloned thread in order to
have the tid different from the pid in order to test the getpid() !=
gettid() case.

-- 
Cyril Hrubis
chrubis@suse.cz

      parent reply	other threads:[~2021-09-01 12:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  2:46 [LTP] [PATCH] gettid:Convert gettid01 to new API Wang Kunfeng
2021-08-31  4:15 ` Xie Ziyao
2021-08-31  4:19   ` Xie Ziyao
2021-09-01 12:57 ` Cyril Hrubis [this message]

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=YS94sad/CSdCWaoA@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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