freebsd-dev/lib/libc
Alexander V. Chernikov be1f485d7d sockets: add MSG_TRUNC flag handling for recvfrom()/recvmsg().
Implement Linux-variant of MSG_TRUNC input flag used in recv(), recvfrom() and recvmsg().
Posix defines MSG_TRUNC as an output flag, indicating packet/datagram truncation.
Linux extended it a while (~15+ years) ago to act as input flag,
resulting in returning the full packet size regarless of the input
buffer size.
It's a (relatively) popular pattern to do recvmsg( MSG_PEEK | MSG_TRUNC) to get the
packet size, allocate the buffer and issue another call to fetch the packet.
In particular, it's popular in userland netlink code, which is the primary driving factor of this change.

This commit implements the MSG_TRUNC support for SOCK_DGRAM sockets (udp, unix and all soreceive_generic() users).

PR:		kern/176322
Reviewed by:	pauamma(doc)
Differential Revision: https://reviews.freebsd.org/D35909
MFC after:	1 month
2022-07-30 18:21:51 +00:00
..
aarch64 Remove "All Rights Reserved" from FreeBSD Foundation libc copyrights 2022-07-21 09:53:31 -04:00
amd64 amd64: Stop using REP MOVSB for backward memmove()s. 2022-06-16 14:51:50 -04:00
arm libc: Remove _get_tp() and _set_tp(). 2021-12-09 13:23:26 -08:00
capability Remove "All Rights Reserved" from FreeBSD Foundation libc copyrights 2022-07-21 09:53:31 -04:00
compat-43 libc: Add HISTORY sections to the manual pages 2022-05-05 18:46:32 +02:00
db libc: Add HISTORY sections to the manual pages 2022-05-05 18:46:32 +02:00
gdtoa Remove sparc64 specific parts of libc. 2020-02-26 18:55:09 +00:00
gen Remove "All Rights Reserved" from FreeBSD Foundation libc copyrights 2022-07-21 09:53:31 -04:00
gmon
i386 libc: Remove _get_tp() and _set_tp(). 2021-12-09 13:23:26 -08:00
iconv libc: Fix "harmless" iconv one-byte overread 2021-12-21 22:47:38 +00:00
include libc: Remove _get_tp() and _set_tp(). 2021-12-09 13:23:26 -08:00
inet
isc
locale Remove "All Rights Reserved" from FreeBSD Foundation libc copyrights 2022-07-21 09:53:31 -04:00
md
nameser
net sockatmark(3): Add references to 4.4BSD IPC tutorials 2022-07-03 15:56:42 +02:00
nls Implement strerror_l(). 2020-12-16 09:02:09 +00:00
posix1e acl_delete_entry(): remove write-only variable 2021-11-29 17:39:51 +02:00
powerpc libc: Remove _get_tp() and _set_tp(). 2021-12-09 13:23:26 -08:00
powerpc64 libc: Remove _get_tp() and _set_tp(). 2021-12-09 13:23:26 -08:00
powerpcspe [PowerPC] [PowerPCSPE] Fix multiple issues in fpsetmask(). 2021-02-28 21:11:29 -06:00
quad Add casts and L suffixes to libc quad support, to work around various 2020-02-17 20:14:59 +00:00
regex libc: Fix regexec when sizeof(char *) > sizeof(long) 2021-12-23 16:38:10 +00:00
resolv resolver(3): Fix a typo in a source code comment 2022-04-09 09:14:29 +02:00
riscv libc: Remove _get_tp() and _set_tp(). 2021-12-09 13:23:26 -08:00
rpc rpc(3): Fix two typos in source code comments 2022-04-02 09:33:24 +02:00
secure libc: ssp: sprinkle around some __dead2 2021-09-30 23:55:17 -05:00
softfloat libc: use standard LF line endings, not CRLF 2021-04-03 16:20:07 -04:00
stdio libc: Add HISTORY sections to the manual pages 2022-05-05 18:46:32 +02:00
stdlib libc: ANSIfy div / ldiv function definitions 2022-07-28 10:32:48 -04:00
stdtime strftime.3: Fix a typo and use St for standards 2022-02-07 15:14:47 +01:00
string libc: Add HISTORY sections to the manual pages 2022-05-05 18:46:32 +02:00
sys sockets: add MSG_TRUNC flag handling for recvfrom()/recvmsg(). 2022-07-30 18:21:51 +00:00
tests Have stpncpy tests ask the kernel for the page size 2022-04-07 16:08:37 +01:00
uuid uuid(3): Document return values 2021-11-19 03:58:34 -05:00
x86 Remove "All Rights Reserved" from FreeBSD Foundation libc copyrights 2022-07-21 09:53:31 -04:00
xdr typo: s/impelmentation/implementation/. 2020-02-07 15:14:29 +00:00
yp
libc_nossp.ldscript
libc.ldscript
Makefile powerpc: enable initial-exec TLS 2022-02-22 19:34:28 +01:00
Makefile.depend
Makefile.depend.options
Versions.def Create namespace for the symbols added during 14-CURRENT cycle. 2021-07-15 19:40:28 +03:00