This is my lab report on 11/11: 1. Using STORE through a pointer. #define STORESIZE 12 #define STOREIDSIZE 9 #define STORELEMSIZE 10 typedef char storeid[STOREIDSIZE]; typedef char storeelem[STORELEMSIZE]; typedef struct { storeid id; storeelem elem; } storepair; typedef storepair storetype[STORESIZE]; storetype * storeptr; void storeinit(); int main() { // Get shmid using shmget or from the file "segid.dat". storeptr = (storetype *) shmat (shmid, 0, 0); storeinit(); printf("id of the second entry:%s\n", storeptr[1]->id); exit(0); } void storeinit(0 { strcpy(storeptr[0]->id, "123456789"); strcpy....... } 2. Example of unlinking an existing file: #include #include #include #include int main() { if (open("tempfile", O_RDWR) < 0) { perror("Open error!"); exit(1); } if (unlink("tempfile") < 0) { perror("Unlink error!"); exit(1); } printf ("File unlinked!\n"); } 3. NOTE: If you have some shared memory segments not deleted after running the program, you must use the shell level command ipcs and ipcrm to remove them.