Prefix cmsg_nxthdr with "__".

This brings us on par with glibc.

To avoid breaking clients, temporary keep cmsg_nxthdr until the next NDK
refresh.

Bug: 15822452
Change-Id: I24c24e68c31f4f2b8f3d2df7acd575cb75174173
This commit is contained in:
Calin Juravle 2014-06-19 18:16:17 +01:00
parent 54e9dc0213
commit 096b4eb752
2 changed files with 6 additions and 3 deletions

View File

@ -28,7 +28,7 @@
#include <sys/socket.h>
cmsghdr* cmsg_nxthdr(msghdr* msg, cmsghdr* cmsg) {
cmsghdr* __cmsg_nxthdr(msghdr* msg, cmsghdr* cmsg) {
cmsghdr* ptr;
ptr = reinterpret_cast<cmsghdr*>(reinterpret_cast<char*>(cmsg) + CMSG_ALIGN(cmsg->cmsg_len));
size_t len = reinterpret_cast<char*>(ptr+1) - reinterpret_cast<char*>(msg->msg_control);
@ -37,3 +37,6 @@ cmsghdr* cmsg_nxthdr(msghdr* msg, cmsghdr* cmsg) {
}
return ptr;
}
// TODO: remove after NDK refresh.
__weak_alias(cmsg_nxthdr, __cmsg_nxthdr);

View File

@ -107,7 +107,7 @@ struct cmsghdr {
int cmsg_type;
};
#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr((mhdr), (cmsg))
#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
#define CMSG_DATA(cmsg) ((void*)((char*)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
@ -117,7 +117,7 @@ struct cmsghdr {
? (struct cmsghdr*) (msg)->msg_control : (struct cmsghdr*) NULL)
#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && (cmsg)->cmsg_len <= (unsigned long) ((mhdr)->msg_controllen - ((char*)(cmsg) - (char*)(mhdr)->msg_control)))
struct cmsghdr* cmsg_nxthdr(struct msghdr*, struct cmsghdr*);
struct cmsghdr* __cmsg_nxthdr(struct msghdr*, struct cmsghdr*);
#define SCM_RIGHTS 0x01
#define SCM_CREDENTIALS 0x02