/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
void _STUB_vmmapopen(){}
#else
#include "vmhdr.h"
#include <string.h>
#if _hdr_unistd
#include <unistd.h>
#endif
#include <fcntl.h>
/* Create a region to allocate based on mmap() or shmget().
** Both ways provide for share memory allocation.
** mmap() also allows for allocating persistent data.
**
** Written by Kiem-Phong Vo (kpv@research.att.com)
*/
/* magic word signaling region is being initialized */
/* default mimimum region size */
/* macros to get the data section and size */
#ifdef S_IRUSR
#else
#endif
struct _mmuser_s
};
typedef struct _mmvm_s
} Mmvm_t;
typedef struct _mmdisc_s
} Mmdisc_t;
#if DEBUG
#include <stdio.h>
#include <string.h>
{
return 0;
}
#endif /*DEBUG*/
/* fix the mapped address for a region */
{
}
else
}
}
return mmvm;
}
/* initialize region data */
{
int try, k;
return 0;
/* fixed size region so make it reasonably large */
size = MM_MINSIZE;
/* this op can happen simultaneously in different processes */
return -1;
{ /* Note that the location being written to is always zero! */
goto done;
goto done;
/* map the file into memory */
}
else
goto done;
goto done;
/* map the data segment into memory */
}
goto done;
/* all processes compete for the chore to initialize data */
goto done;
rv = 0; /* success, return this value to indicate a new map */
}
else /* wait for someone else to finish initialization */
goto done;
break;
goto done;
}
/* mapped the wrong memory */
goto done;
goto done;
}
if(rv >= 0 ) /* successful construction of region */
}
}
return rv;
}
#if __STD_C /* end a file mapping */
#else
#endif
{
return 0;
}
}
else
}
}
}
return 0;
}
#if __STD_C
#else
#endif
{
/* this region allows only a single busy block! */
}
}
else /* requesting a new block */
}
}
}
#if __STD_C
#else
int type;
#endif
{
int rv;
{ if(data) /* VM_OPEN event at start of vmopen() */
return -1;
else if(rv == 0) /* just started a new map */
return 0;
}
else /* an existing map was reconstructed */
return 1;
}
}
else return 0;
}
return 0;
}
return 1; /* tell vmclose not to free memory segments */
return 0; /* all done */
}
else return 0;
}
#if __STD_C
#else
char* file; /* file for key or data backing */
int proj; /* project ID, < 0 doing mmap */
#endif
{
/* create discipline structure for getting memory from mmap */
/* now open the Vmalloc_t handle to return to application */
}
else
return vm;
}
}
/* to store (key,value) data in the map */
#if __STD_C
#else
int key; /* key of data to be set */
int oper; /* operation type */
#endif
{
Mmuser_t *u;
/* check to see if operation is well-defined */
/* find the key */
break;
}
}
if(u) /* update data and set value to return */
}
return val;
}
{
if(type > 0)
}
/* suggest an address usable for mapping memory */
{
#else
else if(_map_dir > 0)
}
else
}
return avail;
#endif
}
#endif