+ /*
+ * Register memory to share with other processes, and pass current
+ * process id to the array.
+ */
+ shmid = shmget(shmkey, sizeof(struct message), IPC_CREAT | 0666);
+
+ processes = (struct message *)shmat(shmid, NULL, 0);
+ processes->pids[0] = getpid();
+