[ 永遠的UNIX::UNIX技術資料的寶庫 ]   GB | BIG5

首頁 > 編程技術 > 源碼天堂 > 正文
C源碼:四種UNIX消息隊列操作函數(對應.C的頭文件)
本文出自:http://mly363.363.net 作者: (2001-08-22 16:35:15)
/*
   UNIXMSG.H --- Functions for Unix messages process
   M.L.Y  1999.12.13

   MODIFIED   (YYYY.MM.DD)
    M.L.Y      1999.12.13 -  Creation
    M.L.Y      2000.07.27 -  Change for HP-UX, add msgq_rmid()
*/

#ifndef  UNIXMSG_H_INCLUDE
# define UNIXMSG_H_INCLUDE

#include "CMNDEF.H"

#include <stdio.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/stat.h>
#include < sys/types.h >

/* #define MSGPERMS 0666 */
#define MSGPERMS 0660        /* rw-rw---- */
#define MAX_MSGQ_SIZE 1024

typedef struct
{
  long type;
  USGC buf[MAX_MSGQ_SIZE];
} MsgQueue;

extern MsgQueue MsgQ;

int  openmsg(long MsgKey);
int  msgq_rmid(int MsgId);
int  rcvmsg_nowait(long MsgKey, USGC *Buff, long *MsgType);
int  rcvmsg_type_nowait(long MsgKey, USGC *Buff, long MsgType);
int  rcvmsg_wait(long MsgKey, USGC *Buff);
int  rcvmsg_type(long MsgKey, USGC *Buff, long *MsgType);
int  sndmsg(long MsgKey, USGC *Buff, int MsgLen);
int  sndmsg_type(long MsgKey, USGC *Buff, long MsgType, int MsgLen);
int  delmsg(long MsgKey);

#endif  /* UNIXMSG_H_INCLUDE */

/* End of file */

(http://www.fanqiang.com)
    進入【UNIX論壇

相關文章
C源碼:四種UNIX消息隊列操作函數(對應.C的頭文件) (2001-08-22 16:35:15)
C源碼:四種UNIX消息隊列操作函數 (2001-08-20 07:00:00)
 

★  樊強制作 歡迎分享  ★