Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * This file is subject to the terms and conditions of the GNU General Public
0004  * License.  See the file "COPYING" in the main directory of this archive
0005  * for more details.
0006  *
0007  * Copyright (C) 1995, 1999, 2000 Ralf Baechle
0008  * Copyright (C) 2000 Silicon Graphics, Inc.
0009  */
0010 #ifndef _ASM_STAT_H
0011 #define _ASM_STAT_H
0012 
0013 #include <linux/types.h>
0014 
0015 #include <asm/sgidefs.h>
0016 
0017 #if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
0018 
0019 struct stat {
0020     unsigned    st_dev;
0021     long        st_pad1[3];     /* Reserved for network id */
0022     __kernel_ino_t  st_ino;
0023     __kernel_mode_t st_mode;
0024     __u32       st_nlink;
0025     __kernel_uid32_t st_uid;
0026     __kernel_gid32_t st_gid;
0027     unsigned    st_rdev;
0028     long        st_pad2[2];
0029     long        st_size;
0030     long        st_pad3;
0031     /*
0032      * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
0033      * but we don't have it under Linux.
0034      */
0035     long        st_atime;
0036     long        st_atime_nsec;
0037     long        st_mtime;
0038     long        st_mtime_nsec;
0039     long        st_ctime;
0040     long        st_ctime_nsec;
0041     long        st_blksize;
0042     long        st_blocks;
0043     long        st_pad4[14];
0044 };
0045 
0046 /*
0047  * This matches struct stat64 in glibc2.1, hence the absolutely insane
0048  * amounts of padding around dev_t's.  The memory layout is the same as of
0049  * struct stat of the 64-bit kernel.
0050  */
0051 
0052 struct stat64 {
0053     unsigned long   st_dev;
0054     unsigned long   st_pad0[3]; /* Reserved for st_dev expansion  */
0055 
0056     unsigned long long  st_ino;
0057 
0058     __kernel_mode_t st_mode;
0059     __u32       st_nlink;
0060 
0061     __kernel_uid32_t st_uid;
0062     __kernel_gid32_t st_gid;
0063 
0064     unsigned long   st_rdev;
0065     unsigned long   st_pad1[3]; /* Reserved for st_rdev expansion  */
0066 
0067     long long   st_size;
0068 
0069     /*
0070      * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
0071      * but we don't have it under Linux.
0072      */
0073     long        st_atime;
0074     unsigned long   st_atime_nsec;  /* Reserved for st_atime expansion  */
0075 
0076     long        st_mtime;
0077     unsigned long   st_mtime_nsec;  /* Reserved for st_mtime expansion  */
0078 
0079     long        st_ctime;
0080     unsigned long   st_ctime_nsec;  /* Reserved for st_ctime expansion  */
0081 
0082     unsigned long   st_blksize;
0083     unsigned long   st_pad2;
0084 
0085     long long   st_blocks;
0086 };
0087 
0088 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
0089 
0090 #if _MIPS_SIM == _MIPS_SIM_ABI64
0091 
0092 /* The memory layout is the same as of struct stat64 of the 32-bit kernel.  */
0093 struct stat {
0094     unsigned int        st_dev;
0095     unsigned int        st_pad0[3]; /* Reserved for st_dev expansion */
0096 
0097     unsigned long       st_ino;
0098 
0099     __kernel_mode_t     st_mode;
0100     __u32           st_nlink;
0101 
0102     __kernel_uid32_t    st_uid;
0103     __kernel_gid32_t    st_gid;
0104 
0105     unsigned int        st_rdev;
0106     unsigned int        st_pad1[3]; /* Reserved for st_rdev expansion */
0107 
0108     long            st_size;
0109 
0110     /*
0111      * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
0112      * but we don't have it under Linux.
0113      */
0114     unsigned int        st_atime;
0115     unsigned int        st_atime_nsec;
0116 
0117     unsigned int        st_mtime;
0118     unsigned int        st_mtime_nsec;
0119 
0120     unsigned int        st_ctime;
0121     unsigned int        st_ctime_nsec;
0122 
0123     unsigned int        st_blksize;
0124     unsigned int        st_pad2;
0125 
0126     unsigned long       st_blocks;
0127 };
0128 
0129 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
0130 
0131 #define STAT_HAVE_NSEC 1
0132 
0133 #endif /* _ASM_STAT_H */