Using shared memory . . . with no safe guards. In this assignment you will write a program that connects to a shared memory segment that contains two integers. The first integer is a numerical value that corresponds to a number of cows in a stable. Your process has come to this shared memory to take a cow from that stable. The second integer is going to be a unique id. When you take a cow, you leave your own id so that the next person knows it is their turn to take a cow. This id (and who you follow) will be assigned to you during class. Your program will connect to the shared memory. Your program should report to the console the initial value and the initial unique id stored in the shared memory space. Then your program should wait until the initial id matches the users id that precedes you. If the id's do not match, your program will sleep for 1 second, wake up and then try again. You can use the usleep function in unistd.h for this. When the id does finally match, you reduce the number of cows by 1 and then change the id to your own. If this deduction results in a negative value for cows, set the cows to 999,999,999 instead. Your program should then report to the console the new cows value and unique id of the shared memory space and it may safely exit. When finished, detach from the shared memory segment but do not remove it. Your data structure could look like this: struct data { int cows; int id; }; To make sure that we all connect to the shared memory segment for this assignment, use ftok("/bin/ls",'A') to get the key. In addition, pass only 0777 as the last argument to shmget as the shared memory is already created and the other flags are both unnecessary and problematic in that situation. IDs: (You'll need to know yours and your "previous") Adam 497 (use previous as 1471) Daniel 804 Jacquelyn 207 Ashley 560 Henning 322 Caleb 1351 Alex 1589 Georgios 1433 Erin 917 Tianyi 1471