]> git.ipfire.org Git - thirdparty/glibc.git/commit
linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS}
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 8 Sep 2020 12:08:10 +0000 (09:08 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 15 Jun 2021 13:42:10 +0000 (10:42 -0300)
commit4a30a71401db8844c548ae16809284f7138df02e
tree41fcb33b198db84f35a25c61c5747e6f0b40c54e
parent13c51549e2077f2f3bf84e8fd0b46d8b0c615912
linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS}

Handle the SO_TIMESTAMP{NS} similar to recvmsg: for
!__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP
or SO_TIMESTAMPNS and appends it to the control buffer if has extra
space or returns MSG_CTRUNC otherwise.  The 32-bit time field is kept
as-is.

Also for !__ASSUME_TIME64_SYSCALLS it limits the maximum number of
'struct mmsghdr *' to IOV_MAX (and also increases the stack size
requirement to IOV_MAX times sizeof (socklen_t)).  The Linux imposes
a similar limit to sendmmsg, so bound the array size on recvmmsg is not
unreasonable.  And this will be used only on older when building with
32-bit time support.

Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
kernel).

Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
sysdeps/unix/sysv/linux/recvmmsg.c