Archived:Open C - Proper error code returned from S60 3rd Edition when shared memory is created twice with different size (Known Issue)
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.
Article Metadata
Tested with
Devices(s): All (S60 3rd Edition)
Compatibility
Platform(s): S60 3rd Edition (initial release, FP1, FP2)
Article
Created: User:Technical writer 1
(20 Aug 2008)
Last edited: hamishwillee
(08 Aug 2012)
Description
In the next Open C release, EEXIST is returned to the user instead of EINVAL when a user attempts to create a shared memory segment (shmget) twice while specifying different sizes for the segments.
This binary incompatible change is to improve the performance and better adhere to POSIX standards.
How to reproduce
int shm_id ;
if ((shm_id = shmget(1000, 100, 512))== -1) {
printf("shared memory create failed with errno %d\n", errno);
}
if ((shm_id = shmget(1000, 200, 1536))== -1) {
/* now returns with errno = 17 ( not errno = 22 ) */
printf("Shared memory create failed with errno %d\n", errno);
}
Solution
Open C applications should be ready to handle the change in returned error value.


(no comments yet)