[LTP] [PATCH] rt_sigqueueinfo: Add negative tests for rt_sigqueueinfo

Petr Vorel pvorel@suse.cz
Thu Jan 9 10:45:23 CET 2025


Hi Ma Xinjian,

Gently ping.

Kind regards,
Petr

> > +static siginfo_t siginfo_einval;
> > +static siginfo_t siginfo_eperm;
> > +static siginfo_t siginfo_esrch;

> Ideally these should be allocated as guarded buffers:

> https://linux-test-project.readthedocs.io/en/latest/developers/api_c_tests.html#guarded-buffers

> You can have a look at signalfd02.c and the .bufs in the tst_test
> structure initialization.

...
> > +static void child_do(struct test_case_t *tc)
> > +{
> > +	struct sigaction sa;
> > +
> > +	sa.sa_handler = sig_handler;
> > +	SAFE_SIGEMPTYSET(&sa.sa_mask);
> > +	if (tc->sig > 0)
> > +		SAFE_SIGACTION(tc->sig, &sa, NULL);
> > +	else
> > +		SAFE_SIGACTION(SIGUSR1, &sa, NULL);
> > +
> > +	TST_CHECKPOINT_WAKE(0);
> > +	TST_CHECKPOINT_WAIT(1);

> The child will never get any signal so all that needs to be done here is
> to do TST_CHECKPOINT_WAIT() so that the child exists while the parent
> runs.


More information about the ltp mailing list