LinuxQuestions.org
Register a domain and help support LQ
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, 11: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, 10: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, 09: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: 233Reputation: 233Reputation: 233
You can ask the Mods to move it by reporting your own post.
 
Old 02-18-2009, 02: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 12:29 PM.
 
  


Reply


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


All times are GMT -5. The time now is 09:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration