openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glibc/2.29-r0/git/io/statx_generic.c
static __attribute__((unused)) int statx_generic(int fd, const char* path,
                                                 int flags, unsigned int mask,
                                                 struct statx* buf)
{
    /* Flags which need to be cleared before passing them to
       fstatat64.  */
    static const int clear_flags = AT_STATX_SYNC_AS_STAT;

    /* Flags supported by our emulation.  */
    static const int supported_flags =
        AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | clear_flags;

    if (__glibc_unlikely((flags & ~supported_flags) != 0))
    {
        __set_errno(EINVAL);
        return -1;
    }

    struct stat64 st;
    int ret = __fstatat64(fd, path, &st, flags & ~clear_flags);
    if (ret != 0)
        return ret;

    /* The interface is defined in such a way that unused (padding)
       fields have to be cleared.  STATX_BASIC_STATS corresponds to the
       data which is available via fstatat64.  */
    *buf = (struct statx){
        .stx_mask = STATX_BASIC_STATS,
        .stx_blksize = st.st_blksize,
        .stx_nlink = st.st_nlink,
        .stx_uid = st.st_uid,
        .stx_gid = st.st_gid,
        .stx_mode = st.st_mode,
        .stx_ino = st.st_ino,
        .stx_size = st.st_size,
        .stx_blocks = st.st_blocks,
        .stx_atime = statx_convert_timestamp(st.st_atim),
        .stx_ctime = statx_convert_timestamp(st.st_ctim),
        .stx_mtime = statx_convert_timestamp(st.st_mtim),
        .stx_rdev_major = major(st.st_rdev),
        .stx_rdev_minor = minor(st.st_rdev),
        .stx_dev_major = major(st.st_dev),
        .stx_dev_minor = minor(st.st_dev),
    };

    return 0;
}
/* Approximate emulation of statx.  This will always fill in
   POSIX-mandated attributes even if the underlying file system does
   not actually support it (for example, GID and UID on file systems
   without UNIX-style permissions).  */
Approximate emulation of statx.  This will always fill in
POSIX-mandated attributes even if the underlying file system does
not actually support it (for example, GID and UID on file systems
without UNIX-style permissions).
Approximate emulation of statx . This will always fill in POSIX - mandated attributes even if the underlying file system does not actually support it ( for example GID and UID on file systems without UNIX - style permissions ) .
static __attribute__((unused)) int statx_generic(int fd, const char* path,
                                                 int flags, unsigned int mask,
                                                 struct statx* buf)
{
    static const int clear_flags = AT_STATX_SYNC_AS_STAT;
    static const int supported_flags =
        AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | clear_flags;
    if (__glibc_unlikely((flags & ~supported_flags) != 0))
    {
        __set_errno(EINVAL);
        return -1;
    }
    struct stat64 st;
    int ret = __fstatat64(fd, path, &st, flags & ~clear_flags);
    if (ret != 0)
        return ret;
    *buf = (struct statx){
        .stx_mask = STATX_BASIC_STATS,
        .stx_blksize = st.st_blksize,
        .stx_nlink = st.st_nlink,
        .stx_uid = st.st_uid,
        .stx_gid = st.st_gid,
        .stx_mode = st.st_mode,
        .stx_ino = st.st_ino,
        .stx_size = st.st_size,
        .stx_blocks = st.st_blocks,
        .stx_atime = statx_convert_timestamp(st.st_atim),
        .stx_ctime = statx_convert_timestamp(st.st_ctim),
        .stx_mtime = statx_convert_timestamp(st.st_mtim),
        .stx_rdev_major = major(st.st_rdev),
        .stx_rdev_minor = minor(st.st_rdev),
        .stx_dev_major = major(st.st_dev),
        .stx_dev_minor = minor(st.st_dev),
    };
    return 0;
}
static __attribute__ ( ( unused ) ) int statx_generic ( int fd , const char * path , int flags , unsigned int mask , struct statx * buf ) { static const int clear_flags = AT_STATX_SYNC_AS_STAT ; static const int supported_flags = AT_EMPTY_PATH | AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | clear_flags ; if ( __glibc_unlikely ( ( flags & ~ supported_flags ) != 0 ) ) { __set_errno ( EINVAL ) ; return -1 ; } struct stat64 st ; int ret = __fstatat64 ( fd , path , & st , flags & ~ clear_flags ) ; if ( ret != 0 ) return ret ; * buf = ( struct statx ) { . stx_mask = STATX_BASIC_STATS , . stx_blksize = st . st_blksize , . stx_nlink = st . st_nlink , . stx_uid = st . st_uid , . stx_gid = st . st_gid , . stx_mode = st . st_mode , . stx_ino = st . st_ino , . stx_size = st . st_size , . stx_blocks = st . st_blocks , . stx_atime = statx_convert_timestamp ( st . st_atim ) , . stx_ctime = statx_convert_timestamp ( st . st_ctim ) , . stx_mtime = statx_convert_timestamp ( st . st_mtim ) , . stx_rdev_major = major ( st . st_rdev ) , . stx_rdev_minor = minor ( st . st_rdev ) , . stx_dev_major = major ( st . st_dev ) , . stx_dev_minor = minor ( st . st_dev ) , } ; return 0 ; }
Approximate emulation of statx.
Approximate emulation of statx .
/* Flags which need to be cleared before passing them to
       fstatat64.  */ /* Flags supported by our emulation.  */ /* The interface is defined in such a way that unused (padding)
       fields have to be cleared.  STATX_BASIC_STATS corresponds to the
       data which is available via fstatat64.  */