• A
    linux-user: Add support for translation of statx() syscall · efa92184
    Aleksandar Rikalo 提交于
    Implement support for translation of system call statx().
    
    The implementation is based on "best effort" approach: if host
    is capable of executing statx(), host statx() is used. If not,
    the implementation includes invoking a more mature system call
    fstatat() on the host side to achieve as close as possible
    functionality.
    
    Support for statx() in kernel and glibc was, however, introduced
    at different points of time (the difference is more than a year):
    
      - kernel: Linux 4.11 (30 April 2017)
      - glibc: glibc 2.28 (1 Aug 2018)
    
    In this patch, the availability of statx() support is established
    via __NR_statx (if it is defined, statx() is considered available).
    This coincedes with statx() introduction in kernel.
    
    However, the structure statx definition may not be available in
    any header for hosts with glibc older than 2.28 (and it is, by
    design, to be defined in one of glibc headers), even though the
    full statx() functionality may be supported in kernel. Hence, a
    structure "target_statx" is defined in this patch, to remove that
    dependency on glibc headers, and to use statx() functionality as
    soon as the host kernel is capable of supporting it. Such statx
    structure definition is used for both target and host structures
    statx (of course, this doesn't mean the endian arrangement is
    the same on target and host - the endian conversion is done in
    all necessary cases).
    Signed-off-by: NAleksandar Rikalo <arikalo@wavecomp.com>
    Signed-off-by: NAleksandar Markovic <amarkovic@wavecomp.com>
    Reviewed-by: NLaurent Vivier <laurent@vivier.eu>
    Message-Id: <1561718618-20218-2-git-send-email-aleksandar.markovic@rt-rk.com>
    Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
    efa92184
syscall.c 379.4 KB