diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-BE70DCBF-366A-5054-B0F1-7FCEF45FC735.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-BE70DCBF-366A-5054-B0F1-7FCEF45FC735.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,40 @@ + + + + + +Creating and Unlinking a File Descriptor from a Shared Memory

The shm_open() function enables you to create shared memory and associate a file descriptor. Use the shm_unlink() function to remove (unlink a file descriptor from a shared memory) the name of the shared memory object.

Example:

#include <stdio.h> +#include <sys/mman.h> +#include <fcntl.h> +#include <errno.h> +int main(void) + { + int fd;// File Descriptor + int ret; + if((fd = shm_open("page", O_RDWR|O_CREAT, 0666)) < 0) + { + printf("Shared memory creation failed with errno %d\n", errno); + } + else + { + printf("Shared memory creation was successful\n"); + } + close(fd);//closing the file descriptor + if((ret = shm_unlink("page")) < 0) + { + printf("Shared memory unlinking failed with errno %d\n", errno); + } + else + { + printf("Shared memory unlinking was successful\n"); + } + return ret; + }
Librt Overview Writing, Reading and Seeking from a + Shared Memory Retrieving Information about a + Shared Memory Object Clocks and Timers Tutorial
\ No newline at end of file