The semget() function is used to create a new semaphore set or access existing one . This function is a core part of the system V IPC mechanism.
The primary purpose of 'semget()' is to obtain a semaphore identifier , which we can use to perform operations on the semaphore set. semget() function can either create a new semaphore set or get a access an existing one . once we get semid from semget() then we can use it to perform various operations like incrementing , decrementing semaphore values, removing semaphore set