Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _LINUX_STAT_H
0003 #define _LINUX_STAT_H
0004 
0005 
0006 #include <asm/stat.h>
0007 #include <uapi/linux/stat.h>
0008 
0009 #define S_IRWXUGO   (S_IRWXU|S_IRWXG|S_IRWXO)
0010 #define S_IALLUGO   (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
0011 #define S_IRUGO     (S_IRUSR|S_IRGRP|S_IROTH)
0012 #define S_IWUGO     (S_IWUSR|S_IWGRP|S_IWOTH)
0013 #define S_IXUGO     (S_IXUSR|S_IXGRP|S_IXOTH)
0014 
0015 #define UTIME_NOW   ((1l << 30) - 1l)
0016 #define UTIME_OMIT  ((1l << 30) - 2l)
0017 
0018 #include <linux/types.h>
0019 #include <linux/time.h>
0020 #include <linux/uidgid.h>
0021 
0022 struct kstat {
0023     u32     result_mask;    /* What fields the user got */
0024     umode_t     mode;
0025     unsigned int    nlink;
0026     uint32_t    blksize;    /* Preferred I/O size */
0027     u64     attributes;
0028     u64     attributes_mask;
0029 #define KSTAT_ATTR_FS_IOC_FLAGS             \
0030     (STATX_ATTR_COMPRESSED |            \
0031      STATX_ATTR_IMMUTABLE |             \
0032      STATX_ATTR_APPEND |                \
0033      STATX_ATTR_NODUMP |                \
0034      STATX_ATTR_ENCRYPTED |             \
0035      STATX_ATTR_VERITY              \
0036      )/* Attrs corresponding to FS_*_FL flags */
0037 #define KSTAT_ATTR_VFS_FLAGS                \
0038     (STATX_ATTR_IMMUTABLE |             \
0039      STATX_ATTR_APPEND              \
0040      ) /* Attrs corresponding to S_* flags that are enforced by the VFS */
0041     u64     ino;
0042     dev_t       dev;
0043     dev_t       rdev;
0044     kuid_t      uid;
0045     kgid_t      gid;
0046     loff_t      size;
0047     struct timespec64 atime;
0048     struct timespec64 mtime;
0049     struct timespec64 ctime;
0050     struct timespec64 btime;            /* File creation time */
0051     u64     blocks;
0052     u64     mnt_id;
0053 };
0054 
0055 #endif