shmctl()

This is used for performing certain control operations on the specified shared memory segment. Here is its syntax:

int shmctl(int shidtr, int cmd, struct shmid_ds *buf);

Here, we have to address the following:

If successfully executed, the function returns 0, otherwise it returns -1.