recv.2, cmsg.3: Fix type of cmsg_len member of cmsghdr structure
PATCH 1/1 recv.2, cmsg.3: Fix type of cmsg_len member of cmsghdr structure
The type shown for cmsg_len member of cmsghdr structure is socklen_t, but the actual type used by glibc and the kernel is size_t.
The information was obtained from glibc source code:
http://bit.ly/21m1RMp
--- man2/recv.2 | 6 +++--- man3/cmsg.3 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
man2/recv.2 +3 -3
@@ -393,9 +393,9 @@ The messages are of the form: .nf struct cmsghdr { - socklen_t cmsg_len; /* data byte count, including hdr */ - int cmsg_level; /* originating protocol */ - int cmsg_type; /* protocol-specific type */ + size_t cmsg_len; /* data byte count, including hdr */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ /* followed by unsigned char cmsg_data[]; */ };
man3/cmsg.3 +3 -3
@@ -28,9 +28,9 @@ CMSG_ALIGN, CMSG_SPACE, CMSG_NXTHDR, CMSG_FIRSTHDR \- access ancillary data .sp .nf struct cmsghdr { - socklen_t cmsg_len; /* data byte count, including header */ - int cmsg_level; /* originating protocol */ - int cmsg_type; /* protocol-specific type */ + size_t cmsg_len; /* data byte count, including header */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ /* followed by unsigned char cmsg_data[]; */ }; .fi
Signature · 7 lines
2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hello Nikola
Quoted 5 lines · Nikola Forró
The type shown for
cmsg_lenmember of cmsghdr structure issocklen_t, but the actual type used by glibc and the kernel issize_t.The information was obtained from glibc source code:
http://bit.ly/21m1RMp
Thanks for the patch. I've applied it. However, the story is a little more complex, because according to POSIX the type is 'socklen_t'. So, I added some words in both pages point this out.
Cheers,
Michael
Quoted 41 lines
Signed-off-by Nikola Forró <[email protected]>--- man2/recv.2 | 6 +++--- man3/cmsg.3 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)man2/recv.2 +3
-3@@ -393,9 +393,9 @@ The messages are of the form: .nf struct cmsghdr { - socklen_t cmsg_len; /* data byte count, including hdr */ - int cmsg_level; /* originating protocol */ - int cmsg_type; /* protocol-specific type */ + size_t cmsg_len; /* data byte count, including hdr */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ /* followed by unsigned char cmsg_data[]; */ };man3/cmsg.3 +3
-3@@ -28,9 +28,9 @@ CMSG_ALIGN, CMSG_SPACE, CMSG_NXTHDR, CMSG_FIRSTHDR \- access ancillary data .sp .nf struct cmsghdr { - socklen_t cmsg_len; /* data byte count, including header */ - int cmsg_level; /* originating protocol */ - int cmsg_type; /* protocol-specific type */ + size_t cmsg_len; /* data byte count, including header */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ /* followed by unsigned char cmsg_data[]; */ }; .fi
Signature · 7 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html