#include <sys/stat.h>#include <time.h>Go to the source code of this file.
Defines | |
| #define | STAT_TIME_H 1 |
Functions | |
| static long int | get_stat_atime_ns (struct stat const *st) |
| static long int | get_stat_ctime_ns (struct stat const *st) |
| static long int | get_stat_mtime_ns (struct stat const *st) |
| static long int | get_stat_birthtime_ns (struct stat const *st) |
| static struct timespec | get_stat_atime (struct stat const *st) |
| static struct timespec | get_stat_ctime (struct stat const *st) |
| static struct timespec | get_stat_mtime (struct stat const *st) |
| static struct timespec | get_stat_birthtime (struct stat const *st) |
|
|
Definition at line 22 of file stat-time.h. |
|
|
Definition at line 103 of file stat-time.h. References get_stat_atime_ns(), timespec::tv_nsec, and timespec::tv_sec. Referenced by copy_stat(). 00104 { 00105 #ifdef STAT_TIMESPEC 00106 return STAT_TIMESPEC (st, st_atim); 00107 #else 00108 struct timespec t; 00109 t.tv_sec = st->st_atime; 00110 t.tv_nsec = get_stat_atime_ns (st); 00111 return t; 00112 #endif 00113 }
|
|
|
Definition at line 51 of file stat-time.h. Referenced by get_stat_atime(). 00052 { 00053 # if defined STAT_TIMESPEC 00054 return STAT_TIMESPEC (st, st_atim).tv_nsec; 00055 # elif defined STAT_TIMESPEC_NS 00056 return STAT_TIMESPEC_NS (st, st_atim); 00057 # else 00058 return 0; 00059 # endif 00060 }
|
|
|
Definition at line 146 of file stat-time.h. 00147 { 00148 struct timespec t; 00149 00150 #if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ 00151 || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC) 00152 t = STAT_TIMESPEC (st, st_birthtim); 00153 #elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 00154 t.tv_sec = st->st_birthtime; 00155 t.tv_nsec = st->st_birthtimensec; 00156 #elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 00157 /* Woe32 native platforms (but not Cygwin) put the "file creation 00158 time" in st_ctime (!). See 00159 <http://msdn2.microsoft.com/de-de/library/14h5k7ff(VS.80).aspx>. */ 00160 t.tv_sec = st->st_ctime; 00161 t.tv_nsec = 0; 00162 #else 00163 /* Birth time is not supported. Set tv_sec to avoid undefined behavior. */ 00164 t.tv_sec = -1; 00165 t.tv_nsec = -1; 00166 #endif 00167 00168 #if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ 00169 || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC \ 00170 || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC) 00171 /* FreeBSD and NetBSD sometimes signal the absence of knowledge by 00172 using zero. Attempt to work around this problem. Alas, this can 00173 report failure even for valid time stamps. Also, NetBSD 00174 sometimes returns junk in the birth time fields; work around this 00175 bug if it it is detected. There's no need to detect negative 00176 tv_nsec junk as negative tv_nsec already indicates an error. */ 00177 if (t.tv_sec == 0 || 1000000000 <= t.tv_nsec) 00178 t.tv_nsec = -1; 00179 #endif 00180 00181 return t; 00182 }
|
|
|
Definition at line 90 of file stat-time.h. 00091 { 00092 # if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 00093 return STAT_TIMESPEC (st, st_birthtim).tv_nsec; 00094 # elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 00095 return STAT_TIMESPEC_NS (st, st_birthtim); 00096 # else 00097 return 0; 00098 # endif 00099 }
|
|
|
Definition at line 117 of file stat-time.h. References get_stat_ctime_ns(), timespec::tv_nsec, and timespec::tv_sec. 00118 { 00119 #ifdef STAT_TIMESPEC 00120 return STAT_TIMESPEC (st, st_ctim); 00121 #else 00122 struct timespec t; 00123 t.tv_sec = st->st_ctime; 00124 t.tv_nsec = get_stat_ctime_ns (st); 00125 return t; 00126 #endif 00127 }
|
|
|
Definition at line 64 of file stat-time.h. Referenced by get_stat_ctime(). 00065 { 00066 # if defined STAT_TIMESPEC 00067 return STAT_TIMESPEC (st, st_ctim).tv_nsec; 00068 # elif defined STAT_TIMESPEC_NS 00069 return STAT_TIMESPEC_NS (st, st_ctim); 00070 # else 00071 return 0; 00072 # endif 00073 }
|
|
|
Definition at line 131 of file stat-time.h. References get_stat_mtime_ns(), timespec::tv_nsec, and timespec::tv_sec. Referenced by copy_stat(), treat_file(), and treat_stdin(). 00132 { 00133 #ifdef STAT_TIMESPEC 00134 return STAT_TIMESPEC (st, st_mtim); 00135 #else 00136 struct timespec t; 00137 t.tv_sec = st->st_mtime; 00138 t.tv_nsec = get_stat_mtime_ns (st); 00139 return t; 00140 #endif 00141 }
|
|
|
Definition at line 77 of file stat-time.h. Referenced by get_stat_mtime(). 00078 { 00079 # if defined STAT_TIMESPEC 00080 return STAT_TIMESPEC (st, st_mtim).tv_nsec; 00081 # elif defined STAT_TIMESPEC_NS 00082 return STAT_TIMESPEC_NS (st, st_mtim); 00083 # else 00084 return 0; 00085 # endif 00086 }
|