Skip to content

Commit

Permalink
clock_settime03: do not set outside address space tp
Browse files Browse the repository at this point in the history
Whether CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID is
supported or not, they are not setable in Linux. So, we just
do not set the outside address space tp, they will always return
EINVAL.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
  • Loading branch information
gaowanlong committed Jul 9, 2013
1 parent b69a671 commit a2d1595
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions testcases/kernel/timers/clock_settime/clock_settime03.c
Expand Up @@ -49,8 +49,8 @@ int testcases[] = {
EINVAL, /* Invalid timespec */
EINVAL, /* NSEC_PER_SEC + 1 */
EPERM, /* non-root user */
0,
0,
EINVAL, /* PROCESS_CPUTIME_ID */
EINVAL, /* THREAD_CPUTIME_ID */
};

char *TCID = "clock_settime03";
Expand All @@ -70,17 +70,6 @@ int main(int ac, char **av)
if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);

/* PROCESS_CPUTIME_ID & THREAD_CPUTIME_ID are not supported on
* kernel versions lower than 2.6.12 and changed back in 2.6.38
*/
if ((tst_kvercmp(2, 6, 12)) < 0 || (tst_kvercmp(2, 6, 38)) >= 0) {
testcases[7] = EINVAL;
testcases[8] = EINVAL;
} else {
testcases[7] = EFAULT;
testcases[8] = EFAULT;
}

setup();

for (lc = 0; TEST_LOOPING(lc); lc++) {
Expand Down Expand Up @@ -168,11 +157,6 @@ static int setup_test(int option)
return -1;
}
break;
case 7:
case 8:
/* Make tp argument bad pointer */
if (tst_kvercmp(2, 6, 12) >= 0)
temp = (struct timespec *)-1;
}
return 0;
}
Expand Down

0 comments on commit a2d1595

Please sign in to comment.