busybox/coreutils
Denys Vlasenko 79c92dbd70 touch: switch to using utimensat() and futimens()
This patch changes the functions used to update timestamps in touch.

Before, utimes() and lutimes() were used, which had certain
disadvantages.
They are unable to handle nanosecond timestamps, and implementations of
certain features like -a and -m require running stat() in a loop.

Almost all implementations of utimes() and lutimes() are wrappers for
utimensat(), this is the case for glibc, ulibc and musl libc.

function                                             old     new   delta
__futimens_time64                                      -      24     +24
__lutimes_time64                                      80       -     -80
touch_main                                           539     456     -83
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 0/1 up/down: 24/-163)          Total: -139 bytes

Signed-off-by: urmum-69 <urmum69@snopyta.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-13 11:31:46 +02:00
..
libcoreutils
basename.c config: update size information 2018-12-28 03:20:17 +01:00
cat.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
chgrp.c chgrp: correct the usage for non-desktop chgrp calls 2019-11-17 17:06:31 +01:00
chmod.c libbb: shrink recursive_action() by reducing memory pressure 2020-10-01 21:52:16 +02:00
chown.c libbb: shrink recursive_action() by reducing memory pressure 2020-10-01 21:52:16 +02:00
chroot.c
cksum.c config: update size information 2018-12-28 03:20:17 +01:00
comm.c config: update size information 2018-12-28 03:20:17 +01:00
Config.src
cp.c help text: replace [OPTIONS] with actual options (if not too long) 2020-12-13 22:34:05 +01:00
cut.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
date.c libbb: in @SECONDS date format, use 64-bit time if libc allows 2020-11-28 23:21:13 +01:00
dd.c dd: support for O_DIRECT i/o 2020-12-14 20:27:57 +01:00
df.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
dirname.c config: update size information 2018-12-28 03:20:17 +01:00
dos2unix.c config: update size information 2018-12-28 03:20:17 +01:00
du.c du: don't count duplicate arguments. Closes 5288 2019-02-19 17:08:39 +01:00
echo.c echo: do not assume that free() leaves errno unmodified 2021-02-23 12:59:29 +01:00
env.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
expand.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
expr.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
factor.c factor: fix comment 2020-12-23 02:03:04 +01:00
false.c
fold.c
head.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
hostid.c config: update size information 2018-12-28 03:20:17 +01:00
id_test.sh
id.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
install.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
Kbuild.src
link.c config: update size information 2018-12-28 03:20:17 +01:00
ln.c help text: replace [OPTIONS] with actual options (if not too long) 2020-12-13 22:34:05 +01:00
logname.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
ls.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
md5_sha1_sum.c sha3sum: fix --help: -a does not depend on FEATURE_MD5_SHA1_SUM_CHECK 2020-11-27 15:55:46 +01:00
mkdir.c help text tweaks 2020-12-13 19:04:19 +01:00
mkfifo.c config: update size information 2018-12-28 03:20:17 +01:00
mknod.c Fix mknod compilation on the FreeBSD 2021-01-04 13:28:28 +01:00
mktemp.c config: update size information 2018-12-28 03:20:17 +01:00
mv.c config: update size information 2018-12-28 03:20:17 +01:00
nice.c config: update size information 2018-12-28 03:20:17 +01:00
nl.c nl: ensure '-b n' option displays file content 2021-02-02 17:37:41 +01:00
nohup.c
nproc.c config: update size information 2018-12-28 03:20:17 +01:00
od_bloaty.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
od.c
paste.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
printenv.c config: update size information 2018-12-28 03:20:17 +01:00
printf.c timeout,top,watch,ping: parse NN.N fractional duration in locales with other separators 2021-03-23 13:50:02 +01:00
pwd.c config: update size information 2018-12-28 03:20:17 +01:00
readlink.c config: update size information 2018-12-28 03:20:17 +01:00
realpath.c config: update size information 2018-12-28 03:20:17 +01:00
rm.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
rmdir.c help text tweaks 2020-12-13 19:04:19 +01:00
seq.c config: update size information 2018-12-28 03:20:17 +01:00
shred.c config: update size information 2018-12-28 03:20:17 +01:00
shuf.c
sleep.c timeout,top,watch,ping: parse NN.N fractional duration in locales with other separators 2021-03-23 13:50:02 +01:00
sort.c timeout,top,watch,ping: parse NN.N fractional duration in locales with other separators 2021-03-23 13:50:02 +01:00
split.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
stat.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
stty.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
sum.c config: update size information 2018-12-28 03:20:17 +01:00
sync.c fsync,sync: merge into one source module 2019-04-02 14:55:29 +02:00
tac.c config: update size information 2018-12-28 03:20:17 +01:00
tail.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
tee.c tee: do not intercept SIGPIPE 2019-10-07 14:25:45 +02:00
test_ptr_hack.c
test.c decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly 2020-11-30 13:03:03 +01:00
timeout.c help text tweaks 2020-12-18 04:12:51 +01:00
touch.c touch: switch to using utimensat() and futimens() 2021-04-13 11:31:46 +02:00
tr.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
true.c
truncate.c config: update size information 2018-12-28 03:20:17 +01:00
tty.c config: update size information 2018-12-28 03:20:17 +01:00
uname.c config: update size information 2018-12-28 03:20:17 +01:00
uniq.c help text tweaks 2020-12-18 04:12:51 +01:00
unlink.c config: update size information 2018-12-28 03:20:17 +01:00
usleep.c config: update size information 2018-12-28 03:20:17 +01:00
uudecode.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
uuencode.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
wc.c config: update size information 2018-12-28 03:20:17 +01:00
who.c config: update size information 2018-12-28 03:20:17 +01:00
whoami.c config: update size information 2018-12-28 03:20:17 +01:00
yes.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00