]> git.proxmox.com Git - mirror_qemu.git/commit
linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS
authorFilip Bozuta <Filip.Bozuta@syrmia.com>
Fri, 19 Jun 2020 12:47:26 +0000 (14:47 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 29 Jun 2020 11:10:11 +0000 (13:10 +0200)
commita20a7c26406b14aed56815e2bb9f150facca2cc0
treee1db649afb513f4a94c5ebdfd728ef77e4d942a5
parentf4d92c5e9f24efdc83f24a2fd99c37a8609787ee
linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS

Socket ioctls SIOCGSTAMP and SIOCGSTAMPNS, used for timestamping the socket
connection, are defined in file "ioctls.h" differently from other ioctls.
The reason for this difference is explained in the comments above their definition.
These ioctls didn't have defined thunk argument types before changes from this
patch. They have special handling functions ("do_ioctl_SIOCGSTAMP" and
"do_ioctl_SIOCGSTAMPNS") that take care of setting values for approppriate argument
types (struct timeval and struct timespec) and thus no thunk argument types were
needed for their implementation. But this patch adds those argument type definitions
in file "syscall_types.h" and "ioctls.h" as it is needed for printing arguments
of these ioctls with strace.

Implementation notes:

    There are two variants of these ioctls: SIOCGSTAMP_OLD/SIOCGSTAM_NEW and
    SIOCGSTAMPNS_OLD/SIOCGSTAMPNS_NEW. One is the old existing definition and the
    other is the 2038 safe variant used for 32-bit architectures. Corresponding
    structure definitions STRUCT_timespec/STRUCT__kernel_timespec and
    STRUCT_timeval/STRUCT__kernel_sock_timeval were added for these variants.
    STRUCT_timeval definition was already inside the file as it is used by
    another implemented ioctl. Two cases were added for definitions
    STRUCT_timeval/STRUCT__kernel_sock_timeval to manage the case when the
    "u_sec" field of the timeval structure is of type int.

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200619124727.18080-2-filip.bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/ioctls.h
linux-user/syscall_types.h