[LTP] [PATCH 1/1] testcases/mq_notify01: convert to use new test library API

Cyril Hrubis chrubis@suse.cz
Thu Nov 24 10:08:13 CET 2016


Hi!
> > These fds can be opened only once in the test setup and passed in the
> > testcase structure. We do it usually as:
> 
> > static int file_fd;
> 
> > struct testcase tcases[] = {
> > ...
> > 	TYPE_NAME(file);
> > 	.fd = &file_fd;
> > ...
> > }
> 
> > static void setup(void)
> > {
> > 	file_fd = creat("file", 0644);
> > 	...
> > }
> IMHO if I reuse message queue between tests I need to delete messages before each test,
> otherwise I don't get signal for SIGEV_SIGNAL and SIGEV_THREAD. I can empty them with
> mq_receive() but is it worth of doing it?

You are right, the manual page explicitly says that the queue must be
empty. Missed that.

Creating and destroying the queue on each iteration may work better
then.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list