home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume14 / sharedmem / part01 / src / server8a.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-17  |  388 b   |  19 lines

  1. /* server8a.c - constant wait on common memory to test that cmm doesn't */
  2. /* blow up when we die and it is writing to us (SIGPIPE) */
  3.  
  4. #include <sys/time.h>
  5. #include "cm.h"
  6.  
  7. cm_variable *variable;
  8.  
  9. main()
  10. {
  11.     if (0>cm_init("constant reader SIGPIPE",0,0)) exit(-1);
  12.  
  13.     if (!(variable = cm_declare("variable",CM_ROLE_READER|CM_ROLE_WAKEUP))) exit(-1);
  14.  
  15.     while (1) {
  16.         cm_sync(CM_WAIT);
  17.     }
  18. }
  19.