Hi,

Please find Raghu's observation on the following issue:
========================================================================================
I was looking at the failure of alarm05 i.e.,
'/rhcc/lspp/tests/LTP/ltp-merged/testcases/kernel/syscalls/alarm/alarm05'
test in LTP.

An (modified) extract from the test case is given below.

                TEST(alarm(10));
                ret_val1 = TEST_RETURN;  /* retval is 0 here (no alarm
was set previously) */

                /* Wait for signal SIGALARM */
                sleep(3);     /* waiting for alarm signal using sleep -
not allowed */

                /*
                 * Call Second alarm() with non-zero time parameter
                 * 'time_sec2' to send SIGALRM to the calling process.
                 */
                TEST(alarm(5));
                ret_val2 = TEST_RETURN;  /* ret_val2 = 7 in this case
but need not be*/

                /* Wait for signal SIGALRM */
                sleep(sleep_time2);
                pause();

The test case uses sleep() to wait for SIGALARM which is set using
alarm(). The man page of alarm() clearly says, mixing of sleep() and
alarm() is not good.

Extract from NOTES section of alarm() man page:
sleep() may be implemented using SIGALRM; mixing calls to alarm() and
sleep() is a bad idea.

The test case has to be corrected.

Thanks,
Raghuveer
========================================================================================


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to