support: Add support_process_state_wait
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 19 Nov 2019 20:17:05 +0000 (17:17 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 27 Feb 2020 18:52:35 +0000 (15:52 -0300)
commitdfe9aa91564c1bf2a23b5589a5db42f9da5d29b5
treee0b278573ca44dd46752006e6caa978a65d655e6
parent5c8aa3849a58f2ef1d12ffb638a98578fbf99172
support: Add support_process_state_wait

It allows parent process to wait for child state using a polling
strategy over procfs on Linux.  The polling is used over ptrace to
avoid the need to handle signals on the target pid and to handle some
system specific limitation (such as YAMA).

The polling has some limitations, such as resource consumption due
the procfs read in a loop and the lack of synchronization after the
state is obtained.

The interface idea is to simplify some sleep synchronization waitid
tests and is to reduce timeouts by replacing arbitrary waits.
support/Makefile
support/process_state.h [new file with mode: 0644]
support/support_process_state.c [new file with mode: 0644]
support/tst-support-process_state.c [new file with mode: 0644]
support/xgetline.c [new file with mode: 0644]
support/xstdio.h