On Thursday September 8 2005 4:08 pm, Tom Lane wrote:
> "Ed L." <[EMAIL PROTECTED]> writes:
> > I see sys/ipc.h already #includes sys/types.h, though.
>
> Possibly there's some magic #define needed to expose the cid_t
> definition?
>
> We have this in src/template/hpux
> CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"
> because it seems necessary on HPUX 10. It used to work on
> HPUX 11 too, the last time I tried that ...
Here's my 11.23 compile line:
gcc -O2 -mlp64 -Wall -Wmissing-prototypes -Wpointer-arith
-Wendif-labels -fno-strict-aliasing -I../../../src/include
-D_XOPEN_SOURCE_EXTENDED -c -o pg_sema.o pg_sema.c
I've attached sys/types.h and sys/ipc.h. I'm happy to try any
patches you suggest...
Ed
/* @(#) ipc.h $Date: 2004/08/05 11:40:57 $Revision: i380/5 PATCH_11.23 (PHKL_31500) */
/*
* (C) Copyright 1996-2004 Hewlett-Packard Development Company, LP
*/
/*
* @(#)
* Common interprocess communication (IPC) access structure definition,
* used by the three IPC mechanisms: messages, semaphores and shared
* memory.
*/
#ifndef _SYS_IPC_INCLUDED
#define _SYS_IPC_INCLUDED
#include <sys/stdsyms.h>
#include <sys/types.h>
#ifdef _INCLUDE_XOPEN_SOURCE
/* Needed types and structures */
/* Common IPC Access Structure */
struct ipc_perm {
# ifdef _CLASSIC_ID_TYPES
unsigned short filler_uid;
unsigned short uid; /* owner's user id */
unsigned short filler_gid;
unsigned short gid; /* owner's group id */
unsigned short filler_cuid;
unsigned short cuid; /* creator's user id */
unsigned short filler_cgid;
unsigned short cgid; /* creator's group id */
# else
uid_t uid; /* owner's user id */
gid_t gid; /* owner's group id */
uid_t cuid; /* creator's user id */
gid_t cgid; /* creator's group id */
# endif /* not _CLASSIC_ID_TYPES */
mode_t mode; /* access modes */
unsigned short __seq16;/* OLD slot usage sequence number */
key_t key; /* key */
unsigned short __ndx; /* NOT USED; was ndx of proc who has lock */
unsigned short __wait; /* waits, wanted, lock bits; reserved for
specific ipc facilities */
unsigned int seq; /* slot usage sequence number */
# ifdef _INCLUDE_HPUX_SOURCE
cid_t cid; /* Compartment ID */
# else
int __cpad; /* pad for non-hp code */
# endif /* _INCLUDE_HPUX_SOURCE */
char pad[12];/* room for future expansion */
};
# define _IPCPERM_T
/*
* Message queue size fields have been changed from short to long. This
* allows queues to now exceed old 64Kbytes limits. However, in order
* to preserve compatibility, queue limits will continue to default to
* 64Kbytes until a future release. If >64Kbytes is desired, programs
* using a common queue can be recompiled with -D__BIGMSGQUEUE_ENABLED.
* Also, the administrator must increase the appropriate kernel tunables.
*/
#if defined(__BIGMSGQUEUE_ENABLED)
# define __IPC16_CREAT 0001000
# define IPC_CREAT 0040000
#else
# define IPC_CREAT 0001000 /* create entry if key doesn't exist */
#endif
# define IPC_EXCL 0002000 /* fail if key exists */
# define IPC_NOWAIT 0004000 /* error if request must wait */
# define IPC_SHARE32 0010000 /* allocate in 32-bit addr space */
/* Used for sharing with 64 bit apps.*/
# define IPC_GLOBAL 0020000 /* Create shared memory segment so
* that it can be shared across memory
* windows.
*/
/*
* These flags only matter on ccNUMA machines. These flags allow the
* caller to specify where physical memory comes from for the pages
* mapped by a call to shmget(). For each flag, physical memory will
* come from:
*/
# define IPC_MEM_LOCAL 0100000 /* the current locality domain */
# define IPC_MEM_INTERLEAVED 0200000 /* interleaved memory */
# define IPC_MEM_FIRST_TOUCH 0400000 /* the touching locality domain */
# define IPC_MEM_STRIPED 01000000 /* striped amongst localities HINT */
/*
* This hint is used for a performance enhancement in the case where there
* are many shared memory segments being accessed by a process. Setting
* this hint "may" reuse protection id across all shared memory segments
* created by the process using this hint.
*/
# define IPC_RELAXED_ISOLATION 02000000
/* Keys. */
# define IPC_PRIVATE (key_t)0 /* private key */
/* Control Commands. */
# define IPC_RMID 0 /* remove identifier */
#ifdef _KERNEL
# define __IPC16_SET 1 /* pre-11.11 "ds" struct */
#endif
# define IPC_SET 11 /* set options */
# define IPC_STAT 2 /* get options */
#endif /* _INCLUDE_XOPEN_SOURCE */
#ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED
/* Function prototype for ftok() */
#ifndef _NO_USER_PROTOS
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
# if defined(__ia64) && !defined(_LIBC)
/* pragmas needed to support -B protected */
# pragma extern ftok
# endif /* __ia64 && ! _LIBC */
# ifdef _PROTOTYPES
extern key_t ftok(const char *, int);
# else /* not _PROTOTYPES */
extern key_t ftok();
# endif /* not _PROTOTYPES */
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* not _NO_USER_PROTOS */
#endif /* _INCLUDE_XOPEN_SOURCE_EXTENDED */
#ifdef _INCLUDE_HPUX_SOURCE
/* Common IPC Definitions. */
/* Mode bits. */
# define IPC_ALLOC 0100000 /* entry currently allocated */
# define IPC_LOCKED 0040000 /* structure is locked */
# define IPC_WANTED 0004000 /* process waiting for lock */
/*
** Struct oipc_perm is the obsolete version of struct ipc_perm.
** It was used before release A.08.00.
** Object code compatibility is supported for old a.out files
** that were compiled with this version. However, old .o files
** should be recompiled with the new struct ipc_perm if they are
** to be linked with the C library made for release A.08.00 or
** later releases.
**/
struct oipc_perm {
unsigned short uid; /* owner's user id */
unsigned short gid; /* owner's group id */
unsigned short cuid; /* creator's user id */
unsigned short cgid; /* creator's group id */
unsigned short mode; /* access modes */
unsigned short seq; /* slot usage sequence number */
key_t key; /* key */
unsigned short ndx; /* ndx of proc who has lock */
unsigned short wait; /* waits, wanted, lock bits; reserved for
specific ipc facilities */
};
struct ipcmap {
unsigned int m_size;
unsigned int m_addr;
};
# define _IPCMAP_T
# define ipcmapstart(X) (&(X)[1])
# define ipcmapwant(X) ((X)[0].m_addr)
# define ipcmapsize(X) ((X)[0].m_size)
# define ipcmapdata(X) {(X)-2, 0} , {0, 0}
# define ipcmapinit(X, Y) ((X)[0].m_size = (Y)-2)
/*
* Define MAXUSHORT based on the MAXINT style which exists in param.h .
* While at it, define our own IPC 'min()/max()' functions.
*/
#ifdef _KERNEL
# define MAXUSHORT 0xffff
# define IPCMIN(a,b) ( ((a)<(b)) ? (a) : (b) )
# define IPCMAX(a,b) ( ((a)>(b)) ? (a) : (b) )
#endif
#endif /* _INCLUDE_HPUX_SOURCE */
#endif /* _SYS_IPC_INCLUDED */
/* @(#) types.h $Date: 2004/08/05 11:42:41 $Revision: i380/4 PATCH_11.23 (PHKL_31500) */
/* (C) Copyright 1996 - 2004 Hewlett-Packard Development Company, LP
* This header provides definitions for basic data types.
*/
#ifndef _SYS_TYPES_INCLUDED
#define _SYS_TYPES_INCLUDED
#include <sys/stdsyms.h>
#include <sys/_inttypes.h>
/*
* This check is not needed since the inclusion of this header
* file indicates that the application expects something other
* than strict ansi namespace. Removing it to fix problems in
* other header files.
*
*#ifdef _INCLUDE_POSIX_SOURCE
*/
# ifndef _MQD_T
# define _MQD_T
typedef int mqd_t; /* POSIX MQ descriptor index */
# endif /* _MQD_T */
# ifndef _DEV_T
# define _DEV_T
typedef int32_t dev_t; /* For device numbers */
# endif /* _DEV_T */
# ifndef _INO32_T
# define _INO32_T
typedef uint32_t ino32_t;
# endif /* _INO32_T */
# ifndef _INO64_T
# define _INO64_T
# if !defined(__STDC_32_MODE__)
typedef uint64_t ino64_t;
# endif
# endif /* _INO32_T */
# ifndef _PSETID_T
# define _PSETID_T
typedef int psetid_t; /* processor set ID */
# endif /* _PSETID_T */
# ifndef _INO_T
# define _INO_T
typedef unsigned long ino_t;
# endif /* _INO_T */
# ifndef _MODE_T
# define _MODE_T
typedef uint16_t mode_t; /* For file types and modes */
# endif /* _MODE_T */
# ifndef _NLINK_T
# define _NLINK_T
typedef uint16_t nlink_t; /* For link counts */
# endif /* _NLINK_T */
# ifndef _FPOS32_T
# define _FPOS32_T
typedef int32_t fpos32_t; /* 32bit position inside a file */
# endif /* _FPOS32_T */
# ifndef _FPOS64_T
# define _FPOS64_T
# if !defined(__STDC_32_MODE__)
typedef int64_t fpos64_t; /* 64bit position inside a file */
# endif
# endif /* _FPOS64_T */
_NAMESPACE_STD_START
# ifndef _FPOS_T
# define _FPOS_T
# ifdef _APP32_64BIT_OFF_T
typedef int64_t fpos_t; /* position inside a file */
# else
typedef long fpos_t;
# endif
# endif /* _FPOS_T */
_NAMESPACE_STD_END
# ifndef _FSBLOCKS32_T
# define _FSBLOCKS32_T
typedef uint32_t fsblkcnt32_t; /* blocks within a file system */
# endif /* _FSBLOCKS32_T */
# ifndef _FSBLOCKS64_T
# define _FSBLOCKS64_T
# if !defined(__STDC_32_MODE__)
typedef uint64_t fsblkcnt64_t; /* blocks within a file system */
# endif
# endif /* _FSBLOCKS64_T */
# ifndef _FSBLOCKS_T
# define _FSBLOCKS_T
# if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL)
typedef uint64_t fsblkcnt_t; /* block count */
# define k_fsblkcnt_t fsblkcnt_t
# else
typedef unsigned long fsblkcnt_t;
# endif
# endif /* _FSBLOCKS_T */
# ifndef _OFF32_T
# define _OFF32_T
typedef int32_t off32_t; /* 32bit offsets and sizes */
# endif /* _OFF32_T */
#ifndef _BSIZE32_T
# define _BSIZE32_T
typedef int32_t sbsize32_t;
typedef uint32_t bsize32_t;
#endif /* _BSIZE32_T */
# ifndef _OFF64_T
# define _OFF64_T
# if !defined(__STDC_32_MODE__)
typedef int64_t off64_t; /* 64bit offsets and sizes */
# endif
# endif /* _OFF64_T */
# ifndef _BSIZE64_T
# define _BSIZE64_T
# if !defined(__STDC_32_MODE__)
typedef int64_t sbsize64_t;
typedef uint64_t bsize64_t;
# endif
# endif /* _BSIZE64_T */
# ifndef _OFF_T
# define _OFF_T
# if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL)
typedef int64_t off_t; /* For offsets and sizes */
# define k_off_t off_t
# else
typedef long off_t;
# endif
# endif /* _OFF_T */
# ifndef _BSIZE_T
# define _BSIZE_T
# if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL)
typedef int64_t sbsize_t; /* signed length in bytes */
typedef uint64_t bsize_t; /* unsigned length in bytes */
# else
typedef long sbsize_t;
typedef unsigned long bsize_t;
# endif
# endif /* _BSIZE_T */
# ifndef _FSFILCNT32_T
# define _FSFILCNT32_T
typedef uint32_t fsfilcnt32_t; /* free file nodes */
# endif /* _FSFILCNT32_T */
# ifndef _FSFILCNT64_T
# define _FSFILCNT64_T
# if !defined(__STDC_32_MODE__)
typedef uint64_t fsfilcnt64_t; /* free file nodes */
# endif
# endif /* _FSFILCNT64_T */
# ifndef _FSFILCNT_T
# define _FSFILCNT_T
# if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL)
typedef uint64_t fsfilcnt_t; /* free file nodes */
# define k_fsfilcnt_t fsfilcnt_t
# else
typedef unsigned long fsfilcnt_t;
# endif
# endif /* _FSFILCNT_T */
# ifndef _BLKCNT32_T
# define _BLKCNT32_T
typedef int32_t blkcnt32_t; /* 32-bit # of blocks */
# endif /* _BLKCNT32_T */
# ifndef _BLKCNT64_T
# define _BLKCNT64_T
# if !defined(__STDC_32_MODE__)
typedef int64_t blkcnt64_t; /* 64-bit # of blocks */
# endif
# endif /* _BLKCNT64_T */
# ifndef _BLKCNT_T
# define _BLKCNT_T
# if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL)
typedef int64_t blkcnt_t; /* # of blocks */
# define k_blkcnt_t blkcnt_t
# else
typedef long blkcnt_t;
# endif
# endif /* _BLKCNT_T */
# ifndef _PID_T
# define _PID_T
typedef int32_t pid_t; /* For process and session IDs */
# endif /* _PID_T */
# ifndef _LWPID_T
# define _LWPID_T
typedef int32_t lwpid_t; /* For process and session IDs */
# endif /* _LWPID_T */
# ifndef _GID_T
# define _GID_T
typedef int32_t gid_t; /* For group IDs */
# endif /* _GID_T */
# ifndef _UID_T
# define _UID_T
typedef int32_t uid_t; /* For user IDs */
# endif /* _UID_T */
# ifndef _TID_T
# define _TID_T
typedef int32_t tid_t; /* For thread IDs */
# endif /* _TID_T */
# ifndef _SSIZE_T
# define _SSIZE_T
typedef long ssize_t;
# endif /* _SSIZE_T */
# ifndef _SITE_T
# define _SITE_T
typedef uint16_t __site_t; /* see stat.h */
# endif /* _SITE_T */
# ifndef _CNODE_T
# define _CNODE_T
typedef uint16_t __cnode_t; /* see stat.h */
# endif /* _CNODE_T */
# ifndef _PRIV_T
# define _PRIV_T
typedef int32_t priv_t; /* For privileges */
# endif /* _PRIV_T */
# ifndef _PRIVSET_T
# define _PRIVSET_T
typedef struct __privset privset_t;/* For privilege set */
typedef privset_t priv_set_t;
# endif /* _PRIVSET_T */
# ifndef _CMPTID_T
# define _CMPTID_T
typedef int32_t cid_t; /* For compartment IDs */
typedef cid_t cmpt_t;
# endif /* _CMPTID_T */
/*
* #endif / * _INCLUDE_POSIX_SOURCE * /
*/
_NAMESPACE_STD_START
#if defined(_INCLUDE_POSIX_SOURCE) || defined(_INCLUDE__STDC__)
# ifndef _TIME_T
# define _TIME_T
# ifdef _KERNEL
typedef int32_t time_t;
# else
typedef long time_t;
# endif
# endif /* _TIME_T */
#endif /* _INCLUDE_POSIX_SOURCE || _INCLUDE__STDC__ */
#if defined(_INCLUDE_POSIX_SOURCE) || (defined(_INCLUDE__STDC__) && (!defined(_XPG4_EXTENDED) || defined(_INCLUDE_HPUX_SOURCE)))
# ifndef _SIZE_T
# define _SIZE_T
typedef unsigned long size_t;
# endif /* _SIZE_T */
#endif /* _INCLUDE_POSIX_SOURCE || (_INCLUDE__STDC__ && (!_XPG4_EXTENDED || _INCLUDE_HPUX_SOURCE)) */
#if defined(_INCLUDE_XOPEN_SOURCE) || (defined(_INCLUDE__STDC__) && (!defined(_XPG4_EXTENDED) || defined(_INCLUDE_HPUX_SOURCE)))
# ifndef _CLOCK_T
# define _CLOCK_T
typedef uint32_t clock_t; /* For clock ticks */
# endif /* _CLOCK_T */
#endif /* _INCLUDE_XOPEN_SOURCE || (_INCLUDE__STDC__ && (!_XPG4_EXTENDED || _INCLUDE_HPUX_SOURCE)) */
_NAMESPACE_STD_END
#ifdef _INCLUDE_XOPEN_SOURCE
# ifndef _KEY_T
# define _KEY_T
typedef int32_t key_t; /* For interprocess communication ID */
# endif /* _KEY_T */
typedef unsigned short __ushort; /* Try to avoid using this */
typedef int32_t __daddr_t; /* For disk block addresses */
typedef char *__caddr_t; /* For character addresses */
# if !defined(__STDC_32_MODE__)
typedef int64_t __swblk_t;
# else
typedef int32_t __swblk_t;
# endif /* __STDC_32_MODE__ */
#endif /* _INCLUDE_XOPEN_SOURCE */
#ifdef _INCLUDE_AES_SOURCE
# ifndef _CADDR_T
# define _CADDR_T
typedef __caddr_t caddr_t;
# endif /* _CADDR_T */
#endif /* _INCLUDE_AES_SOURCE */
#ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED
# ifndef _ID_T
# define _ID_T
typedef int32_t id_t; /* For IDs that can be pid_t, uid_t, gid_t */
# endif /* _ID_T */
# ifndef _USECONDS_T
# define _USECONDS_T
typedef uint32_t useconds_t; /* Time in microseconds */
# endif /* _USECONDS_T */
/* For getrlimit() */
# ifndef _RLIM32_T
# define _RLIM32_T
typedef uint32_t rlim32_t;
# endif /* _RLIM32_T */
# ifndef _RLIM64_T
# define _RLIM64_T
# if !defined(__STDC_32_MODE__)
typedef uint64_t rlim64_t;
# endif
# endif /* _RLIM64_T */
# ifndef _RLIM_T
# define _RLIM_T
# if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL)
# if !defined(__STDC_32_MODE__)
typedef uint64_t rlim_t;
# define k_rlim_t rlim_t
# endif /* __STDC_32_MODE__ */
# else
typedef unsigned long rlim_t;
# endif
# endif /* _RLIM_T */
/* For "struct statvfs" in statvfs.h */
typedef __site_t site_t;
#endif /* _INCLUDE_XOPEN_SOURCE_EXTENDED */
#ifdef _INCLUDE_HPUX_SOURCE
typedef unsigned char u_char; /* Try to avoid using these */
typedef unsigned short u_short; /* Try to avoid using these */
typedef unsigned int u_int; /* Try to avoid using these */
typedef unsigned long u_long; /* Try to avoid using these */
typedef unsigned int uint; /* Try to avoid using these */
typedef unsigned short ushort; /* Try to avoid using these */
typedef unsigned char ubit8;
typedef unsigned short ubit16;
typedef uint32_t ubit32;
typedef char sbit8;
typedef short sbit16;
typedef int32_t sbit32;
typedef __swblk_t swblk_t;
typedef __daddr_t daddr_t;
typedef __cnode_t cnode_t;
# ifdef _KERNEL
/*
* daddr_t will be left at 32 bits indefinitely for backward-compatibility
* with many on-disk structures and old kernel modules. Use daddr32_t
* and daddr64_t to be explicit about the size of disk offsets used in
* a given file system. kern_daddr_t will be used in all common kernel
* structures and will always track the largest offset width used in
* the system.
*/
typedef int64_t daddr64_t;
typedef int32_t daddr32_t;
typedef daddr64_t kern_daddr_t;
# endif /* _KERNEL */
/* For physical memory and virtual addresses and/or offsets */
#include <machine/vm/vmtypes.h>
# ifndef _ULONG_T
# define _ULONG_T
typedef unsigned long ulong_t;
# endif
typedef unsigned char uchar_t;
typedef unsigned short ushort_t;
typedef unsigned int uint_t;
typedef int16_t cnt_t;
typedef uint32_t cdno_t;
typedef uint16_t use_t;
typedef struct _physadr { intptr_t r[1]; } *physadr;
typedef int spu_t;
typedef int ldom_t;
# define MAXSUSE 65535 /* maximum share count on swap device */
typedef short cpu_t;
/*
* Locking declarations used by mod_k.h and stream.h.
*/
typedef struct lkinfo {
char *lk_name;
int lk_flags;
long lk_pad[2];
} lkinfo_t;
typedef unsigned long pl_t;
# ifndef _AID_T
# define _AID_T
typedef int32_t aid_t;
# endif /* _AID_T */
/* These probably should be moved to some other header */
# define UID_NO_CHANGE ((uid_t) -1) /* for chown(2) and setresuid(2) */
# define GID_NO_CHANGE ((gid_t) -1) /* for chown(2) and setresgid(2) */
typedef pid_t sid_t; /* For session IDs */
# define PGID_NOT_SET ((pid_t) -1) /* for no pgrp */
# define SID_NOT_SET ((sid_t) -1) /* for no session */
# define PGID_USE_PID ((pid_t) -2) /* set pgrp to pid */
# define SID_USE_PID ((sid_t) -2) /* set session to pid*/
/* Types, macros, etc. for select() */
# ifndef MAXFUPLIM
# define __fd_set fd_set
# include <sys/_fd_macros.h>
# undef __fd_set
/* NOTE: the other use of ifndef MAXFUPLIM (in _types.h goes away)*/
# define MAXFUPLIM _MAXFUPLIM
# define NFDBITS _NFDBITS
# ifndef howmany
# define howmany(x,y) (((x)+((y)-1))/(y))
# endif
typedef __fd_mask fd_mask;
# endif /* not MAXFUPLIM */
# ifndef _KERNEL
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
# ifdef _CLASSIC_ID_TYPES
# ifdef _SVID3
extern int setpgrp();
# endif /* _SVID3 */
# else /* not _CLASSIC_ID_TYPES */
# ifdef _PROTOTYPES
# ifdef _SVID3
extern pid_t setpgrp(void);
# endif /* _SVID3 */
# else /* not _PROTOTYPES */
# ifdef _SVID3
extern pid_t setpgrp();
# endif /* _SVID3 */
# endif /* not _PROTOTYPES */
# endif /* not _CLASSIC_ID_TYPES */
# ifdef _PROTOTYPES
# ifdef _SVID3
extern int ptrace(int, pid_t, int, int, int);
extern int ioctl(int, int, ...);
extern int acct(const char *);
# endif /* _SVID3 */
# else /* not _PROTOTYPES */
# ifdef _SVID3
extern int ptrace();
extern int ioctl();
extern int acct();
# endif /* _SVID3 */
# endif /* not _PROTOTYPES */
# ifdef __cplusplus
}
# endif /* __cplusplus */
# endif /* not _KERNEL */
#endif /* _INCLUDE_HPUX_SOURCE */
#if !defined(__STDC_32_MODE__)
/* Make these kernel types available as some commands need
* these types (via vnode.h). They will be available in
* ANSI-EXT mode, K&R or LP64 mode.
*/
# ifndef _DIR_OFF_T
# define _DIR_OFF_T
typedef int32_t dir_off_t;
# endif
#endif /* ! __STDC_32_MODE */
#ifdef _UNSUPPORTED
/*
* NOTE: The following header file contains information specific
* to the internals of the HP-UX implementation. The contents of
* this header file are subject to change without notice. Such
* changes may affect source code, object code, or binary
* compatibility between releases of HP-UX. Code which uses
* the symbols contained within this header file is inherently
* non-portable (even between HP-UX implementations).
*/
#include <.unsupp/sys/_types.h>
#endif /* _UNSUPPORTED */
#endif /* _SYS_TYPES_INCLUDED */
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org