-#define SHM_RDONLY 010000 /* Attach read-only (else read-write) */
-#define SHM_RND 020000 /* Round attach address to SHMLBA */
-#define SHMLBA NBPG /* Segment low boundary address multiple */
+/*
+ * [XSI] The pid_t, time_t, key_t, and size_t types shall be defined as
+ * described in <sys/types.h>.
+ *
+ * NOTE: The definition of the key_t type is implicit from the
+ * inclusion of <sys/ipc.h>
+ */
+#ifndef _PID_T
+typedef __darwin_pid_t pid_t;
+#define _PID_T
+#endif
+
+#ifndef _TIME_T
+#define _TIME_T
+typedef __darwin_time_t time_t;
+#endif
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef __darwin_size_t size_t;
+#endif
+
+/*
+ * [XSI] The unsigned integer type used for the number of current attaches
+ * that MUST be able to store values at least as large as a type unsigned
+ * short.
+ */
+typedef unsigned short shmatt_t;
+
+
+/*
+ * Possible flag values which may be OR'ed into the third argument to
+ * shmat()
+ */
+#define SHM_RDONLY 010000 /* [XSI] Attach read-only (else read-write) */
+#define SHM_RND 020000 /* [XSI] Round attach address to SHMLBA */
+
+/*
+ * This value is symbolic, and generally not expected to be sed by user
+ * programs directly, although such ise is permitted by the standard. Its
+ * value in our implementation is equal to the number of bytes per page.
+ *
+ * NOTE: We DO NOT obtain this value from the appropriate system
+ * headers at this time, to avoid the resulting namespace
+ * pollution, which is why we discourages its use.
+ */
+#define SHMLBA 4096 /* [XSI] Segment low boundary address multiple*/