summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
authorDmitry Chestnykh <dm.chestnykh@gmail.com>2024-03-01 12:19:09 +0300
committerWaldemar Brodkorb <wbx@openadk.org>2024-03-01 10:30:32 +0100
commit1be6cbd9c096618bdaf0f257e04ddd4ab0892fb9 (patch)
tree5dcc9513e2218d3543de8d8a527b85346f975936 /libc/sysdeps/linux
parent2a8b04b20f65ab05d0639ba5f95cb28659a5c020 (diff)
libc: Remove 32bit timespec structures everywhere.
With time64 enabled we use statx() system call and the appropriate routines for results conversion. There is no need in `__ts32_struct` anymore. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r--libc/sysdeps/linux/arm/bits/kernel_stat.h16
-rw-r--r--libc/sysdeps/linux/common/xstatconv.c27
-rw-r--r--libc/sysdeps/linux/or1k/bits/kernel_stat.h10
-rw-r--r--libc/sysdeps/linux/powerpc/bits/kernel_stat.h16
-rw-r--r--libc/sysdeps/linux/sparc/bits/kernel_stat.h16
-rw-r--r--libc/sysdeps/linux/xtensa/bits/kernel_stat.h16
6 files changed, 0 insertions, 101 deletions
diff --git a/libc/sysdeps/linux/arm/bits/kernel_stat.h b/libc/sysdeps/linux/arm/bits/kernel_stat.h
index 45c8e9681..cdbeeb4de 100644
--- a/libc/sysdeps/linux/arm/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/arm/bits/kernel_stat.h
@@ -5,10 +5,6 @@
* struct kernel_stat should look like... It turns out each arch has a
* different opinion on the subject... */
-#if defined(__UCLIBC_USE_TIME64__)
-#include "internal/time64_helpers.h"
-#endif
-
struct kernel_stat {
#if defined(__ARMEB__)
unsigned short st_dev;
@@ -30,15 +26,9 @@ struct kernel_stat {
unsigned long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
-#if defined(__UCLIBC_USE_TIME64__)
- struct __ts32_struct __st_atim32;
- struct __ts32_struct __st_mtim32;
- struct __ts32_struct __st_ctim32;
-#else
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
-#endif
unsigned long __uclibc_unused4;
unsigned long __uclibc_unused5;
};
@@ -60,15 +50,9 @@ struct kernel_stat64 {
long long st_size;
unsigned long st_blksize;
unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
-#if defined(__UCLIBC_USE_TIME64__)
- struct __ts32_struct __st_atim32;
- struct __ts32_struct __st_mtim32;
- struct __ts32_struct __st_ctim32;
-#else
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
-#endif
unsigned long long st_ino;
#ifndef __ARM_EABI__
} __attribute__((packed));
diff --git a/libc/sysdeps/linux/common/xstatconv.c b/libc/sysdeps/linux/common/xstatconv.c
index 391804e66..d50fbf9c3 100644
--- a/libc/sysdeps/linux/common/xstatconv.c
+++ b/libc/sysdeps/linux/common/xstatconv.c
@@ -37,21 +37,12 @@ void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
-#if defined(__UCLIBC_USE_TIME64__) && !defined(__mips__)
- buf->st_atim.tv_sec = kbuf->__st_atim32.tv_sec;
- buf->st_atim.tv_nsec = kbuf->__st_atim32.tv_nsec;
- buf->st_mtim.tv_sec = kbuf->__st_mtim32.tv_sec;
- buf->st_mtim.tv_nsec = kbuf->__st_mtim32.tv_nsec;
- buf->st_ctim.tv_sec = kbuf->__st_ctim32.tv_sec;
- buf->st_ctim.tv_nsec = kbuf->__st_ctim32.tv_nsec;
-#else
buf->st_atim.tv_sec = kbuf->st_atim.tv_sec;
buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec;
buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec;
buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec;
buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec;
buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec;
-#endif
}
void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf)
@@ -68,21 +59,12 @@ void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf)
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
-#if defined(__UCLIBC_USE_TIME64__) && !defined(__mips__)
- buf->st_atim.tv_sec = kbuf->__st_atim32.tv_sec;
- buf->st_atim.tv_nsec = kbuf->__st_atim32.tv_nsec;
- buf->st_mtim.tv_sec = kbuf->__st_mtim32.tv_sec;
- buf->st_mtim.tv_nsec = kbuf->__st_mtim32.tv_nsec;
- buf->st_ctim.tv_sec = kbuf->__st_ctim32.tv_sec;
- buf->st_ctim.tv_nsec = kbuf->__st_ctim32.tv_nsec;
-#else
buf->st_atim.tv_sec = kbuf->st_atim.tv_sec;
buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec;
buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec;
buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec;
buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec;
buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec;
-#endif
}
void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf)
@@ -102,19 +84,10 @@ void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf)
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
-#if defined(__UCLIBC_USE_TIME64__) && !defined(__mips__)
- buf->st_atim.tv_sec = kbuf->__st_atim32.tv_sec;
- buf->st_atim.tv_nsec = kbuf->__st_atim32.tv_nsec;
- buf->st_mtim.tv_sec = kbuf->__st_mtim32.tv_sec;
- buf->st_mtim.tv_nsec = kbuf->__st_mtim32.tv_nsec;
- buf->st_ctim.tv_sec = kbuf->__st_ctim32.tv_sec;
- buf->st_ctim.tv_nsec = kbuf->__st_ctim32.tv_nsec;
-#else
buf->st_atim.tv_sec = kbuf->st_atim.tv_sec;
buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec;
buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec;
buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec;
buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec;
buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec;
-#endif
}
diff --git a/libc/sysdeps/linux/or1k/bits/kernel_stat.h b/libc/sysdeps/linux/or1k/bits/kernel_stat.h
index cec44ecfc..2e5eab901 100644
--- a/libc/sysdeps/linux/or1k/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/or1k/bits/kernel_stat.h
@@ -1,10 +1,6 @@
#ifndef _BITS_STAT_STRUCT_H
#define _BITS_STAT_STRUCT_H
-#if defined(__UCLIBC_USE_TIME64__)
-#include "internal/time64_helpers.h"
-#endif
-
struct kernel_stat {
unsigned long st_dev; /* Device. */
unsigned long st_ino; /* File serial number. */
@@ -18,15 +14,9 @@ struct kernel_stat {
int st_blksize; /* Optimal block size for I/O. */
int __pad2;
long st_blocks; /* Number 512-byte blocks allocated. */
-#if defined(__UCLIBC_USE_TIME64__)
- struct __ts32_struct __st_atim32;
- struct __ts32_struct __st_mtim32;
- struct __ts32_struct __st_ctim32;
-#else
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
-#endif
unsigned int __unused4;
unsigned int __unused5;
};
diff --git a/libc/sysdeps/linux/powerpc/bits/kernel_stat.h b/libc/sysdeps/linux/powerpc/bits/kernel_stat.h
index c28ef2a9a..023eefeea 100644
--- a/libc/sysdeps/linux/powerpc/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/powerpc/bits/kernel_stat.h
@@ -5,10 +5,6 @@
* struct kernel_stat should look like... It turns out each arch has a
* different opinion on the subject... */
-#if defined(__UCLIBC_USE_TIME64__)
-#include "internal/time64_helpers.h"
-#endif
-
#if __WORDSIZE == 64
#define kernel_stat kernel_stat64
#else
@@ -23,15 +19,9 @@ struct kernel_stat {
__kernel_off_t st_size;
unsigned long st_blksize;
unsigned long st_blocks;
-#if defined(__UCLIBC_USE_TIME64__)
- struct __ts32_struct __st_atim32;
- struct __ts32_struct __st_mtim32;
- struct __ts32_struct __st_ctim32;
-#else
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
-#endif
unsigned long __unused4;
unsigned long __unused5;
};
@@ -49,15 +39,9 @@ struct kernel_stat64 {
long long st_size; /* Size of file, in bytes. */
long st_blksize; /* Optimal block size for I/O. */
long long st_blocks; /* Number 512-byte blocks allocated. */
-#if defined(__UCLIBC_USE_TIME64__)
- struct __ts32_struct __st_atim32;
- struct __ts32_struct __st_mtim32;
- struct __ts32_struct __st_ctim32;
-#else
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
-#endif
unsigned long int __uclibc_unused4;
unsigned long int __uclibc_unused5;
};
diff --git a/libc/sysdeps/linux/sparc/bits/kernel_stat.h b/libc/sysdeps/linux/sparc/bits/kernel_stat.h
index 5e214c72f..e960857fe 100644
--- a/libc/sysdeps/linux/sparc/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/sparc/bits/kernel_stat.h
@@ -5,10 +5,6 @@
* struct kernel_stat should look like... It turns out each arch has a
* different opinion on the subject... */
-#if defined(__UCLIBC_USE_TIME64__)
-#include "internal/time64_helpers.h"
-#endif
-
struct kernel_stat {
unsigned short st_dev;
unsigned long st_ino;
@@ -18,15 +14,9 @@ struct kernel_stat {
unsigned short st_gid;
unsigned short st_rdev;
long st_size;
-#if defined(__UCLIBC_USE_TIME64__)
- struct __ts32_struct __st_atim32;
- struct __ts32_struct __st_mtim32;
- struct __ts32_struct __st_ctim32;
-#else
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
-#endif
long st_blksize;
long st_blocks;
unsigned long __unused4[2];
@@ -45,15 +35,9 @@ struct kernel_stat64 {
unsigned int st_blksize;
unsigned char __pad4[8];
unsigned int st_blocks;
-#if defined(__UCLIBC_USE_TIME64__)
- struct __ts32_struct __st_atim32;
- struct __ts32_struct __st_mtim32;
- struct __ts32_struct __st_ctim32;
-#else
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
-#endif
unsigned int __unused4;
unsigned int __unused5;
};
diff --git a/libc/sysdeps/linux/xtensa/bits/kernel_stat.h b/libc/sysdeps/linux/xtensa/bits/kernel_stat.h
index 07ff39540..d884344d3 100644
--- a/libc/sysdeps/linux/xtensa/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/xtensa/bits/kernel_stat.h
@@ -5,10 +5,6 @@
* struct kernel_stat should look like... It turns out each arch has a
* different opinion on the subject... */
-#if defined(__UCLIBC_USE_TIME64__)
-#include "internal/time64_helpers.h"
-#endif
-
struct kernel_stat {
unsigned long st_dev;
unsigned long st_ino;
@@ -20,15 +16,9 @@ struct kernel_stat {
long st_size;
unsigned long st_blksize;
unsigned long st_blocks;
-#if defined(__UCLIBC_USE_TIME64__)
- struct __ts32_struct __st_atim32;
- struct __ts32_struct __st_mtim32;
- struct __ts32_struct __st_ctim32;
-#else
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
-#endif
unsigned long __unused4;
unsigned long __unused5;
};
@@ -45,15 +35,9 @@ struct kernel_stat64 {
unsigned long st_blksize; /* Optimal block size for I/O. */
unsigned long __uclibc_unused2;
unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
-#if defined(__UCLIBC_USE_TIME64__)
- struct __ts32_struct __st_atim32;
- struct __ts32_struct __st_mtim32;
- struct __ts32_struct __st_ctim32;
-#else
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. */
-#endif
unsigned long __uclibc_unused4;
unsigned long __uclibc_unused5;
};