#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 ***************************************************************************** ** * ** HPE CONFIDENTIAL. This software is confidential proprietary software * ** licensed by Hewlett Packard Enterprise Development, LP, and is not * ** authorized to be used, duplicated or disclosed to anyone without the * ** prior written permission of HPE. * ** Copyright 2003 Hewlett Packard Enterprise Development, LP * ** * ** VMS SOFTWARE, INC. CONFIDENTIAL. This software is confidential * ** proprietary software licensed by VMS Software, Inc., and is not * ** authorized to be used, duplicated or disclosed to anyone without * ** the prior written permission of VMS Software, Inc. * ** Copyright 2022-2023 VMS Software, Inc. * ** * ***************************************************************************** */ #ifdef __cplusplus extern "C" { #endif #if __INITIAL_POINTER_SIZE || defined(__clang__) # pragma __required_pointer_size __save # pragma __required_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. We now allow long pointers in function calls. */ #if __INITIAL_POINTER_SIZE || defined(__clang__) # pragma __required_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 __required_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 || defined(__clang__) # pragma __required_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 __required_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 || defined(__clang__) # pragma __required_pointer_size __restore #endif #ifdef __cplusplus } #endif #endif /* OpenVMS V7.0 or later */ #pragma __standard #endif /* __MMAN_LOADED */