LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
File Mapping in Linux


Hi,

I have an application that uses the following Windows APIs.

HANDLE CreateFileMapping(
HANDLE hFile,
LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
DWORD flProtect,
DWORD dwMaximumSizeHigh,
DWORD dwMaximumSizeLow,
LPCTSTR lpName
);

LPVOID WINAPI MapViewOfFile(
__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, 09:29 AM   #2
mapryan
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
http://www.linuxquestions.org/questions/programming-9/
 
Old 02-18-2009, 08:18 AM   #3
archtoad6
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, 01:53 PM   #4
servat78
Member
 
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.

Debian

Last edited by servat78; 02-19-2009 at 11:29 AM.
 
  


Reply



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 11:26 AM
Batch file for mapping dirves suse2166 General 3 02-14-2006 11:41 AM
> File Mapping And Pthreads, How to map file in memory? level3 Programming 1 01-16-2006 09:13 PM
which conf file to edit for mapping keyboard csvke Linux - Newbie 2 02-25-2004 02:47 PM
physical scsi channel mapping to scsiX device node mapping, how to configure manually drthornt Linux - Hardware 3 02-09-2003 11:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:35 PM.

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