aboutsummaryrefslogtreecommitdiffstats
path: root/man/man7/netlink.7
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-11-17 18:47:53 +0100
committerAlejandro Colomar <alx@kernel.org>2024-11-17 21:51:23 +0100
commit18e7c4597c4e72fa5210c7887273e363c456c9ee (patch)
tree97cfd22e731a4c859ae71783d70943ff72e6cb60 /man/man7/netlink.7
parent8fc6fdd8291d906e58a175b5e1b20da680aaeb4a (diff)
downloadman-pages-18e7c4597c4e.tar.gz
man/: Terminology consistency reforms (n, size, length)
Use 'length' for the lenght of a string. Use 'n' for the number of elements. Use 'size' for the number of bytes. (And in wide-character string functions, 'size' also refers to the number of wide characters.) The change is quite large, and I might have made some mistakes. But overall, this should improve consistency in use of these terms. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man/man7/netlink.7')
-rw-r--r--man/man7/netlink.712
1 files changed, 6 insertions, 6 deletions
diff --git a/man/man7/netlink.7 b/man/man7/netlink.7
index 4198bf157c..c29ec4582b 100644
--- a/man/man7/netlink.7
+++ b/man/man7/netlink.7
@@ -170,7 +170,7 @@ the payload follows.
.in +4n
.EX
struct nlmsghdr {
- __u32 nlmsg_len; /* Length of message including header */
+ __u32 nlmsg_len; /* Size of message including header */
__u16 nlmsg_type; /* Type of message content */
__u16 nlmsg_flags; /* Additional flags */
__u32 nlmsg_seq; /* Sequence number */
@@ -203,7 +203,7 @@ struct nlmsgerr {
* unless NETLINK_CAP_ACK was set
* or the ACK indicates success (error == 0).
* For example Generic Netlink message with attributes.
- * message length is aligned with NLMSG_ALIGN()
+ * message size is aligned with NLMSG_ALIGN()
*/
/*
* followed by TLVs defined in enum nlmsgerr_attrs
@@ -566,7 +566,7 @@ And the last example is about reading netlink message.
.P
.in +4n
.EX
-int len;
+int size;
/* 8192 to avoid message truncation on platforms with
page size > 4096 */
struct nlmsghdr buf[8192/sizeof(struct nlmsghdr)];
@@ -576,10 +576,10 @@ struct msghdr msg;
struct nlmsghdr *nh;
\&
msg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 };
-len = recvmsg(fd, &msg, 0);
+size = recvmsg(fd, &msg, 0);
\&
-for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, len);
- nh = NLMSG_NEXT (nh, len)) {
+for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, size);
+ nh = NLMSG_NEXT (nh, size)) {
/* The end of multipart message */
if (nh\->nlmsg_type == NLMSG_DONE)
return;