Skip to content

Commit

Permalink
syscalls/timer_getoverrun01: use kernel_timer_t type
Browse files Browse the repository at this point in the history
Testcase is failing on s390x, with glibc-2.39 and 6.9-rc0 (git commit
a4145ce1e7bc). Userspace defines timer_t as void * (8 bytes), while
__kernel_timer_t is defined as int (4 bytes).  This means that kernel
only populates 4 bytes, and other 4 can remain uninitialized, possibly
containing some non-zero garbage, e.g.:

  timer_create(CLOCK_REALTIME, {sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL},  <unfinished ...>
  <... timer_create resumed>[0]) = 0
  timer_getoverrun(1 <unfinished ...>
  timer_getoverrun resumed>) = -1 EINVAL (Invalid argument)
  timer_delete(1)    = -1 EINVAL (Invalid argument)

Since we are dealing with syscalls directly, use kernel_timer_t.

Signed-off-by: Jan Stancek <[email protected]>
Reviewed-by: Li Wang <[email protected]>
Reviewed-by: Petr Vorel <[email protected]>
  • Loading branch information
jstancek committed Mar 25, 2024
1 parent 8ea05b5 commit d1e7424
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
#include <time.h>
#include "tst_safe_clocks.h"
#include "lapi/syscalls.h"
#include "lapi/common_timers.h"

static void run(void)
{
timer_t timer;
kernel_timer_t timer;
struct sigevent ev;

ev.sigev_value = (union sigval) 0;
Expand Down

0 comments on commit d1e7424

Please sign in to comment.