]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/unix/sysv/linux/sparc/bits/stat.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / sparc / bits / stat.h
index b1a562d11641bb408af708967a4f783254104bbd..87b1c9d1ca2154c9147cacca291e3a3c45903fcf 100644 (file)
@@ -1,25 +1,27 @@
-/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
 #endif
 
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H   1
+
 /* Versions of the `struct stat' data structure.  */
 #define _STAT_VER_LINUX_OLD    1
 #define _STAT_VER_KERNEL       1
@@ -60,23 +62,38 @@ struct stat
 #else
     __blkcnt64_t st_blocks;            /* Number 512-byte blocks allocated. */
 #endif
+#ifdef __USE_XOPEN2K8
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;           /* Time of last access.  */
+    struct timespec st_mtim;           /* Time of last modification.  */
+    struct timespec st_ctim;           /* Time of last status change.  */
+# define st_atime st_atim.tv_sec       /* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
     __time_t st_atime;                 /* Time of last access.  */
-    unsigned long int __unused1;
+    unsigned long int st_atimensec;    /* Nscecs of last access.  */
     __time_t st_mtime;                 /* Time of last modification.  */
-    unsigned long int __unused2;
+    unsigned long int st_mtimensec;    /* Nsecs of last modification.  */
     __time_t st_ctime;                 /* Time of last status change.  */
-    unsigned long int __unused3;
-    unsigned long int __unused4;
-    unsigned long int __unused5;
+    unsigned long int st_ctimensec;    /* Nsecs of last status change.  */
+#endif
+    unsigned long int __glibc_reserved4;
+    unsigned long int __glibc_reserved5;
   };
 
 #ifdef __USE_LARGEFILE64
 struct stat64
   {
     __dev_t st_dev;                    /* Device.  */
-#if __WORDSIZE == 64
+# if __WORDSIZE == 64
     unsigned short int __pad1;
-#endif
+# endif
     __ino64_t st_ino;                  /* File serial number.  */
     __mode_t st_mode;                  /* File mode.  */
     __nlink_t st_nlink;                        /* Link count.  */
@@ -88,20 +105,37 @@ struct stat64
     __blksize_t st_blksize;            /* Optimal block size for I/O.  */
 
     __blkcnt64_t st_blocks;            /* Number 512-byte blocks allocated. */
+# ifdef __USE_XOPEN2K8
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;           /* Time of last access.  */
+    struct timespec st_mtim;           /* Time of last modification.  */
+    struct timespec st_ctim;           /* Time of last status change.  */
+#  define st_atime st_atim.tv_sec      /* Backward compatibility.  */
+#  define st_mtime st_mtim.tv_sec
+#  define st_ctime st_ctim.tv_sec
+# else
     __time_t st_atime;                 /* Time of last access.  */
-    unsigned long int __unused1;
+    unsigned long int st_atimensec;    /* Nscecs of last access.  */
     __time_t st_mtime;                 /* Time of last modification.  */
-    unsigned long int __unused2;
+    unsigned long int st_mtimensec;    /* Nsecs of last modification.  */
     __time_t st_ctime;                 /* Time of last status change.  */
-    unsigned long int __unused3;
-    unsigned long int __unused4;
-    unsigned long int __unused5;
+    unsigned long int st_ctimensec;    /* Nsecs of last status change.  */
+# endif
+    unsigned long int __glibc_reserved4;
+    unsigned long int __glibc_reserved5;
   };
 #endif
 
 /* Tell code we have these members.  */
 #define        _STATBUF_ST_BLKSIZE
 #define _STATBUF_ST_RDEV
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
 
 /* Encoding of the file mode.  */
 
@@ -130,3 +164,10 @@ struct stat64
 #define        __S_IREAD       0400    /* Read by owner.  */
 #define        __S_IWRITE      0200    /* Write by owner.  */
 #define        __S_IEXEC       0100    /* Execute by owner.  */
+
+#ifdef __USE_ATFILE
+# define UTIME_NOW     ((1l << 30) - 1l)
+# define UTIME_OMIT    ((1l << 30) - 2l)
+#endif
+
+#endif /* bits/stat.h */