good afternoon all, so I'm trying my first attempt at semaphores and trying to recreate the producer consumer problem. My question seems kinda silly because its already done all over the internet but nobody talks about how to do it (so I guess Im the only one that doesn't know how, and that is how to name a semaphore.

In my program I am using multiple semaphores getting them using:
Code:
semid = semget(IPC_PRIVATE, 4, 0600 | IPC_CREAT);
     /* Initialize values for the 4 semaphores */
     semctl(semid, 0, SETVAL, 0);
     semctl(semid, 1, SETVAL, ITEM_SIZE * 10);
     semctl(semid, 2, SETVAL, 0);
     semctl(semid, 3, SETVAL, 0);
two of these are the empty and full semaphores that I will use to communicate between the producer and consumer using wait(full); and signal(empty); but my semaphores are not named accordingly. How can I do this? thx for the help.