shmat
shmat is a function in the System V interprocess communication (IPC) API used to attach a shared memory segment to the address space of the calling process. A shared memory segment must first be created or obtained with shmget, and its identifier is provided to shmat via the shmid parameter.
The function prototype is void *shmat(int shmid, const void *shmaddr, int shmflg). The shmid identifies the desired
Common errors include EACCES (permission denied to access the segment), EINVAL (invalid shmid or incompatible shmflg,
Lifecycle and related calls: shmat is part of the System V IPC trio that also includes shmget
In summary, shmat enables interprocess sharing by mapping a shared memory segment into a process’s address