| author | |
| committer | |
| log | bf2bd8e7220b9468c17a8d1415948e1f93a4b8f4 |
| tree | f32fdffabd5a5d6c569951afdf3b83c93e531da9 |
| parent | 6a12dce207114842e2e49a3aeb18af01ab207f0b |
instead of importing every header file under the sun, I copied a couple
inline functions into these files to make them work.2 files changed, 32 insertions(+), 2 deletions(-)
lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c+19| ... | ... | @@ -19,10 +19,29 @@ |
| 19 | 19 | #include <sys/stat.h> |
| 20 | 20 | #include <kernel_stat.h> |
| 21 | 21 | #include <sysdep.h> |
| 22 | #include <string.h> | |
| 22 | 23 | |
| 23 | 24 | #if !XSTAT_IS_XSTAT64 |
| 24 | 25 | # include <kstat_cp.h> |
| 25 | 26 | |
| 27 | static inline bool | |
| 28 | in_time_t_range (__time64_t t) | |
| 29 | { | |
| 30 | time_t s = t; | |
| 31 | return s == t; | |
| 32 | } | |
| 33 | ||
| 34 | static inline struct timespec | |
| 35 | valid_timespec64_to_timespec (const struct __timespec64 ts64) | |
| 36 | { | |
| 37 | struct timespec ts; | |
| 38 | ||
| 39 | ts.tv_sec = (time_t) ts64.tv_sec; | |
| 40 | ts.tv_nsec = ts64.tv_nsec; | |
| 41 | ||
| 42 | return ts; | |
| 43 | } | |
| 44 | ||
| 26 | 45 | int |
| 27 | 46 | __fstatat (int fd, const char *file, struct stat *buf, int flag) |
| 28 | 47 | { |
lib/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c+13-2| ... | ... | @@ -53,8 +53,8 @@ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf, |
| 53 | 53 | return r; |
| 54 | 54 | |
| 55 | 55 | *buf = (struct __stat64_t64) { |
| 56 | .st_dev = __gnu_dev_makedev (tmp.stx_dev_major, tmp.stx_dev_minor), | |
| 57 | .st_rdev = __gnu_dev_makedev (tmp.stx_rdev_major, tmp.stx_rdev_minor), | |
| 56 | .st_dev = gnu_dev_makedev (tmp.stx_dev_major, tmp.stx_dev_minor), | |
| 57 | .st_rdev = gnu_dev_makedev (tmp.stx_rdev_major, tmp.stx_rdev_minor), | |
| 58 | 58 | .st_ino = tmp.stx_ino, |
| 59 | 59 | .st_mode = tmp.stx_mode, |
| 60 | 60 | .st_nlink = tmp.stx_nlink, |
| ... | ... | @@ -74,6 +74,17 @@ fstatat64_time64_statx (int fd, const char *file, struct __stat64_t64 *buf, |
| 74 | 74 | return r; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | static inline struct __timespec64 | |
| 78 | valid_timespec_to_timespec64 (const struct timespec ts) | |
| 79 | { | |
| 80 | struct __timespec64 ts64; | |
| 81 | ||
| 82 | ts64.tv_sec = ts.tv_sec; | |
| 83 | ts64.tv_nsec = ts.tv_nsec; | |
| 84 | ||
| 85 | return ts64; | |
| 86 | } | |
| 87 | ||
| 77 | 88 | static inline int |
| 78 | 89 | fstatat64_time64_stat (int fd, const char *file, struct __stat64_t64 *buf, |
| 79 | 90 | 		 int flag) |