From 219bef12c6fcfd0542d261c463eae0124efad93a Mon Sep 17 00:00:00 2001 From: Kevin Steves Date: Fri, 22 Mar 2002 20:53:32 +0000 Subject: - (stevesk) [defines.h] hp-ux 11 has ancillary data style fd passing, but is missing CMSG_LEN() and CMSG_SPACE() macros. --- defines.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'defines.h') diff --git a/defines.h b/defines.h index e4e413638..a25cae102 100644 --- a/defines.h +++ b/defines.h @@ -1,7 +1,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.82 2002/03/22 18:19:54 stevesk Exp $ */ +/* $Id: defines.h,v 1.83 2002/03/22 20:53:32 stevesk Exp $ */ /* Necessary headers */ @@ -440,6 +440,26 @@ struct winsize { # define howmany(x,y) (((x)+((y)-1))/(y)) #endif +#ifndef ALIGNBYTES +#define ALIGNBYTES (sizeof(int) - 1) +#endif +#ifndef ALIGN +#define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES) +#endif +#ifndef __CMSG_ALIGN +#define __CMSG_ALIGN(len) ALIGN(len) +#endif + +/* Length of the contents of a control message of length len */ +#ifndef CMSG_LEN +#define CMSG_LEN(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) +#endif + +/* Length of the space taken up by a padded control message of length len */ +#ifndef CMSG_SPACE +#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len)) +#endif + /* Function replacement / compatibility hacks */ /* In older versions of libpam, pam_strerror takes a single argument */ -- cgit v1.2.3