home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_11 / 8n11051b < prev    next >
Text File  |  1990-09-18  |  527b  |  17 lines

  1.  
  2. int msqid;              /* Message queue identifier */
  3. key_t key=0x1024;       /* Name of message queue    */
  4.  
  5.  
  6. if ((msqid=msgget(key, 0660 | IPC_CREAT | IPC_EXCL)) == -1)  {
  7.        /* Can't create a new message queue.  One already
  8.          * exists by the same name.  It is possible another
  9.          * process is using the same key to get a message
  10.          * queue.  This prevents us from stepping on each
  11.        * other.
  12.         */
  13.         fprintf(stderr,"Message queue already exists\n");
  14.         return(-1);
  15. }
  16.  
  17.