nsprpub/pr/src/memory/prshma.c

Wed, 31 Dec 2014 06:55:46 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:46 +0100
changeset 1
ca08bd8f51b2
permissions
-rw-r--r--

Added tag TORBROWSER_REPLICA for changeset 6474c204b198

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 /*
     7 ** prshma.h -- NSPR Anonymous Shared Memory
     8 **
     9 ** 
    10 */
    12 #include "primpl.h"
    14 extern PRLogModuleInfo *_pr_shma_lm;
    16 #if defined(XP_UNIX)
    17 /* defined in pr/src/md/unix/uxshm.c */
    18 #elif defined(WIN32)
    19 /* defined in pr/src/md/windows/w32shm.c */
    20 #else
    21 extern PRFileMap * _PR_MD_OPEN_ANON_FILE_MAP( const char *dirName, PRSize size, PRFileMapProtect prot )
    22 {
    23     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    24     return NULL;
    25 }
    26 extern PRStatus _PR_MD_EXPORT_FILE_MAP_AS_STRING(PRFileMap *fm, PRSize bufSize, char *buf)
    27 {
    28     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    29     return PR_FAILURE;
    30 }
    31 extern PRFileMap * _PR_MD_IMPORT_FILE_MAP_FROM_STRING(const char *fmstring)
    32 {
    33     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
    34     return NULL;
    35 }
    36 #endif
    38 /*
    39 ** PR_OpenAnonFileMap() -- Creates an anonymous file-mapped shared memory
    40 **
    41 */
    42 PR_IMPLEMENT(PRFileMap*)
    43 PR_OpenAnonFileMap(
    44     const char *dirName,
    45     PRSize      size, 
    46     PRFileMapProtect prot
    47 )
    48 {
    49     return(_PR_MD_OPEN_ANON_FILE_MAP( dirName, size, prot ));
    50 } /* end PR_OpenAnonFileMap() */
    52 /*
    53 ** PR_ProcessAttrSetInheritableFileMap() -- Prepare FileMap for export  
    54 **   to my children processes via PR_CreateProcess()
    55 **
    56 **
    57 */
    58 PR_IMPLEMENT( PRStatus) 
    59 PR_ProcessAttrSetInheritableFileMap( 
    60     PRProcessAttr   *attr,
    61     PRFileMap       *fm, 
    62     const char      *shmname
    63 )
    64 {
    65     PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 );
    66     return( PR_FAILURE);
    67 } /* end PR_ProcessAttrSetInheritableFileMap() */ 
    69 /*
    70 ** PR_GetInheritedFileMap() -- Import a PRFileMap previously exported
    71 **   by my parent process via PR_CreateProcess()
    72 **
    73 */
    74 PR_IMPLEMENT( PRFileMap *)
    75 PR_GetInheritedFileMap( 
    76     const char *shmname 
    77 )
    78 {
    79     PRFileMap   *fm = NULL;
    80     PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 );
    81     return( fm );
    82 } /* end PR_GetInhteritedFileMap() */
    84 /*
    85 ** PR_ExportFileMapAsString() -- Creates a string identifying a PRFileMap
    86 **
    87 */
    88 PR_IMPLEMENT( PRStatus )
    89 PR_ExportFileMapAsString( 
    90     PRFileMap *fm,
    91     PRSize    bufSize,
    92     char      *buf
    93 )
    94 {
    95     return( _PR_MD_EXPORT_FILE_MAP_AS_STRING( fm, bufSize, buf ));
    96 } /* end PR_ExportFileMapAsString() */
    98 /*
    99 ** PR_ImportFileMapFromString() -- Creates a PRFileMap from the identifying string
   100 **
   101 **
   102 */
   103 PR_IMPLEMENT( PRFileMap * )
   104 PR_ImportFileMapFromString( 
   105     const char *fmstring
   106 )
   107 {
   108     return( _PR_MD_IMPORT_FILE_MAP_FROM_STRING(fmstring));
   109 } /* end PR_ImportFileMapFromString() */
   110 /* end prshma.c */

mercurial