//my_pxmsg_mmap/mqueue.h
typedef struct mymq_info	*mymqd_t;

struct mymq_attr {
  long	mq_flags;		/*   : O_NONBLOCK */
  long	mq_maxmsg;		/*      */
  long	mq_msgsize;		/*      */
  long	mq_curmsgs;		/*     */
};

	/*   mymq_hdr{}  ,     */
struct mymq_hdr {
  struct mymq_attr	mqh_attr;	/*   */
  long				mqh_head;	/*   */
  long				mqh_free;	/*     */
  long				mqh_nwait;	/*   mq_receive()  */
  pid_t				mqh_pid;	/*  PID,     */
  struct sigevent	mqh_event;	/*  mq_notify() */
  pthread_mutex_t	mqh_lock;	/* : mutex */
  pthread_cond_t	mqh_wait;	/*    */
};

	/*  mymsg_hdr{}     */
struct mymsg_hdr {
  long	msg_next;				/*      */
								/* msg_next       */
  ssize_t	msg_len;			/*   */
  unsigned int	msg_prio;		/*  */
};

	/*  mymq_info{}    mq_open() */
struct mymq_info {
  struct mymq_hdr	*mqi_hdr;	/*    */
  long	mqi_magic;				/*     */
  int	mqi_flags;				/*     */
};
#define	MQI_MAGIC	0x98765432

	/*      */
#define	MSGSIZE(i)	((((i) + sizeof(long)-1) / sizeof(long)) * sizeof(long))
