version 1.52, 2000/03/28 05:04:45 |
version 1.53, 2000/04/03 02:06:11 |
Line 397 struct cmsghdr { |
|
Line 397 struct cmsghdr { |
|
|
|
/* given pointer to struct cmsghdr, return pointer to data */ |
/* given pointer to struct cmsghdr, return pointer to data */ |
#define CMSG_DATA(cmsg) \ |
#define CMSG_DATA(cmsg) \ |
((u_char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))) |
((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr))) |
|
|
/* |
/* |
* Alignment requirement for CMSG struct manipulation. |
* Alignment requirement for CMSG struct manipulation. |
Line 408 struct cmsghdr { |
|
Line 408 struct cmsghdr { |
|
* without (2), we can't guarantee binary compatibility in case of future |
* without (2), we can't guarantee binary compatibility in case of future |
* changes in ALIGNBYTES. |
* changes in ALIGNBYTES. |
*/ |
*/ |
#define CMSG_ALIGN(n) (((n) + __cmsg_alignbytes()) & ~__cmsg_alignbytes()) |
#define __CMSG_ALIGN(n) (((n) + __cmsg_alignbytes()) & ~__cmsg_alignbytes()) |
|
#ifdef _KERNEL |
|
#define CMSG_ALIGN(n) CMSG_ALIGN(n) |
|
#endif |
|
|
/* given pointer to struct cmsghdr, return pointer to next cmsghdr */ |
/* given pointer to struct cmsghdr, return pointer to next cmsghdr */ |
#define CMSG_NXTHDR(mhdr, cmsg) \ |
#define CMSG_NXTHDR(mhdr, cmsg) \ |
(((caddr_t)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len) + \ |
(((caddr_t)(cmsg) + __CMSG_ALIGN((cmsg)->cmsg_len) + \ |
CMSG_ALIGN(sizeof(struct cmsghdr)) > \ |
__CMSG_ALIGN(sizeof(struct cmsghdr)) > \ |
(((caddr_t)(mhdr)->msg_control) + (mhdr)->msg_controllen)) ? \ |
(((caddr_t)(mhdr)->msg_control) + (mhdr)->msg_controllen)) ? \ |
(struct cmsghdr *)NULL : \ |
(struct cmsghdr *)NULL : \ |
(struct cmsghdr *)((caddr_t)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len))) |
(struct cmsghdr *)((caddr_t)(cmsg) + __CMSG_ALIGN((cmsg)->cmsg_len))) |
|
|
#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control) |
#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control) |
|
|
#define CMSG_SPACE(l) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(l)) |
#define CMSG_SPACE(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(l)) |
#define CMSG_LEN(l) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (l)) |
#define CMSG_LEN(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (l)) |
|
|
/* "Socket"-level control message types: */ |
/* "Socket"-level control message types: */ |
#define SCM_RIGHTS 0x01 /* access rights (array of int) */ |
#define SCM_RIGHTS 0x01 /* access rights (array of int) */ |