Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-10-2009, 11:01 PM   #1
LQ Newbie
Registered: Dec 2008
Posts: 5

Rep: Reputation: 0
File Mapping in Linux


I have an application that uses the following Windows APIs.

HANDLE CreateFileMapping(
LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
DWORD flProtect,
DWORD dwMaximumSizeHigh,
DWORD dwMaximumSizeLow,

__in HANDLE hFileMappingObject,
__in DWORD dwDesiredAccess,
__in DWORD dwFileOffsetHigh,
__in DWORD dwFileOffsetLow,
__in SIZE_T dwNumberOfBytesToMap

I need to reprogram this application to run on Linux. Is mmap function a good replacement for the above two API calls. If not please suggest an alternative method.

Thanks and Regards
Old 02-12-2009, 10:29 AM   #2
LQ Newbie
Registered: Oct 2008
Location: London, UK
Distribution: SUSE
Posts: 19

Rep: Reputation: 0
You might be better off asking this in the programming forum
Old 02-18-2009, 09:18 AM   #3
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
You can ask the Mods to move it by reporting your own post.
Old 02-18-2009, 02:53 PM   #4
Registered: Jan 2009
Posts: 100

Rep: Reputation: 17
When using mmap you should be aware that some hosting server service providers (Hostmonster for example) have mmap disabled on their systems. So if your application has to run as some CGI tool on such a server, then you first need to check if mmap is there. A possible workaround is to compile a static application on a similar system. It will be difficult if you have (for example) no 64 bit system locally and you need to compile on the remote server, which is 64-bit and where mmap is not supported.


Last edited by servat78; 02-19-2009 at 12:29 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapping a HD block to a file? liutabme Slackware 4 08-21-2006 12:26 PM
Batch file for mapping dirves suse2166 General 3 02-14-2006 12:41 PM
> File Mapping And Pthreads, How to map file in memory? level3 Programming 1 01-16-2006 10:13 PM
which conf file to edit for mapping keyboard csvke Linux - Newbie 2 02-25-2004 03:47 PM
physical scsi channel mapping to scsiX device node mapping, how to configure manually drthornt Linux - Hardware 3 02-09-2003 12:50 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration