Skip to content

Commit 4d76ff9

Browse files
[libc] Fix setitimer build when full_build=OFF (llvm#149665)
When we pull the headers from the system, we might get a suseconds_t that's a long long, so add a cast to prevent a implicit conversion error.
1 parent 0a463bd commit 4d76ff9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libc/src/sys/time/linux/setitimer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ LLVM_LIBC_FUNCTION(int, setitimer,
2222
// There is no SYS_setitimer_time64 call, so we can't use time_t directly,
2323
// and need to convert it to long first.
2424
long new_value32[4] = {static_cast<long>(new_value->it_interval.tv_sec),
25-
new_value->it_interval.tv_usec,
25+
static_cast<long>(new_value->it_interval.tv_usec),
2626
static_cast<long>(new_value->it_value.tv_sec),
27-
new_value->it_value.tv_usec};
27+
static_cast<long>(new_value->it_value.tv_usec)};
2828
long old_value32[4];
2929

3030
ret = LIBC_NAMESPACE::syscall_impl<long>(SYS_setitimer, which, new_value32,

0 commit comments

Comments
 (0)