msgLogger: waits for messages and writes them to a log msgLogger create a pid file myLogger.pid chid = channelCreate(0); //open pid file, write 3 nums, close file node descriptor, getpid(), chid for(;;) { clientID = MsgReceive( ); status = processMsg(&msg, ...); MsgReply(clientID, status, NULL, 0); //write the icnoming message to file fprintf( } ---------------------------------------- int processMessage(MESSAGE *m, ...) { time_t theTime = time(NULL); char timstring[26]; ctime_r(&theTime, timeString); timeString[24] = ';'; Switch(m->msg_hdr) --------------------------------------------------------- char *loggerPidName; loggerPidName = malloc(strlen(argv[0]) + 5); strcpy(loggerPidName, argv[0]); strcat(loggerPidName, ".pid"); if(fopen(loggerPidName, "r") == NULL) { //BAD } fscanf(_____); ContnectAttach ---------------------------------------------- MESSAGE msg; for(;;) { createMsg(&msg); status = msgSend(&msg, ___); switch(status) { } }