Hi!
> + for (lc = 0; TEST_LOOPING(lc); lc++) {
> + pid = fork();
> + if (pid == 0) {
> + while (1) {
> + for (i = 0; i < FILES; i++) {
> + fd = SAFE_OPEN(cleanup, names[i],
> + O_CREAT | O_RDWR, 0600);
> + SAFE_CLOSE(cleanup, fd);
> + }
> + for (i = 0; i < FILES; i++)
> + SAFE_UNLINK(cleanup, names[i]);
> + }
> + } else if (pid == -1)
> + tst_brkm(TBROK | TERRNO, cleanup, "fork() failed");
> +
> + start = time(NULL);
> + while (time(NULL) - start < DURATION) {
Using time() for measuring how long something has been executed is not a
good idea for several reasons. Can't we settle for large enough number
of iterations instead?
> + inotify_fd = syscall(__NR_inotify_init1, O_NONBLOCK);
> + if (inotify_fd < 0) {
> + if (errno == ENOSYS) {
> + tst_brkm(TCONF, cleanup,
> + "inotify is not configured in
> this "
> + "kernel.");
> + } else {
> + tst_brkm(TBROK | TERRNO, cleanup,
> + "inotify_init failed");
> + }
> + }
The rest looks good to me.
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list