]> sourceware.org Git - glibc.git/commit
y2038: linux: Provide __futimes64 implementation
authorLukasz Majewski <lukma@denx.de>
Sun, 16 Feb 2020 08:32:42 +0000 (09:32 +0100)
committerLukasz Majewski <lukma@denx.de>
Mon, 9 Mar 2020 09:26:46 +0000 (10:26 +0100)
commitf072671cf50262cea93cfdc6f8a92ffc8d698e53
tree30d9089f6c2c315c228bf0fd1717604375ba3520
parent7975f9a48a83b95174503bda6c48124f08cb4f62
y2038: linux: Provide __futimes64 implementation

This patch provides new __futimes64 explicit 64 bit function for setting file's
64 bit attributes for access and modification time (by specifying file
descriptor number).

Internally, the __utimensat64_helper function is used. This patch is necessary
for having architectures with __WORDSIZE == 32 Y2038 safe.

Moreover, a 32 bit version - __futimes has been refactored to internally use
__futimes64.

The __futimes is now supposed to be used on systems still supporting 32
bit time (__TIMESIZE != 64) - hence the necessary conversion of struct timeval
to 64 bit struct __timeval64.

The check if struct timevals' usec fields are in the range between 0 and 1000000
has been removed as Linux kernel performs it internally in the implementation
of utimensat (the conversion between struct __timeval64 and __timespec64 is not
relevant for this particular check).

Last but not least, checks for tvp{64} not being NULL have been preserved from
the original code as some legacy user space programs may rely on it.

Build tests:
./src/scripts/build-many-glibcs.py glibcs

Run-time tests:
- Run specific tests on ARM/x86 32bit systems (qemu):
  https://github.com/lmajewski/meta-y2038 and run tests:
  https://github.com/lmajewski/y2038-tests/commits/master

Above tests were performed with Y2038 redirection applied as well as without to
test the proper usage of both __futimes64 and __futimes.
include/time.h
sysdeps/unix/sysv/linux/futimes.c
This page took 0.045712 seconds and 5 git commands to generate.