diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-04-03 06:00:30 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-04-03 06:00:30 +0000 |
commit | dc4f9fc832068043e95bb414dd660fa24166f8bf (patch) | |
tree | 8052fa89c39db8cd24492ceebdfdfb643a45c702 | |
parent | 18752743a178591abad889a0a4fec17eee16fcd6 (diff) |
hide CMSG_ALIGN from userland, it is not part of RFC2292/Posix.1g.
-rw-r--r-- | sys/sys/socket.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 6e2c892c1e7..c8524ac9ed7 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -1,4 +1,4 @@ -/* $OpenBSD: socket.h,v 1.32 2000/03/04 02:34:23 itojun Exp $ */ +/* $OpenBSD: socket.h,v 1.33 2000/04/03 06:00:29 itojun Exp $ */ /* $NetBSD: socket.h,v 1.14 1996/02/09 18:25:36 christos Exp $ */ /* @@ -348,26 +348,29 @@ 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))) /* 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)) > \ (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) /* Round len up to next alignment boundary */ -#define CMSG_ALIGN(len) ALIGN(len) +#define __CMSG_ALIGN(len) ALIGN(len) +#ifdef _KERNEL +#define CMSG_ALIGN(n) __CMSG_ALIGN(n) +#endif /* Length of the contents of a control message of length len */ -#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) +#define CMSG_LEN(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) /* Length of the space taken up by a padded control message of length len */ -#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len)) +#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len)) /* "Socket"-level control message types: */ #define SCM_RIGHTS 0x01 /* access rights (array of int) */ |