[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 08/16] linux-user: respect timezone for setti
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 08/16] linux-user: respect timezone for settimeofday |
Date: |
Sun, 22 Jun 2014 00:18:02 +0100 |
On 21 June 2014 23:53, Paul Burton <address@hidden> wrote:
> The settimeofday syscall accepts a tz argument indicating the desired
> timezone to the kernel. QEMU previously ignored any argument provided
> by the target program & always passed NULL to the kernel. Instead,
> translate the argument & pass along the data userland provided.
>
> Although this argument is described by the settimeofday man page as
> obsolete, it is used by systemd as of version 213.
>
> Signed-off-by: Paul Burton <address@hidden>
> ---
> Changes in v2:
> - None.
> ---
> linux-user/syscall.c | 27 ++++++++++++++++++++++++++-
> linux-user/syscall_defs.h | 5 +++++
> 2 files changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 3861f0f..ef04dc6 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -933,6 +933,22 @@ static inline abi_long copy_to_user_timeval(abi_ulong
> target_tv_addr,
> return 0;
> }
>
> +static inline abi_long copy_from_user_timezone(struct timezone *tz,
> + abi_ulong target_tz_addr)
> +{
> + struct target_timezone *target_tz;
> +
> + if (!lock_user_struct(VERIFY_READ, target_tz, target_tz_addr, 1))
> + return -TARGET_EFAULT;
Coding style mandates braces even on single-line if()s; checkpatch.pl
will catch this usually.
Code looks OK otherwise.
thanks
-- PMM
- [Qemu-devel] [PATCH v2 00/16] linux-user fixes & improvements, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 02/16] linux-user: support SO_ACCEPTCONN getsockopt option, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 03/16] linux-user: support SO_{SND, RCV}BUFFORCE setsockopt options, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 01/16] linux-user: translate the result of getsockopt SO_TYPE, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 04/16] linux-user: support SO_PASSSEC setsockopt option, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 05/16] linux-user: allow NULL arguments to mount, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 07/16] linux-user: fix struct target_epoll_event layout for MIPS, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 06/16] linux-user: support strace of epoll_create1, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 08/16] linux-user: respect timezone for settimeofday, Paul Burton, 2014/06/21
- Re: [Qemu-devel] [PATCH v2 08/16] linux-user: respect timezone for settimeofday,
Peter Maydell <=
- [Qemu-devel] [PATCH v2 09/16] linux-user: allow NULL tv argument for settimeofday, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 10/16] linux-user: support timerfd_{create, gettime, settime} syscalls, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 11/16] linux-user: support ioprio_{get, set} syscalls, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 12/16] linux-user: support {name_to, open_by}_handle_at syscalls, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 13/16] linux-user: support the setns syscall, Paul Burton, 2014/06/21
- [Qemu-devel] [PATCH v2 15/16] linux-user: support the KDSIGACCEPT ioctl, Paul Burton, 2014/06/21