Presentation Pipeexpt1
Presentation Pipeexpt1
The first parameter specifies the unique number (called key) identifying the
shared segment.
The second parameter is the size of the shared segment e.g. 1024 bytes or 2048
bytes.
The third parameter specifies the permissions on the shared segment.
On success the shmget() function returns a valid identifier while on failure it
return -1.
Receivermemory.c
shmat() is used to attach the created shared segment with the address space of
the calling process.
The first parameter here is the identifier which shmget() function returns on
success.
The second parameter is the address where to attach it to the calling process. A
NULL value of second parameter means that the system will automatically choose
a suitable address.
The third parameter is ‘0’ if the second parameter is NULL, otherwise, the value is
specified by SHM_RND.
Messagequeue1.c,messagequeue2.c