#include #include #include #include #include #include #include #define SHM_KEY 0xABCD #define SHM_SIZE 5 int main (int argc, char *argv[]) { int shmid, i; char *shm_arr; if (fork() != 0) { shmid = shmget(SHM_KEY, SHM_SIZE, IPC_CREAT | 0600); shm_arr = shmat(shmid, NULL, 0); memset(shm_arr, 0, SHM_SIZE); srandomdev(); for (i=0; i