×
Namespaces

Variants
Actions

Archived:Open C - Proper error code returned from S60 3rd Edition when shared memory is created twice with different size (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: 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)
Symbian
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
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.

This page was last modified on 8 August 2012, at 02:06.
26 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×