am cba91b3d: am ecbf00bd: Merge "Clean up CMSG_*HDR in <sys/socket.h>"

* commit 'cba91b3dbd2de2299979c0015896fb6942162bd7':
  Clean up CMSG_*HDR in <sys/socket.h>
This commit is contained in:
Calin Juravle 2014-03-26 16:36:26 +00:00 committed by Android Git Automerger
commit d91b4a0ffc

View File

@ -107,14 +107,14 @@ struct cmsghdr {
int cmsg_type;
};
#define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg))
#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr((mhdr)->msg_control, (mhdr)->msg_controllen, (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))
#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
#define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? (struct cmsghdr*)(ctl) : (struct cmsghdr*)NULL)
#define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
#define CMSG_FIRSTHDR(msg) \
((msg)->msg_controllen >= sizeof(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)))
#ifdef __GNUC__
@ -134,10 +134,6 @@ __KINLINE struct cmsghdr* __cmsg_nxthdr(void* __ctl, size_t __size, struct cmsgh
return __ptr;
}
__KINLINE struct cmsghdr* cmsg_nxthdr (struct msghdr* __msg, struct cmsghdr* __cmsg) {
return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
}
#define SCM_RIGHTS 0x01
#define SCM_CREDENTIALS 0x02
#define SCM_SECURITY 0x03