summaryrefslogtreecommitdiffstats
path: root/defines.h
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2002-03-22 20:53:32 +0000
committerKevin Steves <stevesk@pobox.com>2002-03-22 20:53:32 +0000
commit219bef12c6fcfd0542d261c463eae0124efad93a (patch)
tree3446c83d7b2c243557447fc6066111b8cdb2fe07 /defines.h
parent205cc1ef461d0c6996dc3757e52e229b5053274b (diff)
- (stevesk) [defines.h] hp-ux 11 has ancillary data style fd passing, but
is missing CMSG_LEN() and CMSG_SPACE() macros.
Diffstat (limited to 'defines.h')
-rw-r--r--defines.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/defines.h b/defines.h
index e4e41363..a25cae10 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 */