Opened 14 years ago
Last modified 6 years ago
#228 accepted defect
CMSG_LEN and CMSG_SPACE missing
Reported by: | Silvan Scherrer | Owned by: | Yuri Dario |
---|---|---|---|
Priority: | normal | Milestone: | libc-0.7 |
Component: | libc | Version: | |
Severity: | normal | Keywords: | |
Cc: |
Description
in sys/socket.h the below defie are missing:
#ifndef CMSG_LEN /* CMSG_LEN and CMSG_SPACE are defined by RFC 2292, but missing on * some older platforms. */ #define CMSG_LEN(len) ((size_t)CMSG_DATA((struct cmsghdr *)NULL) + (len)) /* CMSG_SPACE must add at least as much padding as CMSG_NXTHDR() * adds. We overestimate here. */ #define ALIGN_TO_SIZEOF(len, obj) (((len) + sizeof (obj) - 1) & ~(sizeof (obj) - 1)) #define CMSG_SPACE(len) ALIGN_TO_SIZEOF (CMSG_LEN (len), struct cmsghdr) #endif
Change History (6)
comment:1 by , 14 years ago
Component: | baselayout → libc |
---|---|
Milestone: | → libc-0.7 |
comment:2 by , 14 years ago
comment:3 by , 11 years ago
Milestone: | libc-0.7 → libc-0.6.6 |
---|
comment:4 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → accepted |
comment:5 by , 11 years ago
Milestone: | libc-0.6.6 → libc-0.7 |
---|
This will have to wait for libc-0.7 as already stated. It will be part of an effort to resync socket.h and other with BSD.
comment:6 by , 6 years ago
BTW, this is the version of these macros I did for chromium (here):
#ifndef CMSG_SPACE #define CMSG_SPACE(l) (_ALIGN(sizeof(struct cmsghdr)) + _ALIGN(l)) #endif #ifndef CMSG_LEN #define CMSG_LEN(l) (_ALIGN(sizeof(struct cmsghdr)) + (l)) #endif
Looks a bit simpler than the one in the description and uses _ALIGN which is already used by other CMSG defines.
Note:
See TracTickets
for help on using tickets.
Unless these are present in the OS/2 toolkit, they will have to wait for the next libc version.