From: xieziyao <xieziyao@huawei.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] syscalls/tkill: Convert tkill01 to the new API
Date: Tue, 27 Apr 2021 01:49:08 +0000 [thread overview]
Message-ID: <a4618c19e3934127ad6ea9fd6afd233c@huawei.com> (raw)
In-Reply-To: <YIa4PuDonH1Jwnlc@pevik>
Hi, Petr, Cyril,
I think adding usleep(1000) in while loop is a good idea, thanks.
Best Regards,
Ziyao
-----Original Message-----
From: Petr Vorel [mailto:pvorel@suse.cz]
Sent: Monday, April 26, 2021 8:55 PM
To: xieziyao <xieziyao@huawei.com>
Cc: ltp@lists.linux.it; Cyril Hrubis <chrubis@suse.cz>
Subject: Re: [LTP] [PATCH 1/2] syscalls/tkill: Convert tkill01 to the new API
> Hi,
> Thanks for your review, Petr.
> > + TEST(tst_syscall(__NR_tkill, tid, SIGUSR1));
> > + if (TST_RET == 0) {
> > + while (!sig_flag);
> This while loop is written to check whether the sighandler function captures the SIGUSR1 signal and set sig_flag to 1.
Oh, correct. But not sure if it's good to use plain while.
Maybe using usleep(1000) in while loop?
TST_EXP_PASS(tst_syscall(__NR_tkill, tid, SIGUSR1));
while (!sig_flag)
usleep(1000);
Kind regards,
Petr
> > + tst_res(TPASS, "tst_syscall(__NR_tkill, %d, SIGUSR1)", tid);
> > + } else {
> > + tst_res(TFAIL | TTERRNO,
> > + "tst_syscall(__NR_tkill, %d, SIGUSR1)", tid);
> > }
> > - cleanup();
> > - tst_exit();
> > }
next prev parent reply other threads:[~2021-04-27 1:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-22 6:57 [LTP] [PATCH 0/2] syscalls/tkill: Convert tkill{01, 02} to the new API Xie Ziyao
2021-04-22 6:57 ` [LTP] [PATCH 1/2] syscalls/tkill: Convert tkill01 " Xie Ziyao
2021-04-26 10:31 ` Petr Vorel
2021-04-26 11:24 ` xieziyao
2021-04-26 12:55 ` Petr Vorel
2021-04-27 1:49 ` xieziyao [this message]
2021-04-28 12:11 ` Cyril Hrubis
2021-04-28 18:04 ` Petr Vorel
2021-04-29 2:02 ` xieziyao
2021-04-22 6:57 ` [LTP] [PATCH 2/2] syscalls/tkill: Convert tkill02 " Xie Ziyao
2021-04-26 11:12 ` Petr Vorel
2021-04-26 11:35 ` xieziyao
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=a4618c19e3934127ad6ea9fd6afd233c@huawei.com \
--to=xieziyao@huawei.com \
--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