×
Namespaces

Variants
Actions

Archived:Open C - Specifying only PROT EXEC in mmap no longer supported (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 Ed)
Compatibility
Platform(s): S60 3rd Edition (initial release, FP1, FP2)
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 (28 Jun 2012)

Description

Symbian C++ does not support executable buffers (memory execution). Therefore, specifying PROC_EXEC only (setting only the eXecute part in file permissions) is not supported and returns with ENOSUP.

If any other parts (such as read/write) are specified along with the PROC_EXEC, the permission to execute is simply ignored.

This binary incompatible change is to improve the performance and better adhere to POSIX standards.

How to reproduce

  int fd = -1; 
char* mapaddr;
int len = getpagesize();
int prot = PROT_EXEC; /* not supported */
 
if((fd = open("c:\\Test.txt", O_RDWR | O_CREAT, 0666)) < 0) {
printf("file open failed\n");
}
/* returns with errno = 45 */
mapaddr = (char*)mmap((void*)0, len, prot, MAP_SHARED, fd, 0);

Solution

No solution.

This page was last modified on 28 June 2012, at 06:14.
37 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.

×