Commit 57b0939
authored
[libc] Fix alarm layout mismatch on 32-bit time64 (#201276)
Fixed alarm implementation on 32-bit architectures with 64-bit time_t
(like RISC-V 32-bit). The SYS_setitimer syscall on these platforms
expects the legacy 32-bit struct itimerval (with 32-bit tv_sec and
tv_usec). Convert the arguments to this layout before invoking the
syscall to avoid the kernel misinterpreting the timeout.
Assisted-by: Automated tooling, human reviewed.1 parent 9bb17a0 commit 57b0939
1 file changed
Lines changed: 23 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
43 | 56 | | |
44 | 57 | | |
45 | 58 | | |
| |||
0 commit comments