Hi,
On 02/04/2014 01:08 AM, [email protected] wrote:
>
> +}
> +
> +static void wait_io_ready(void)
> +{
> + pid_t child;
> + int i;
> +
> + fflush(stdout);
> You should use tst_flush() or tst_fork() instead.
>
> Note: I've just added the tst_fork() and updated the test writing
> guidelines.
>
>> + child = FORK_OR_VFORK();
> The rest of the testcase would not run on uClinux so there is no reason
> to use FORK_OR_VFORK() instead of fork().
You said that the rest of the testcase would not run on uClinux, so
we should use fork or tst_fork() directly.
Now I couldn't figure it out why the rest of the testcase would not run on
uClinux,
Makefile in syscalls does not filter out the fcntl directory. Could you give me
some
hint about this :-)
Thanks,
Xiaoguang Wang
>
>> + if (child < 0)
>> + tst_brkm(TBROK | TERRNO, cleanup, "fork failed");
>> +
>> + if (child == 0) {
>> + signal_parent();
>> + exit(0);
>> + } else {
>> + /*
>> + * if io_signal_received is not changed by signal handler
>> + * in 5 seconds, consider the test failed.
>> + */
>> + for (i = 0; i < 1000; i++) {
>> + /* SIGUSR1 or SIGIO is received*/
>> + if (io_signal_received > 0)
>> + break;
>> + sched_yield();
>> + usleep(5000);
>> + }
> You can use sigtimedwait() instead :)
>
>> + switch (io_signal_received) {
>> + case SIGUSR1:
>> + tst_resm(TPASS, "fcntl test %s success",
>> + test_cases[ind].des);
>> + break;
>> + case SIGIO:
>> + tst_resm(TFAIL, "received default SIGIO, fcntl test "
>> + "%s failed", test_cases[ind].des);
>> + break;
>> + default:
>> + tst_brkm(TBROK, cleanup, "fcntl io events "
>> + "signal mechanism work abnormally");
>> + }
>> + io_signal_received = 0;
>> + wait(NULL);
>> + }
>> +}
>> +
>> +static void cleanup(void)
>> +{
>> + TEST_CLEANUP;
>> +
>> + if (pipe_fds[0] > 0)
>> + SAFE_CLOSE(NULL, pipe_fds[0]);
>> + if (pipe_fds[1] > 0)
>> + SAFE_CLOSE(NULL, pipe_fds[1]);
>> +
>> + tst_rmdir();
>> +}
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list