summaryrefslogtreecommitdiff
path: root/ACE/ace/Mem_Map.h
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2006-10-26 23:07:24 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2006-10-26 23:07:24 +0000
commit46ff95c136f19b0ceb5d29c9163ef09980f4e957 (patch)
treef13a58e9814886bf7627a4f566caa7425bd61a25 /ACE/ace/Mem_Map.h
parente42ceb671482eb61a7cfce255b1ed6f103d9b610 (diff)
downloadATCD-46ff95c136f19b0ceb5d29c9163ef09980f4e957.tar.gz
ChangeLogTag:Thu Oct 27 01:59:19 UTC 2006 Ossama Othman <ossama_othman at symantec dot com>
Diffstat (limited to 'ACE/ace/Mem_Map.h')
-rw-r--r--ACE/ace/Mem_Map.h43
1 files changed, 27 insertions, 16 deletions
diff --git a/ACE/ace/Mem_Map.h b/ACE/ace/Mem_Map.h
index e817a1dde5e..847568fb53e 100644
--- a/ACE/ace/Mem_Map.h
+++ b/ACE/ace/Mem_Map.h
@@ -48,51 +48,51 @@ public:
/// Map a file from an open file descriptor @a handle. This function
/// will lookup the length of the file if it is not given.
ACE_Mem_Map (ACE_HANDLE handle,
- ssize_t length = -1,
+ size_t length = static_cast<size_t> (-1),
int prot = PROT_RDWR,
int share = ACE_MAP_PRIVATE,
void *addr = 0,
- off_t offset = 0,
+ ACE_OFF_T offset = 0,
LPSECURITY_ATTRIBUTES sa = 0);
/// Map a file specified by @a file_name.
ACE_Mem_Map (const ACE_TCHAR *filename,
- ssize_t length = -1,
+ size_t length = static_cast<size_t> (-1),
int flags = O_RDWR | O_CREAT,
int mode = ACE_DEFAULT_FILE_PERMS,
int prot = PROT_RDWR,
int share = ACE_MAP_PRIVATE,
void *addr = 0,
- off_t offset = 0,
+ ACE_OFF_T offset = 0,
LPSECURITY_ATTRIBUTES sa = 0);
/// Map a file from an open file descriptor @a handle. This function
/// will lookup the length of the file if it is not given.
int map (ACE_HANDLE handle,
- ssize_t length = -1,
+ size_t length = static_cast<size_t> (-1),
int prot = PROT_RDWR,
int share = ACE_MAP_PRIVATE,
void *addr = 0,
- off_t offset = 0,
+ ACE_OFF_T offset = 0,
LPSECURITY_ATTRIBUTES sa = 0);
/// Remap the file associated with <handle_>.
- int map (ssize_t length = -1,
+ int map (size_t length = static_cast<size_t> (-1),
int prot = PROT_RDWR,
int share = ACE_MAP_PRIVATE,
void *addr = 0,
- off_t offset = 0,
+ ACE_OFF_T offset = 0,
LPSECURITY_ATTRIBUTES sa = 0);
/// Map a file specified by <filename>.
int map (const ACE_TCHAR *filename,
- ssize_t length = -1,
+ size_t length = static_cast<size_t> (-1),
int flags = O_RDWR | O_CREAT,
int mode = ACE_DEFAULT_FILE_PERMS,
int prot = PROT_RDWR,
int share = ACE_MAP_PRIVATE,
void *addr = 0,
- off_t offset = 0,
+ ACE_OFF_T offset = 0,
LPSECURITY_ATTRIBUTES sa = 0);
/// Destructor.
@@ -139,7 +139,13 @@ public:
* starting at <base_addr_>. If <len> == -1 then sync the whole
* region.
*/
- int sync (ssize_t len = -1, int flags = MS_SYNC);
+ int sync (size_t len, int flags = MS_SYNC);
+
+ /**
+ * Sync the whole memory region to the backing store
+ * starting at <base_addr_>.
+ */
+ int sync (int flags = MS_SYNC);
/// Sync <len> bytes of the memory region to the backing store
/// starting at <addr_>.
@@ -147,10 +153,15 @@ public:
/**
* Change the protection of the pages of the mapped region to <prot>
- * starting at <base_addr_> up to <len> bytes. If <len> == -1 then
- * change protection of all pages in the mapped region.
+ * starting at <base_addr_> up to <len> bytes.
+ */
+ int protect (size_t len, int prot = PROT_RDWR);
+
+ /**
+ * Change the protection of all the pages of the mapped region to <prot>
+ * starting at <base_addr_>.
*/
- int protect (ssize_t len = -1, int prot = PROT_RDWR);
+ int protect (int prot = PROT_RDWR);
/// Change the protection of the pages of the mapped region to <prot>
/// starting at <addr> up to <len> bytes.
@@ -179,11 +190,11 @@ private:
/// This method does the dirty work of actually calling ::mmap to map
/// the file into memory.
int map_it (ACE_HANDLE handle,
- ssize_t len = -1,
+ size_t len = static_cast<size_t> (-1),
int prot = PROT_RDWR,
int share = MAP_SHARED,
void *addr = 0,
- off_t offset = 0,
+ ACE_OFF_T offset = 0,
LPSECURITY_ATTRIBUTES sa = 0);
// = Disallow copying and assignment.