Apache HTTPD
dso.c
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "apr_arch_dso.h"
18#include "apr_portable.h"
19
20#if APR_HAS_DSO
21
23{
25
26 if (dso->handle > 0 && unload_add_on(dso->handle) < B_NO_ERROR)
27 return APR_EINIT;
28 dso->handle = -1;
29
30 return APR_SUCCESS;
31}
32
34 const char *path, apr_pool_t *pool)
35{
36 image_id newid = -1;
37
39
40 if((newid = load_add_on(path)) < B_NO_ERROR) {
41 (*res_handle)->errormsg = strerror(newid);
42 return APR_EDSOOPEN;
43 }
44
45 (*res_handle)->pool = pool;
46 (*res_handle)->handle = newid;
47
49
50 return APR_SUCCESS;
51}
52
54{
56}
57
59 const char *symname)
60{
61 int err;
62
63 if (symname == NULL)
64 return APR_ESYMNOTFOUND;
65
67 ressym);
68
69 if(err != B_OK)
70 return APR_ESYMNOTFOUND;
71
72 return APR_SUCCESS;
73}
74
76{
78 return buffer;
79}
80
84{
85 *aprdso = apr_pcalloc(pool, sizeof **aprdso);
86 (*aprdso)->handle = osdso;
87 (*aprdso)->pool = pool;
88 return APR_SUCCESS;
89}
90
93{
94 *osdso = aprdso->handle;
95 return APR_SUCCESS;
96}
97
98#endif
APR Portability Routines.
request_rec int int apr_table_t const char * path
#define APR_ESYMNOTFOUND
Definition apr_errno.h:336
#define APR_EINIT
Definition apr_errno.h:474
#define APR_EDSOOPEN
Definition apr_errno.h:322
apr_pool_t const char apr_dbd_t ** handle
Definition apr_dbd.h:142
const void apr_status_t(*) apr_status_t(* APR_DECLARE)(void) apr_pool_pre_cleanup_register(apr_pool_t *p
Definition apr_pools.h:646
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
char * buffer
apr_size_t buflen
#define apr_pcalloc(p, size)
Definition apr_pools.h:465
void * apr_os_dso_handle_t
apr_int32_t apr_int32_t apr_int32_t err
return NULL
Definition mod_so.c:359
static apr_status_t dso_cleanup(void *thedso)
Definition dso.c:41