netlink.7: Add a comment on 8192 buffer size in example code

Reported-by: Rick Jones <rick.jones2@hpe.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-08-16 02:39:07 +02:00
parent 147441f7d3
commit 224a0025ee
1 changed files with 2 additions and 1 deletions

View File

@ -533,7 +533,8 @@ And the last example is about reading netlink message.
.in +4n
.nf
int len;
char buf[8192];
char buf[8192]; /* 8192 to avoid message truncation on
platforms with page size > 4096 */
struct iovec iov = { buf, sizeof(buf) };
struct sockaddr_nl sa;
struct msghdr msg;