Linux user for 4.2 patches
The following changes since commit 2a7e7c3e103a5c29af7c583390c243d85a2527e8:
Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-tcg-121119-1' into staging (2019-11-12 14:51:00 +0000)
are available in the Git repository at:
git://github.com/vivier/qemu.git tags/linux-user-for-4.2-pull-request
for you to fetch changes up to 0f1f2d4596aee037d3ccbcf10592466daa54107f:
linux-user: remove host stime() syscall (2019-11-12 17:05:57 +0100)
----------------------------------------------------------------
Fix CID 1407221 and stime()
----------------------------------------------------------------
Laurent Vivier (2):
linux-user: fix missing break
linux-user: remove host stime() syscall
linux-user/syscall.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
2.21.0
[PULL 2/2] linux-user: remove host stime() syscall
stime() has been withdrawn from glibc
(12cbde1dae6f "Use clock_settime to implement stime; withdraw stime.")
Implement the target stime() syscall using host clock_settime(CLOCK_REALTIME, ...) as it is done internally in glibc.
Tested qemu-ppc/x86_64 with:
#include <time.h>
#include <stdio.h>
int main(void)
{
time_t t;
int ret;
/* date -u -d"2019-11-12T15:11:00" "+%s" */
t = 1573571460;
ret = stime(&t);
printf("ret %d\n", ret);
return 0;
}
# date; ./stime; date
Tue Nov 12 14:18:32 UTC 2019
ret 0
Tue Nov 12 15:11:00 UTC 2019Message-Id: <[email protected]>
--- linux-user/syscall.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
linux-user/syscall.c +5 -3
@@ -7764,10 +7764,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,#ifdef TARGET_NR_stime/* not on alpha */ case TARGET_NR_stime: { -time_t host_time; -if (get_user_sal (host_time, arg1)) +struct timespec ts; + ts.tv_nsec =0 ; +if (get_user_sal (ts.tv_sec, arg1)) {return -TARGET_EFAULT ; -return get_errno (stime (&host_time)); + } +return get_errno (clock_settime (CLOCK_REALTIME , &ts)); }#endif #ifdef TARGET_NR_alarm/* not on alpha */
Signature · 1 line
2.21.0
[PULL 1/2] linux-user: fix missing break
In reply to Laurent VivierReported by Coverity (CID 1407221)
Message-Id: <[email protected]>
--- linux-user/syscall.c | 1 + 1 file changed, 1 insertion(+)
linux-user/syscall.c +1 -0
@@ -2632,6 +2632,7 @@ static abi_long do_getsockopt(int sockfd, int level, int optname,default : goto unimplemented; } +break ;#endif /* SOL_NETLINK */ default : unimplemented:
Signature · 1 line
2.21.0
Peter Maydell
AppliedQuoted 13 lines · Laurent Vivier
The following changes since commit
2a7e7c3e103a5c29af7c583390c243d85a2527e8:Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-tcg-121119-1' into staging (2019-11-12 14:51:00 +0000)
are available in the Git repository at:
git://github.com/vivier/qemu.gittags/linux-user-for-4.2-pull-requestfor you to fetch changes up to
0f1f2d4596aee037d3ccbcf10592466daa54107f:linux-user: remove host
stime()syscall (2019-11-12 17:05:57 +0100)
Quoted 9 lines
----------------------------------------------------------------
Fix CID 1407221 andstime()----------------------------------------------------------------
Laurent Vivier (2):
linux-user: fix missing break
linux-user: remove hoststime()syscall
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.
-- PMM