1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-06 13:09:50 +00:00

Use memcpy() to copy 64-bit timestamps into the syscall return values.

On 32-bit platforms, our 64-bit timestamps need to be split up across
two registers. A simple assignment to td_retval[0] will cause the top 32
bits to get lost. By using memcpy(), we will automatically either use 1
or 2 registers depending on the size of register_t.
This commit is contained in:
Ed Schouten 2016-08-21 07:41:11 +00:00
parent 7ce0716103
commit 384ef4841a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=304555

View File

@ -117,7 +117,7 @@ cloudabi_sys_clock_res_get(struct thread *td,
error = cloudabi_convert_timespec(&ts, &cts);
if (error != 0)
return (error);
td->td_retval[0] = cts;
memcpy(td->td_retval, &cts, sizeof(cts));
return (0);
}
@ -129,6 +129,6 @@ cloudabi_sys_clock_time_get(struct thread *td,
int error;
error = cloudabi_clock_time_get(td, uap->clock_id, &ts);
td->td_retval[0] = ts;
memcpy(td->td_retval, &ts, sizeof(ts));
return (error);
}