Skip to content

Commit

Permalink
syscalls/setrlimit02: Remove the EFAULT test
Browse files Browse the repository at this point in the history
Glibc has to convert between 32bit and 64bit struct rlimit in some cases (looks
like that happens when prlimit64 is not implemented in the kernel) which causes
this test to SegFault.

See sysdeps/unix/sysv/linux/setrlimit*.c for reference:

...

  if (rlimits->rlim_cur >= RLIM_INFINITY)
    rlimits32.rlim_cur = RLIM_INFINITY;
  else
    rlimits32.rlim_cur = rlimits->rlim_cur;
  if (rlimits->rlim_max >= RLIM_INFINITY)
    rlimits32.rlim_max = RLIM_INFINITY;
  else
    rlimits32.rlim_max = rlimits->rlim_max;

  return __setrlimit (resource, &rlimits32);

...

Hence we remove the EFAULT case from the test in order not to produce false
possitives.

Closes #193

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
  • Loading branch information
metan-ucw committed Aug 17, 2017
1 parent 6d5b574 commit 259db6f
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions testcases/kernel/syscalls/setrlimit/setrlimit02.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ static struct tcase {
struct rlimit *rlim;
int exp_errno;
} tcases[] = {
#if !defined(UCLINUX)
{RLIMIT_NOFILE, (void *)-1, EFAULT},
#endif
{-1, &rlim, EINVAL},
{RLIMIT_NOFILE, &rlim, EPERM}
};
Expand Down

0 comments on commit 259db6f

Please sign in to comment.