hide CMSG_ALIGN() from the userland, it is not part of RFC2292/Posix.1g.
This commit is contained in:
parent
1f0de7e7d2
commit
07f0b2299b
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: socket.h,v 1.52 2000/03/28 05:04:45 simonb Exp $ */
|
||||
/* $NetBSD: socket.h,v 1.53 2000/04/03 02:06:11 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
|
@ -397,7 +397,7 @@ struct cmsghdr {
|
|||
|
||||
/* given pointer to struct cmsghdr, return pointer to data */
|
||||
#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.
|
||||
|
@ -408,20 +408,23 @@ struct cmsghdr {
|
|||
* without (2), we can't guarantee binary compatibility in case of future
|
||||
* 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 */
|
||||
#define CMSG_NXTHDR(mhdr, cmsg) \
|
||||
(((caddr_t)(cmsg) + CMSG_ALIGN((cmsg)->cmsg_len) + \
|
||||
CMSG_ALIGN(sizeof(struct cmsghdr)) > \
|
||||
(((caddr_t)(cmsg) + __CMSG_ALIGN((cmsg)->cmsg_len) + \
|
||||
__CMSG_ALIGN(sizeof(struct cmsghdr)) > \
|
||||
(((caddr_t)(mhdr)->msg_control) + (mhdr)->msg_controllen)) ? \
|
||||
(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_SPACE(l) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(l))
|
||||
#define CMSG_LEN(l) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (l))
|
||||
#define CMSG_SPACE(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(l))
|
||||
#define CMSG_LEN(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (l))
|
||||
|
||||
/* "Socket"-level control message types: */
|
||||
#define SCM_RIGHTS 0x01 /* access rights (array of int) */
|
||||
|
|
Loading…
Reference in New Issue