summaryrefslogtreecommitdiff
path: root/shmem/os2
diff options
context:
space:
mode:
authorAaron Bannert <aaron@apache.org>2002-01-10 00:20:06 +0000
committerAaron Bannert <aaron@apache.org>2002-01-10 00:20:06 +0000
commit6e28554106719c499198bda6294622ab8bf87749 (patch)
tree87f1f5d12c47ba1dfc46993a40ab8fecfa733b30 /shmem/os2
parent9a94baa54e3710875163b1412eca9bf3956aa1ac (diff)
downloadapr-6e28554106719c499198bda6294622ab8bf87749.tar.gz
This is the new apr_shm_t API. It completely replaces the old shared
memory API, which was unusable on Win32 and other platforms that do not have inherited shared memory segments since it only supported anonymous memory. We now support both anonymous and name-based shared memory. Anonymous shmem tested to work on the following platforms: Linux 2.2, Linux 2.4, Solaris 8, FreeBSD 5.0-CURRENT Name-based shmem is _not_ fully functional on UNIX, but this API replaces all of the preexisting apr_shmem_t functionality. Stubs were provided for Beos and OS/2, and as much relevant code as possible was preserved, but no guarantees of correctness. Reviewed by: Justin Erenkrantz, Will Rowe git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62735 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'shmem/os2')
-rw-r--r--shmem/os2/shm.c (renamed from shmem/os2/shmem.c)64
1 files changed, 11 insertions, 53 deletions
diff --git a/shmem/os2/shmem.c b/shmem/os2/shm.c
index 009b5a968..9adf40358 100644
--- a/shmem/os2/shmem.c
+++ b/shmem/os2/shm.c
@@ -65,9 +65,7 @@ struct apr_shmem_t {
Heap_t heap;
};
-
-
-APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *filename, apr_pool_t *cont)
{
int rc;
apr_shmem_t *newm = (apr_shmem_t *)apr_palloc(cont, sizeof(apr_shmem_t));
@@ -92,8 +90,6 @@ APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, cons
return APR_SUCCESS;
}
-
-
APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m)
{
_uclose(m->heap);
@@ -102,62 +98,24 @@ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m)
return APR_SUCCESS;
}
-
-
-APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *m, apr_size_t reqsize)
-{
- return _umalloc(m->heap, reqsize);
-}
-
-
-
-APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *m, apr_size_t size)
+APR_DECLARE(apr_status_t) apr_shm_attach(apr_shmem_t **m,
+ const char *filename,
+ apr_pool_t *pool)
{
- return _ucalloc(m->heap, size, 1);
-}
-
-
-
-APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *m, void *entity)
-{
- free(entity);
- return APR_SUCCESS;
-}
-
-
-
-APR_DECLARE(apr_status_t) apr_shm_name_get(apr_shmem_t *c, apr_shm_name_t **name)
-{
- *name = NULL;
- return APR_ANONYMOUS;
+ return APR_ENOTIMPL;
}
-
-
-APR_DECLARE(apr_status_t) apr_shm_name_set(apr_shmem_t *c, apr_shm_name_t *name)
+APR_DECLARE(apr_status_t) apr_shm_detach(apr_shmem_t *m)
{
- return APR_ANONYMOUS;
+ return APR_ENOTIMPL;
}
-
-
-APR_DECLARE(apr_status_t) apr_shm_open(apr_shmem_t *m)
+APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m)
{
- int rc;
-
- rc = DosGetSharedMem(m->memblock, PAG_READ|PAG_WRITE);
-
- if (rc)
- return APR_OS2_STATUS(rc);
-
- _uopen(m->heap);
- return APR_SUCCESS;
+ return APR_ENOTIMPL;
}
-
-
-APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *c, apr_size_t *size)
+APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m)
{
-
return APR_ENOTIMPL;
-}
+