Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Implementation of mmap/munmap/msync.
27 // -----------------------------------------------------------------------------
28 // Funcation name: mmap
29 // Description: Provides mmap functionality.
30 // Returns: valid address : On success
32 // In case of error, errno value set
34 // -----------------------------------------------------------------------------
36 EXPORT_C void* mmap(void */*addr*/, size_t len, int prot, int flags, int fildes, off_t offset)
38 //TODO;To validate addr for page boundry and sharedmemory
39 return _mmap_r(_REENT, len, prot, flags, fildes, offset);
42 // -----------------------------------------------------------------------------
43 // Funcation name: munmap
44 // Description: Provides munmap functionality.
45 // Returns: 0 : On success
47 // In case of error, errno value set
48 // Remark: support for unmapping part of the mapped pages is not supported
49 // Unmap will remove all mappings those were mapped starting from the offset
50 // to offset + len (refer to mmap signature)
51 // -----------------------------------------------------------------------------
53 EXPORT_C int munmap(void *addr, size_t len)
55 //TODO;To validate addr for page boundry and sharedmemory
56 return _munmap_r(_REENT, addr, len);
59 // -----------------------------------------------------------------------------
60 // Funcation name: msync
61 // Description: Provides msync functionality.
62 // Returns: 0 : On success
64 // In case of error, errno value set
66 // -----------------------------------------------------------------------------
68 EXPORT_C int msync(void *addr, size_t len, int flags)
70 return _msync_r(_REENT, addr, len, flags);
73 // -----------------------------------------------------------------------------
74 // Funcation name: mprotect
75 // Description: Provides msync functionality.
76 // Returns: 0 : On success
78 // In case of error, errno value set
79 // Remark: mprotect is only build enabled and not functional
80 // -----------------------------------------------------------------------------
82 EXPORT_C int mprotect(const void *addr, size_t len, int prot)
84 return _mprotect_r(_REENT, addr, len, prot);