/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1#ifndef __ASM_GENERIC_STAT_H2#define __ASM_GENERIC_STAT_H34/*5* Everybody gets this wrong and has to stick with it for all6* eternity. Hopefully, this version gets used by new architectures7* so they don't fall into the same traps.8*9* stat64 is copied from powerpc64, with explicit padding added.10* stat is the same structure layout on 64-bit, without the 'long long'11* types.12*13* By convention, 64 bit architectures use the stat interface, while14* 32 bit architectures use the stat64 interface. Note that we don't15* provide an __old_kernel_stat here, which new architecture should16* not have to start with.17*/1819#include <asm/bitsperlong.h>2021#define STAT_HAVE_NSEC 12223struct stat {24unsigned long st_dev; /* Device. */25unsigned long st_ino; /* File serial number. */26unsigned int st_mode; /* File mode. */27unsigned int st_nlink; /* Link count. */28unsigned int st_uid; /* User ID of the file's owner. */29unsigned int st_gid; /* Group ID of the file's group. */30unsigned long st_rdev; /* Device number, if device. */31unsigned long __pad1;32long st_size; /* Size of file, in bytes. */33int st_blksize; /* Optimal block size for I/O. */34int __pad2;35long st_blocks; /* Number 512-byte blocks allocated. */36long st_atime; /* Time of last access. */37unsigned long st_atime_nsec;38long st_mtime; /* Time of last modification. */39unsigned long st_mtime_nsec;40long st_ctime; /* Time of last status change. */41unsigned long st_ctime_nsec;42unsigned int __unused4;43unsigned int __unused5;44};4546/* This matches struct stat64 in glibc2.1. Only used for 32 bit. */47#if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64)48struct stat64 {49unsigned long long st_dev; /* Device. */50unsigned long long st_ino; /* File serial number. */51unsigned int st_mode; /* File mode. */52unsigned int st_nlink; /* Link count. */53unsigned int st_uid; /* User ID of the file's owner. */54unsigned int st_gid; /* Group ID of the file's group. */55unsigned long long st_rdev; /* Device number, if device. */56unsigned long long __pad1;57long long st_size; /* Size of file, in bytes. */58int st_blksize; /* Optimal block size for I/O. */59int __pad2;60long long st_blocks; /* Number 512-byte blocks allocated. */61int st_atime; /* Time of last access. */62unsigned int st_atime_nsec;63int st_mtime; /* Time of last modification. */64unsigned int st_mtime_nsec;65int st_ctime; /* Time of last status change. */66unsigned int st_ctime_nsec;67unsigned int __unused4;68unsigned int __unused5;69};70#endif7172#endif /* __ASM_GENERIC_STAT_H */737475