Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef __ASM_GENERIC_STAT_H
0003 #define __ASM_GENERIC_STAT_H
0004 
0005 /*
0006  * Everybody gets this wrong and has to stick with it for all
0007  * eternity. Hopefully, this version gets used by new architectures
0008  * so they don't fall into the same traps.
0009  *
0010  * stat64 is copied from powerpc64, with explicit padding added.
0011  * stat is the same structure layout on 64-bit, without the 'long long'
0012  * types.
0013  *
0014  * By convention, 64 bit architectures use the stat interface, while
0015  * 32 bit architectures use the stat64 interface. Note that we don't
0016  * provide an __old_kernel_stat here, which new architecture should
0017  * not have to start with.
0018  */
0019 
0020 #include <asm/bitsperlong.h>
0021 
0022 #define STAT_HAVE_NSEC 1
0023 
0024 struct stat {
0025     unsigned long   st_dev;     /* Device.  */
0026     unsigned long   st_ino;     /* File serial number.  */
0027     unsigned int    st_mode;    /* File mode.  */
0028     unsigned int    st_nlink;   /* Link count.  */
0029     unsigned int    st_uid;     /* User ID of the file's owner.  */
0030     unsigned int    st_gid;     /* Group ID of the file's group. */
0031     unsigned long   st_rdev;    /* Device number, if device.  */
0032     unsigned long   __pad1;
0033     long        st_size;    /* Size of file, in bytes.  */
0034     int     st_blksize; /* Optimal block size for I/O.  */
0035     int     __pad2;
0036     long        st_blocks;  /* Number 512-byte blocks allocated. */
0037     long        st_atime;   /* Time of last access.  */
0038     unsigned long   st_atime_nsec;
0039     long        st_mtime;   /* Time of last modification.  */
0040     unsigned long   st_mtime_nsec;
0041     long        st_ctime;   /* Time of last status change.  */
0042     unsigned long   st_ctime_nsec;
0043     unsigned int    __unused4;
0044     unsigned int    __unused5;
0045 };
0046 
0047 /* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
0048 #if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64)
0049 struct stat64 {
0050     unsigned long long st_dev;  /* Device.  */
0051     unsigned long long st_ino;  /* File serial number.  */
0052     unsigned int    st_mode;    /* File mode.  */
0053     unsigned int    st_nlink;   /* Link count.  */
0054     unsigned int    st_uid;     /* User ID of the file's owner.  */
0055     unsigned int    st_gid;     /* Group ID of the file's group. */
0056     unsigned long long st_rdev; /* Device number, if device.  */
0057     unsigned long long __pad1;
0058     long long   st_size;    /* Size of file, in bytes.  */
0059     int     st_blksize; /* Optimal block size for I/O.  */
0060     int     __pad2;
0061     long long   st_blocks;  /* Number 512-byte blocks allocated. */
0062     int     st_atime;   /* Time of last access.  */
0063     unsigned int    st_atime_nsec;
0064     int     st_mtime;   /* Time of last modification.  */
0065     unsigned int    st_mtime_nsec;
0066     int     st_ctime;   /* Time of last status change.  */
0067     unsigned int    st_ctime_nsec;
0068     unsigned int    __unused4;
0069     unsigned int    __unused5;
0070 };
0071 #endif
0072 
0073 #endif /* __ASM_GENERIC_STAT_H */