#ifndef __MMAN_LOADED #define __MMAN_LOADED 1 #pragma __nostandard #include #if __CRTL_VER >= 70000000 /* Only OpenVMS V7.0 or later */ /**************************************************************************** ** ** - Declarations for mapping pages of memory ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4, Version 2 ***************************************************************************** ** ** Copyright 2003 Hewlett-Packard Development Company, L.P. ** ** Confidential computer software. Valid license from HP and/or ** its subsidiaries required for possession, use, or copying. ** ** Consistent with FAR 12.211 and 12.212, Commercial Computer Software, ** Computer Software Documentation, and Technical Data for Commercial ** Items are licensed to the U.S. Government under vendor's standard ** commercial license. ** ** Neither HP nor any of its subsidiaries shall be liable for technical ** or editorial errors or omissions contained herein. The information ** in this document is provided "as is" without warranty of any kind and ** is subject to change without notice. The warranties for HP products ** are set forth in the express limited warranty statements accompanying ** such products. Nothing herein should be construed as constituting an ** additional warranty. ** ***************************************************************************** */ #ifdef __cplusplus extern "C" { #endif #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** Define off_t and size_t structures */ #if !defined __OFF_T && !defined _DECC_V4_SOURCE # define __OFF_T 1 typedef __off_t off_t; #endif #ifndef __SIZE_T # define __SIZE_T 1 #ifdef __NAMESPACE_STD namespace std { #endif typedef __size_t size_t; #ifdef __NAMESPACE_STD } /* namespace std */ using std::size_t; #endif #endif /* ** Symbolic constants for protection for mmap, mprotect */ #define PROT_NONE 0 #define PROT_READ 1 #define PROT_WRITE 2 #define PROT_EXEC 4 /* ** Specify either MAP_SHARED or MAP_PRIVATE */ #define MAP_SHARED 0x01 #define MAP_PRIVATE 0x02 /* ** Specify wither MAP_FIXED or MAP_VARIABLE */ #define MAP_FIXED 0x100 #if !defined _XOPEN_SOURCE_EXTENDED # define MAP_VARIABLE 0x200 #endif /* ** failure status from mmap() */ #define MAP_FAILED ((void *)-1) /* ** Flags for msync() */ #define MS_ASYNC 0x01 #define MS_SYNC 0x02 #define MS_INVALIDATE 0x04 #if !defined _XOPEN_SOURCE_EXTENDED /* ** Specify either MAP_FILE or MAP_ANONYMOUS */ # define MAP_ANONYMOUS 0x10 # define MAP_ANON 0x10 # define MAP_FILE 0x20 #endif /* ** At this point in the processing, we are done defining those things which ** must always be short pointers. If the user has used the /pointer_size ** qualifier, we will allow long pointers to be used in function calls ** regardless of whether they have specified short or long pointers. */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size 64 #endif /* ** Functions which accept either 32 bit or 64 bit pointers */ int mprotect (void *addr, __size_t len, int prot); int munmap (void *addr, __size_t len); int msync (void *addr, __size_t len, int flags); #if __CRTL_VER >= 70200000 /* ** shm_open and shm_unlink functions were added in OpenVMS V7.2 */ int shm_open (const char * __name, int __oflag, __mode_t __mode); int shm_unlink (const char * __name); #endif /* ** Functions which have separate implementations for 32 bit and 64 bit ** pointers. The implementation defaults to that corresponding to the ** default pointer size used in the /POINTER_SIZE qualifier. */ #if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 #endif /* ** Beginning in OpenVMS V7.2, the mmap() function was enhanced to ** allow specifying an additional parameter through which the caller ** can request creation a special kind of the global section for ** MAP_SHARED (DEC C extension). */ #if __USE_OFF64_T # pragma __extern_prefix __save # pragma __extern_prefix "__off64_" #endif #if !defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE) && __CRTL_VER > 70100622 void *mmap (void *addr, __size_t len, int prot, int flags, int filedes, __off_t off, ...); #else void *mmap (void *addr, __size_t len, int prot, int flags, int filedes, __off_t off); #endif #if __INITIAL_POINTER_SIZE # pragma __pointer_size 32 # if !defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE) && __CRTL_VER > 70100622 void *_mmap32 (void *addr, __size_t len, int prot, int flags, int filedes, __off_t off, ...); # else void *_mmap32 (void *addr, __size_t len, int prot, int flags, int filedes, __off_t off); # endif # pragma __pointer_size 64 #if !defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE) && __CRTL_VER > 70100622 void *_mmap64 (void *addr, __size_t len, int prot, int flags, int filedes, __off_t off, ...); # else void *_mmap64 (void *addr, __size_t len, int prot, int flags, int filedes, __off_t off); # endif #endif #if __USE_OFF64_T # pragma __extern_prefix __restore #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #endif /* OpenVMS V7.0 or later */ #pragma __standard #endif /* __MMAN_LOADED */