andre@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: /* andre@0: ** prshma.h -- NSPR Anonymous Shared Memory andre@0: ** andre@0: ** andre@0: */ andre@0: andre@0: #include "primpl.h" andre@0: andre@0: extern PRLogModuleInfo *_pr_shma_lm; andre@0: andre@0: #if defined(XP_UNIX) andre@0: /* defined in pr/src/md/unix/uxshm.c */ andre@0: #elif defined(WIN32) andre@0: /* defined in pr/src/md/windows/w32shm.c */ andre@0: #else andre@0: extern PRFileMap * _PR_MD_OPEN_ANON_FILE_MAP( const char *dirName, PRSize size, PRFileMapProtect prot ) andre@0: { andre@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); andre@0: return NULL; andre@0: } andre@0: extern PRStatus _PR_MD_EXPORT_FILE_MAP_AS_STRING(PRFileMap *fm, PRSize bufSize, char *buf) andre@0: { andre@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); andre@0: return PR_FAILURE; andre@0: } andre@0: extern PRFileMap * _PR_MD_IMPORT_FILE_MAP_FROM_STRING(const char *fmstring) andre@0: { andre@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); andre@0: return NULL; andre@0: } andre@0: #endif andre@0: andre@0: /* andre@0: ** PR_OpenAnonFileMap() -- Creates an anonymous file-mapped shared memory andre@0: ** andre@0: */ andre@0: PR_IMPLEMENT(PRFileMap*) andre@0: PR_OpenAnonFileMap( andre@0: const char *dirName, andre@0: PRSize size, andre@0: PRFileMapProtect prot andre@0: ) andre@0: { andre@0: return(_PR_MD_OPEN_ANON_FILE_MAP( dirName, size, prot )); andre@0: } /* end PR_OpenAnonFileMap() */ andre@0: andre@0: /* andre@0: ** PR_ProcessAttrSetInheritableFileMap() -- Prepare FileMap for export andre@0: ** to my children processes via PR_CreateProcess() andre@0: ** andre@0: ** andre@0: */ andre@0: PR_IMPLEMENT( PRStatus) andre@0: PR_ProcessAttrSetInheritableFileMap( andre@0: PRProcessAttr *attr, andre@0: PRFileMap *fm, andre@0: const char *shmname andre@0: ) andre@0: { andre@0: PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 ); andre@0: return( PR_FAILURE); andre@0: } /* end PR_ProcessAttrSetInheritableFileMap() */ andre@0: andre@0: /* andre@0: ** PR_GetInheritedFileMap() -- Import a PRFileMap previously exported andre@0: ** by my parent process via PR_CreateProcess() andre@0: ** andre@0: */ andre@0: PR_IMPLEMENT( PRFileMap *) andre@0: PR_GetInheritedFileMap( andre@0: const char *shmname andre@0: ) andre@0: { andre@0: PRFileMap *fm = NULL; andre@0: PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 ); andre@0: return( fm ); andre@0: } /* end PR_GetInhteritedFileMap() */ andre@0: andre@0: /* andre@0: ** PR_ExportFileMapAsString() -- Creates a string identifying a PRFileMap andre@0: ** andre@0: */ andre@0: PR_IMPLEMENT( PRStatus ) andre@0: PR_ExportFileMapAsString( andre@0: PRFileMap *fm, andre@0: PRSize bufSize, andre@0: char *buf andre@0: ) andre@0: { andre@0: return( _PR_MD_EXPORT_FILE_MAP_AS_STRING( fm, bufSize, buf )); andre@0: } /* end PR_ExportFileMapAsString() */ andre@0: andre@0: /* andre@0: ** PR_ImportFileMapFromString() -- Creates a PRFileMap from the identifying string andre@0: ** andre@0: ** andre@0: */ andre@0: PR_IMPLEMENT( PRFileMap * ) andre@0: PR_ImportFileMapFromString( andre@0: const char *fmstring andre@0: ) andre@0: { andre@0: return( _PR_MD_IMPORT_FILE_MAP_FROM_STRING(fmstring)); andre@0: } /* end PR_ImportFileMapFromString() */ andre@0: /* end prshma.c */