[LTP] [PATCH] gettid:Convert gettid01 to new API

Cyril Hrubis chrubis@suse.cz
Wed Sep 1 14:57:21 CEST 2021


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


More information about the ltp mailing list