mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-10 19:52:41 +00:00
[core] rename lib apr symbols to fspr
This commit is contained in:
1 parent
3c7e8ff989
commit
5c2726f413
354 files changed
+11614
-11614
No files matched your search
+108
-108
@@ -14,16 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "apr_arch_threadproc.h"
|
||||
#include "apr_strings.h"
|
||||
#include "apr_portable.h"
|
||||
#include "apr_signal.h"
|
||||
#include "apr_random.h"
|
||||
#include "fspr_arch_threadproc.h"
|
||||
#include "fspr_strings.h"
|
||||
#include "fspr_portable.h"
|
||||
#include "fspr_signal.h"
|
||||
#include "fspr_random.h"
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,
|
||||
apr_pool_t *pool)
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_create(fspr_procattr_t **new,
|
||||
fspr_pool_t *pool)
|
||||
{
|
||||
(*new) = (apr_procattr_t *)apr_pcalloc(pool, sizeof(apr_procattr_t));
|
||||
(*new) = (fspr_procattr_t *)fspr_pcalloc(pool, sizeof(fspr_procattr_t));
|
||||
|
||||
if ((*new) == NULL) {
|
||||
return APR_ENOMEM;
|
||||
@@ -34,14 +34,14 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new,
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
|
||||
apr_int32_t in,
|
||||
apr_int32_t out,
|
||||
apr_int32_t err)
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_io_set(fspr_procattr_t *attr,
|
||||
fspr_int32_t in,
|
||||
fspr_int32_t out,
|
||||
fspr_int32_t err)
|
||||
{
|
||||
apr_status_t status;
|
||||
fspr_status_t status;
|
||||
if (in != 0) {
|
||||
if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
|
||||
if ((status = fspr_file_pipe_create(&attr->child_in, &attr->parent_in,
|
||||
attr->pool)) != APR_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
@@ -50,19 +50,19 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
|
||||
case APR_FULL_BLOCK:
|
||||
break;
|
||||
case APR_PARENT_BLOCK:
|
||||
apr_file_pipe_timeout_set(attr->child_in, 0);
|
||||
fspr_file_pipe_timeout_set(attr->child_in, 0);
|
||||
break;
|
||||
case APR_CHILD_BLOCK:
|
||||
apr_file_pipe_timeout_set(attr->parent_in, 0);
|
||||
fspr_file_pipe_timeout_set(attr->parent_in, 0);
|
||||
break;
|
||||
default:
|
||||
apr_file_pipe_timeout_set(attr->child_in, 0);
|
||||
apr_file_pipe_timeout_set(attr->parent_in, 0);
|
||||
fspr_file_pipe_timeout_set(attr->child_in, 0);
|
||||
fspr_file_pipe_timeout_set(attr->parent_in, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (out) {
|
||||
if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
|
||||
if ((status = fspr_file_pipe_create(&attr->parent_out, &attr->child_out,
|
||||
attr->pool)) != APR_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
@@ -71,19 +71,19 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
|
||||
case APR_FULL_BLOCK:
|
||||
break;
|
||||
case APR_PARENT_BLOCK:
|
||||
apr_file_pipe_timeout_set(attr->child_out, 0);
|
||||
fspr_file_pipe_timeout_set(attr->child_out, 0);
|
||||
break;
|
||||
case APR_CHILD_BLOCK:
|
||||
apr_file_pipe_timeout_set(attr->parent_out, 0);
|
||||
fspr_file_pipe_timeout_set(attr->parent_out, 0);
|
||||
break;
|
||||
default:
|
||||
apr_file_pipe_timeout_set(attr->child_out, 0);
|
||||
apr_file_pipe_timeout_set(attr->parent_out, 0);
|
||||
fspr_file_pipe_timeout_set(attr->child_out, 0);
|
||||
fspr_file_pipe_timeout_set(attr->parent_out, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (err) {
|
||||
if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
|
||||
if ((status = fspr_file_pipe_create(&attr->parent_err, &attr->child_err,
|
||||
attr->pool)) != APR_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
@@ -92,14 +92,14 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
|
||||
case APR_FULL_BLOCK:
|
||||
break;
|
||||
case APR_PARENT_BLOCK:
|
||||
apr_file_pipe_timeout_set(attr->child_err, 0);
|
||||
fspr_file_pipe_timeout_set(attr->child_err, 0);
|
||||
break;
|
||||
case APR_CHILD_BLOCK:
|
||||
apr_file_pipe_timeout_set(attr->parent_err, 0);
|
||||
fspr_file_pipe_timeout_set(attr->parent_err, 0);
|
||||
break;
|
||||
default:
|
||||
apr_file_pipe_timeout_set(attr->child_err, 0);
|
||||
apr_file_pipe_timeout_set(attr->parent_err, 0);
|
||||
fspr_file_pipe_timeout_set(attr->child_err, 0);
|
||||
fspr_file_pipe_timeout_set(attr->parent_err, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,67 +107,67 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr,
|
||||
}
|
||||
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr,
|
||||
apr_file_t *child_in,
|
||||
apr_file_t *parent_in)
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_child_in_set(fspr_procattr_t *attr,
|
||||
fspr_file_t *child_in,
|
||||
fspr_file_t *parent_in)
|
||||
{
|
||||
apr_status_t rv = APR_SUCCESS;
|
||||
fspr_status_t rv = APR_SUCCESS;
|
||||
|
||||
if (attr->child_in == NULL && attr->parent_in == NULL)
|
||||
rv = apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
|
||||
rv = fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
|
||||
|
||||
if (child_in != NULL && rv == APR_SUCCESS)
|
||||
rv = apr_file_dup2(attr->child_in, child_in, attr->pool);
|
||||
rv = fspr_file_dup2(attr->child_in, child_in, attr->pool);
|
||||
|
||||
if (parent_in != NULL && rv == APR_SUCCESS)
|
||||
rv = apr_file_dup2(attr->parent_in, parent_in, attr->pool);
|
||||
rv = fspr_file_dup2(attr->parent_in, parent_in, attr->pool);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr,
|
||||
apr_file_t *child_out,
|
||||
apr_file_t *parent_out)
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_child_out_set(fspr_procattr_t *attr,
|
||||
fspr_file_t *child_out,
|
||||
fspr_file_t *parent_out)
|
||||
{
|
||||
apr_status_t rv = APR_SUCCESS;
|
||||
fspr_status_t rv = APR_SUCCESS;
|
||||
|
||||
if (attr->child_out == NULL && attr->parent_out == NULL)
|
||||
rv = apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
|
||||
rv = fspr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
|
||||
|
||||
if (child_out != NULL && rv == APR_SUCCESS)
|
||||
rv = apr_file_dup2(attr->child_out, child_out, attr->pool);
|
||||
rv = fspr_file_dup2(attr->child_out, child_out, attr->pool);
|
||||
|
||||
if (parent_out != NULL && rv == APR_SUCCESS)
|
||||
rv = apr_file_dup2(attr->parent_out, parent_out, attr->pool);
|
||||
rv = fspr_file_dup2(attr->parent_out, parent_out, attr->pool);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr,
|
||||
apr_file_t *child_err,
|
||||
apr_file_t *parent_err)
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_child_err_set(fspr_procattr_t *attr,
|
||||
fspr_file_t *child_err,
|
||||
fspr_file_t *parent_err)
|
||||
{
|
||||
apr_status_t rv = APR_SUCCESS;
|
||||
fspr_status_t rv = APR_SUCCESS;
|
||||
|
||||
if (attr->child_err == NULL && attr->parent_err == NULL)
|
||||
rv = apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
|
||||
rv = fspr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
|
||||
|
||||
if (child_err != NULL && rv == APR_SUCCESS)
|
||||
rv = apr_file_dup2(attr->child_err, child_err, attr->pool);
|
||||
rv = fspr_file_dup2(attr->child_err, child_err, attr->pool);
|
||||
|
||||
if (parent_err != NULL && rv == APR_SUCCESS)
|
||||
rv = apr_file_dup2(attr->parent_err, parent_err, attr->pool);
|
||||
rv = fspr_file_dup2(attr->parent_err, parent_err, attr->pool);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_dir_set(fspr_procattr_t *attr,
|
||||
const char *dir)
|
||||
{
|
||||
attr->currdir = apr_pstrdup(attr->pool, dir);
|
||||
attr->currdir = fspr_pstrdup(attr->pool, dir);
|
||||
if (attr->currdir) {
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
@@ -175,21 +175,21 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
|
||||
return APR_ENOMEM;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr,
|
||||
apr_cmdtype_e cmd)
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_cmdtype_set(fspr_procattr_t *attr,
|
||||
fspr_cmdtype_e cmd)
|
||||
{
|
||||
attr->cmdtype = cmd;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr,
|
||||
apr_int32_t detach)
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_detach_set(fspr_procattr_t *attr,
|
||||
fspr_int32_t detach)
|
||||
{
|
||||
attr->detached = detach;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool)
|
||||
APR_DECLARE(fspr_status_t) fspr_proc_fork(fspr_proc_t *proc, fspr_pool_t *pool)
|
||||
{
|
||||
int pid;
|
||||
|
||||
@@ -202,7 +202,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool)
|
||||
proc->out = NULL;
|
||||
proc->err = NULL;
|
||||
|
||||
apr_random_after_fork(proc);
|
||||
fspr_random_after_fork(proc);
|
||||
|
||||
return APR_INCHILD;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool)
|
||||
return APR_INPARENT;
|
||||
}
|
||||
|
||||
static apr_status_t limit_proc(apr_procattr_t *attr)
|
||||
static fspr_status_t limit_proc(fspr_procattr_t *attr)
|
||||
{
|
||||
#if APR_HAVE_STRUCT_RLIMIT && APR_HAVE_SETRLIMIT
|
||||
#ifdef RLIMIT_CPU
|
||||
@@ -267,35 +267,35 @@ static apr_status_t limit_proc(apr_procattr_t *attr)
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr,
|
||||
apr_child_errfn_t *errfn)
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_child_errfn_set(fspr_procattr_t *attr,
|
||||
fspr_child_errfn_t *errfn)
|
||||
{
|
||||
attr->errfn = errfn;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
|
||||
apr_int32_t chk)
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_error_check_set(fspr_procattr_t *attr,
|
||||
fspr_int32_t chk)
|
||||
{
|
||||
attr->errchk = chk;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
|
||||
apr_int32_t addrspace)
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_addrspace_set(fspr_procattr_t *attr,
|
||||
fspr_int32_t addrspace)
|
||||
{
|
||||
/* won't ever be used on this platform, so don't save the flag */
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr,
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_user_set(fspr_procattr_t *attr,
|
||||
const char *username,
|
||||
const char *password)
|
||||
{
|
||||
apr_status_t rv;
|
||||
apr_gid_t gid;
|
||||
fspr_status_t rv;
|
||||
fspr_gid_t gid;
|
||||
|
||||
if ((rv = apr_uid_get(&attr->uid, &gid, username,
|
||||
if ((rv = fspr_uid_get(&attr->uid, &gid, username,
|
||||
attr->pool)) != APR_SUCCESS) {
|
||||
attr->uid = -1;
|
||||
return rv;
|
||||
@@ -308,22 +308,22 @@ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr,
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr,
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_group_set(fspr_procattr_t *attr,
|
||||
const char *groupname)
|
||||
{
|
||||
apr_status_t rv;
|
||||
fspr_status_t rv;
|
||||
|
||||
if ((rv = apr_gid_get(&attr->gid, groupname, attr->pool)) != APR_SUCCESS)
|
||||
if ((rv = fspr_gid_get(&attr->gid, groupname, attr->pool)) != APR_SUCCESS)
|
||||
attr->gid = -1;
|
||||
return rv;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
|
||||
APR_DECLARE(fspr_status_t) fspr_proc_create(fspr_proc_t *new,
|
||||
const char *progname,
|
||||
const char * const *args,
|
||||
const char * const *env,
|
||||
apr_procattr_t *attr,
|
||||
apr_pool_t *pool)
|
||||
fspr_procattr_t *attr,
|
||||
fspr_pool_t *pool)
|
||||
{
|
||||
int i;
|
||||
const char * const empty_envp[] = {NULL};
|
||||
@@ -385,41 +385,41 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
|
||||
*/
|
||||
|
||||
if (attr->child_in) {
|
||||
apr_pool_cleanup_kill(apr_file_pool_get(attr->child_in),
|
||||
attr->child_in, apr_unix_file_cleanup);
|
||||
fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_in),
|
||||
attr->child_in, fspr_unix_file_cleanup);
|
||||
}
|
||||
|
||||
if (attr->child_out) {
|
||||
apr_pool_cleanup_kill(apr_file_pool_get(attr->child_out),
|
||||
attr->child_out, apr_unix_file_cleanup);
|
||||
fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_out),
|
||||
attr->child_out, fspr_unix_file_cleanup);
|
||||
}
|
||||
|
||||
if (attr->child_err) {
|
||||
apr_pool_cleanup_kill(apr_file_pool_get(attr->child_err),
|
||||
attr->child_err, apr_unix_file_cleanup);
|
||||
fspr_pool_cleanup_kill(fspr_file_pool_get(attr->child_err),
|
||||
attr->child_err, fspr_unix_file_cleanup);
|
||||
}
|
||||
|
||||
apr_pool_cleanup_for_exec();
|
||||
fspr_pool_cleanup_for_exec();
|
||||
|
||||
if (attr->child_in) {
|
||||
apr_file_close(attr->parent_in);
|
||||
fspr_file_close(attr->parent_in);
|
||||
dup2(attr->child_in->filedes, STDIN_FILENO);
|
||||
apr_file_close(attr->child_in);
|
||||
fspr_file_close(attr->child_in);
|
||||
}
|
||||
|
||||
if (attr->child_out) {
|
||||
apr_file_close(attr->parent_out);
|
||||
fspr_file_close(attr->parent_out);
|
||||
dup2(attr->child_out->filedes, STDOUT_FILENO);
|
||||
apr_file_close(attr->child_out);
|
||||
fspr_file_close(attr->child_out);
|
||||
}
|
||||
|
||||
if (attr->child_err) {
|
||||
apr_file_close(attr->parent_err);
|
||||
fspr_file_close(attr->parent_err);
|
||||
dup2(attr->child_err->filedes, STDERR_FILENO);
|
||||
apr_file_close(attr->child_err);
|
||||
fspr_file_close(attr->child_err);
|
||||
}
|
||||
|
||||
apr_signal(SIGCHLD, SIG_DFL); /* not sure if this is needed or not */
|
||||
fspr_signal(SIGCHLD, SIG_DFL); /* not sure if this is needed or not */
|
||||
|
||||
if (attr->currdir != NULL) {
|
||||
if (chdir(attr->currdir) == -1) {
|
||||
@@ -485,7 +485,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
|
||||
{
|
||||
char *ch, *onearg;
|
||||
|
||||
ch = onearg = apr_palloc(pool, onearg_len);
|
||||
ch = onearg = fspr_palloc(pool, onearg_len);
|
||||
i = 0;
|
||||
while (args[i]) {
|
||||
size_t len = strlen(args[i]);
|
||||
@@ -505,7 +505,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
|
||||
newargs[3] = NULL;
|
||||
|
||||
if (attr->detached) {
|
||||
apr_proc_detach(APR_PROC_DETACH_DAEMONIZE);
|
||||
fspr_proc_detach(APR_PROC_DETACH_DAEMONIZE);
|
||||
}
|
||||
|
||||
if (attr->cmdtype == APR_SHELLCMD) {
|
||||
@@ -517,14 +517,14 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
|
||||
}
|
||||
else if (attr->cmdtype == APR_PROGRAM) {
|
||||
if (attr->detached) {
|
||||
apr_proc_detach(APR_PROC_DETACH_DAEMONIZE);
|
||||
fspr_proc_detach(APR_PROC_DETACH_DAEMONIZE);
|
||||
}
|
||||
|
||||
execve(progname, (char * const *)args, (char * const *)env);
|
||||
}
|
||||
else if (attr->cmdtype == APR_PROGRAM_ENV) {
|
||||
if (attr->detached) {
|
||||
apr_proc_detach(APR_PROC_DETACH_DAEMONIZE);
|
||||
fspr_proc_detach(APR_PROC_DETACH_DAEMONIZE);
|
||||
}
|
||||
|
||||
execv(progname, (char * const *)args);
|
||||
@@ -532,7 +532,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
|
||||
else {
|
||||
/* APR_PROGRAM_PATH */
|
||||
if (attr->detached) {
|
||||
apr_proc_detach(APR_PROC_DETACH_DAEMONIZE);
|
||||
fspr_proc_detach(APR_PROC_DETACH_DAEMONIZE);
|
||||
}
|
||||
|
||||
execvp(progname, (char * const *)args);
|
||||
@@ -540,7 +540,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
|
||||
if (attr->errfn) {
|
||||
char *desc;
|
||||
|
||||
desc = apr_psprintf(pool, "exec of '%s' failed",
|
||||
desc = fspr_psprintf(pool, "exec of '%s' failed",
|
||||
progname);
|
||||
attr->errfn(pool, errno, desc);
|
||||
}
|
||||
@@ -551,39 +551,39 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
|
||||
|
||||
/* Parent process */
|
||||
if (attr->child_in) {
|
||||
apr_file_close(attr->child_in);
|
||||
fspr_file_close(attr->child_in);
|
||||
}
|
||||
|
||||
if (attr->child_out) {
|
||||
apr_file_close(attr->child_out);
|
||||
fspr_file_close(attr->child_out);
|
||||
}
|
||||
|
||||
if (attr->child_err) {
|
||||
apr_file_close(attr->child_err);
|
||||
fspr_file_close(attr->child_err);
|
||||
}
|
||||
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
|
||||
APR_DECLARE(fspr_status_t) fspr_proc_wait_all_procs(fspr_proc_t *proc,
|
||||
int *exitcode,
|
||||
apr_exit_why_e *exitwhy,
|
||||
apr_wait_how_e waithow,
|
||||
apr_pool_t *p)
|
||||
fspr_exit_why_e *exitwhy,
|
||||
fspr_wait_how_e waithow,
|
||||
fspr_pool_t *p)
|
||||
{
|
||||
proc->pid = -1;
|
||||
return apr_proc_wait(proc, exitcode, exitwhy, waithow);
|
||||
return fspr_proc_wait(proc, exitcode, exitwhy, waithow);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
|
||||
int *exitcode, apr_exit_why_e *exitwhy,
|
||||
apr_wait_how_e waithow)
|
||||
APR_DECLARE(fspr_status_t) fspr_proc_wait(fspr_proc_t *proc,
|
||||
int *exitcode, fspr_exit_why_e *exitwhy,
|
||||
fspr_wait_how_e waithow)
|
||||
{
|
||||
pid_t pstatus;
|
||||
int waitpid_options = WUNTRACED;
|
||||
int exit_int;
|
||||
int ignore;
|
||||
apr_exit_why_e ignorewhy;
|
||||
fspr_exit_why_e ignorewhy;
|
||||
|
||||
if (exitcode == NULL) {
|
||||
exitcode = &ignore;
|
||||
@@ -633,8 +633,8 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
|
||||
return errno;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr,
|
||||
apr_int32_t what,
|
||||
APR_DECLARE(fspr_status_t) fspr_procattr_limit_set(fspr_procattr_t *attr,
|
||||
fspr_int32_t what,
|
||||
struct rlimit *limit)
|
||||
{
|
||||
switch(what) {
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "apr_arch_threadproc.h"
|
||||
#include "fspr_arch_threadproc.h"
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize)
|
||||
APR_DECLARE(fspr_status_t) fspr_proc_detach(int daemonize)
|
||||
{
|
||||
int x;
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
*/
|
||||
|
||||
#define INCL_DOSEXCEPTIONS /* for OS2 */
|
||||
#include "apr_arch_threadproc.h"
|
||||
#include "apr_private.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_signal.h"
|
||||
#include "apr_strings.h"
|
||||
#include "fspr_arch_threadproc.h"
|
||||
#include "fspr_private.h"
|
||||
#include "fspr_pools.h"
|
||||
#include "fspr_signal.h"
|
||||
#include "fspr_strings.h"
|
||||
|
||||
#include <assert.h>
|
||||
#if APR_HAS_THREADS && APR_HAVE_PTHREAD_H
|
||||
@@ -27,12 +27,12 @@
|
||||
#endif
|
||||
|
||||
#ifdef SIGWAIT_TAKES_ONE_ARG
|
||||
#define apr_sigwait(a,b) ((*(b)=sigwait((a)))<0?-1:0)
|
||||
#define fspr_sigwait(a,b) ((*(b)=sigwait((a)))<0?-1:0)
|
||||
#else
|
||||
#define apr_sigwait(a,b) sigwait((a),(b))
|
||||
#define fspr_sigwait(a,b) sigwait((a),(b))
|
||||
#endif
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum)
|
||||
APR_DECLARE(fspr_status_t) fspr_proc_kill(fspr_proc_t *proc, int signum)
|
||||
{
|
||||
#ifdef OS2
|
||||
/* SIGTERM's don't work too well in OS/2 (only affects other EMX
|
||||
@@ -71,7 +71,7 @@ static void avoid_zombies(int signo)
|
||||
* from W. Richard Stevens' "Advanced Programming in the UNIX Environment"
|
||||
* (the version that does not automatically restart system calls).
|
||||
*/
|
||||
APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func)
|
||||
APR_DECLARE(fspr_sigfunc_t *) fspr_signal(int signo, fspr_sigfunc_t * func)
|
||||
{
|
||||
struct sigaction act, oact;
|
||||
|
||||
@@ -111,10 +111,10 @@ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func)
|
||||
* on the version of autoconf used. */
|
||||
#if defined(SYS_SIGLIST_DECLARED) || HAVE_DECL_SYS_SIGLIST
|
||||
|
||||
void apr_signal_init(apr_pool_t *pglobal)
|
||||
void fspr_signal_init(fspr_pool_t *pglobal)
|
||||
{
|
||||
}
|
||||
const char *apr_signal_description_get(int signum)
|
||||
const char *fspr_signal_description_get(int signum)
|
||||
{
|
||||
return sys_siglist[signum];
|
||||
}
|
||||
@@ -145,7 +145,7 @@ static const char *signal_description[APR_NUMSIG];
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
void apr_signal_init(apr_pool_t *pglobal)
|
||||
void fspr_signal_init(fspr_pool_t *pglobal)
|
||||
{
|
||||
int sig;
|
||||
|
||||
@@ -256,10 +256,10 @@ void apr_signal_init(apr_pool_t *pglobal)
|
||||
|
||||
for (sig = 0; sig < APR_NUMSIG; ++sig)
|
||||
if (signal_description[sig] == NULL)
|
||||
signal_description[sig] = apr_psprintf(pglobal, "signal #%d", sig);
|
||||
signal_description[sig] = fspr_psprintf(pglobal, "signal #%d", sig);
|
||||
}
|
||||
|
||||
const char *apr_signal_description_get(int signum)
|
||||
const char *fspr_signal_description_get(int signum)
|
||||
{
|
||||
return
|
||||
signum < APR_NUMSIG
|
||||
@@ -316,7 +316,7 @@ static void remove_sync_sigs(sigset_t *sig_mask)
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum))
|
||||
APR_DECLARE(fspr_status_t) fspr_signal_thread(int(*signal_handler)(int signum))
|
||||
{
|
||||
sigset_t sig_mask;
|
||||
#if APR_HAVE_SIGWAIT
|
||||
@@ -380,7 +380,7 @@ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum))
|
||||
#if APR_HAVE_SIGWAIT
|
||||
int signal_received;
|
||||
|
||||
if (apr_sigwait(&sig_mask, &signal_received) != 0)
|
||||
if (fspr_sigwait(&sig_mask, &signal_received) != 0)
|
||||
{
|
||||
/* handle sigwait() error here */
|
||||
}
|
||||
@@ -391,12 +391,12 @@ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum))
|
||||
#elif HAVE_SIGSUSPEND
|
||||
sigsuspend(&sig_mask);
|
||||
#else
|
||||
#error No apr_sigwait() and no sigsuspend()
|
||||
#error No fspr_sigwait() and no sigsuspend()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_setup_signal_thread(void)
|
||||
APR_DECLARE(fspr_status_t) fspr_setup_signal_thread(void)
|
||||
{
|
||||
sigset_t sig_mask;
|
||||
int rv;
|
||||
@@ -432,7 +432,7 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void)
|
||||
|
||||
#endif /* APR_HAS_THREADS && ... */
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_signal_block(int signum)
|
||||
APR_DECLARE(fspr_status_t) fspr_signal_block(int signum)
|
||||
{
|
||||
#if APR_HAVE_SIGACTION
|
||||
sigset_t sig_mask;
|
||||
@@ -459,7 +459,7 @@ APR_DECLARE(apr_status_t) apr_signal_block(int signum)
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_signal_unblock(int signum)
|
||||
APR_DECLARE(fspr_status_t) fspr_signal_unblock(int signum)
|
||||
{
|
||||
#if APR_HAVE_SIGACTION
|
||||
sigset_t sig_mask;
|
||||
|
||||
@@ -14,19 +14,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_portable.h"
|
||||
#include "apr_arch_threadproc.h"
|
||||
#include "fspr.h"
|
||||
#include "fspr_portable.h"
|
||||
#include "fspr_arch_threadproc.h"
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
|
||||
#if APR_HAVE_PTHREAD_H
|
||||
|
||||
/* Destroy the threadattr object */
|
||||
static apr_status_t threadattr_cleanup(void *data)
|
||||
static fspr_status_t threadattr_cleanup(void *data)
|
||||
{
|
||||
apr_threadattr_t *attr = data;
|
||||
apr_status_t rv;
|
||||
fspr_threadattr_t *attr = data;
|
||||
fspr_status_t rv;
|
||||
|
||||
rv = pthread_attr_destroy(&attr->attr);
|
||||
#ifdef PTHREAD_SETS_ERRNO
|
||||
@@ -37,18 +37,18 @@ static apr_status_t threadattr_cleanup(void *data)
|
||||
return rv;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new,
|
||||
apr_pool_t *pool)
|
||||
APR_DECLARE(fspr_status_t) fspr_threadattr_create(fspr_threadattr_t **new,
|
||||
fspr_pool_t *pool)
|
||||
{
|
||||
apr_status_t stat;
|
||||
fspr_status_t stat;
|
||||
|
||||
(*new) = apr_palloc(pool, sizeof(apr_threadattr_t));
|
||||
(*new) = fspr_palloc(pool, sizeof(fspr_threadattr_t));
|
||||
(*new)->pool = pool;
|
||||
stat = pthread_attr_init(&(*new)->attr);
|
||||
|
||||
if (stat == 0) {
|
||||
apr_pool_cleanup_register(pool, *new, threadattr_cleanup,
|
||||
apr_pool_cleanup_null);
|
||||
fspr_pool_cleanup_register(pool, *new, threadattr_cleanup,
|
||||
fspr_pool_cleanup_null);
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
#ifdef PTHREAD_SETS_ERRNO
|
||||
@@ -60,10 +60,10 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new,
|
||||
|
||||
#define DETACH_ARG(v) ((v) ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE)
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr,
|
||||
apr_int32_t on)
|
||||
APR_DECLARE(fspr_status_t) fspr_threadattr_detach_set(fspr_threadattr_t *attr,
|
||||
fspr_int32_t on)
|
||||
{
|
||||
apr_status_t stat;
|
||||
fspr_status_t stat;
|
||||
#ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR
|
||||
int arg = DETACH_ARG(v);
|
||||
|
||||
@@ -83,7 +83,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr,
|
||||
}
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr)
|
||||
APR_DECLARE(fspr_status_t) fspr_threadattr_detach_get(fspr_threadattr_t *attr)
|
||||
{
|
||||
int state;
|
||||
|
||||
@@ -97,8 +97,8 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr)
|
||||
return APR_NOTDETACH;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
|
||||
apr_size_t stacksize)
|
||||
APR_DECLARE(fspr_status_t) fspr_threadattr_stacksize_set(fspr_threadattr_t *attr,
|
||||
fspr_size_t stacksize)
|
||||
{
|
||||
int stat;
|
||||
|
||||
@@ -113,11 +113,11 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
|
||||
return stat;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
|
||||
apr_size_t size)
|
||||
APR_DECLARE(fspr_status_t) fspr_threadattr_guardsize_set(fspr_threadattr_t *attr,
|
||||
fspr_size_t size)
|
||||
{
|
||||
#ifdef HAVE_PTHREAD_ATTR_SETGUARDSIZE
|
||||
apr_status_t rv;
|
||||
fspr_status_t rv;
|
||||
|
||||
rv = pthread_attr_setguardsize(&attr->attr, size);
|
||||
if (rv == 0) {
|
||||
@@ -134,7 +134,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
|
||||
|
||||
static void *dummy_worker(void *opaque)
|
||||
{
|
||||
apr_thread_t *thread = (apr_thread_t*)opaque;
|
||||
fspr_thread_t *thread = (fspr_thread_t*)opaque;
|
||||
|
||||
#ifdef HAVE_PTHREAD_SETSCHEDPARAM
|
||||
if (thread->priority) {
|
||||
@@ -151,23 +151,23 @@ static void *dummy_worker(void *opaque)
|
||||
return thread->func(thread, thread->data);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
|
||||
apr_threadattr_t *attr,
|
||||
apr_thread_start_t func,
|
||||
APR_DECLARE(fspr_status_t) fspr_thread_create(fspr_thread_t **new,
|
||||
fspr_threadattr_t *attr,
|
||||
fspr_thread_start_t func,
|
||||
void *data,
|
||||
apr_pool_t *pool)
|
||||
fspr_pool_t *pool)
|
||||
{
|
||||
apr_status_t stat;
|
||||
fspr_status_t stat;
|
||||
pthread_attr_t *temp;
|
||||
pthread_t tt;
|
||||
|
||||
(*new) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t));
|
||||
(*new) = (fspr_thread_t *)fspr_pcalloc(pool, sizeof(fspr_thread_t));
|
||||
|
||||
if ((*new) == NULL) {
|
||||
return APR_ENOMEM;
|
||||
}
|
||||
|
||||
(*new)->td = (pthread_t *)apr_pcalloc(pool, sizeof(pthread_t));
|
||||
(*new)->td = (pthread_t *)fspr_pcalloc(pool, sizeof(pthread_t));
|
||||
|
||||
if ((*new)->td == NULL) {
|
||||
return APR_ENOMEM;
|
||||
@@ -182,7 +182,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
|
||||
else
|
||||
temp = NULL;
|
||||
|
||||
stat = apr_pool_create(&(*new)->pool, pool);
|
||||
stat = fspr_pool_create(&(*new)->pool, pool);
|
||||
if (stat != APR_SUCCESS) {
|
||||
return stat;
|
||||
}
|
||||
@@ -205,31 +205,31 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
|
||||
}
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void)
|
||||
APR_DECLARE(fspr_os_thread_t) fspr_os_thread_current(void)
|
||||
{
|
||||
return pthread_self();
|
||||
}
|
||||
|
||||
APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1,
|
||||
apr_os_thread_t tid2)
|
||||
APR_DECLARE(int) fspr_os_thread_equal(fspr_os_thread_t tid1,
|
||||
fspr_os_thread_t tid2)
|
||||
{
|
||||
return pthread_equal(tid1, tid2);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd,
|
||||
apr_status_t retval)
|
||||
APR_DECLARE(fspr_status_t) fspr_thread_exit(fspr_thread_t *thd,
|
||||
fspr_status_t retval)
|
||||
{
|
||||
thd->exitval = retval;
|
||||
apr_pool_destroy(thd->pool);
|
||||
fspr_pool_destroy(thd->pool);
|
||||
pthread_exit(NULL);
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval,
|
||||
apr_thread_t *thd)
|
||||
APR_DECLARE(fspr_status_t) fspr_thread_join(fspr_status_t *retval,
|
||||
fspr_thread_t *thd)
|
||||
{
|
||||
apr_status_t stat;
|
||||
apr_status_t *thread_stat;
|
||||
fspr_status_t stat;
|
||||
fspr_status_t *thread_stat;
|
||||
|
||||
if ((stat = pthread_join(*thd->td,(void *)&thread_stat)) == 0) {
|
||||
*retval = thd->exitval;
|
||||
@@ -244,9 +244,9 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval,
|
||||
}
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)
|
||||
APR_DECLARE(fspr_status_t) fspr_thread_detach(fspr_thread_t *thd)
|
||||
{
|
||||
apr_status_t stat;
|
||||
fspr_status_t stat;
|
||||
|
||||
#ifdef PTHREAD_DETACH_ARG1_ADDR
|
||||
if ((stat = pthread_detach(thd->td)) == 0) {
|
||||
@@ -265,40 +265,40 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)
|
||||
}
|
||||
}
|
||||
|
||||
void apr_thread_yield()
|
||||
void fspr_thread_yield()
|
||||
{
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key,
|
||||
apr_thread_t *thread)
|
||||
APR_DECLARE(fspr_status_t) fspr_thread_data_get(void **data, const char *key,
|
||||
fspr_thread_t *thread)
|
||||
{
|
||||
return apr_pool_userdata_get(data, key, thread->pool);
|
||||
return fspr_pool_userdata_get(data, key, thread->pool);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key,
|
||||
apr_status_t (*cleanup)(void *),
|
||||
apr_thread_t *thread)
|
||||
APR_DECLARE(fspr_status_t) fspr_thread_data_set(void *data, const char *key,
|
||||
fspr_status_t (*cleanup)(void *),
|
||||
fspr_thread_t *thread)
|
||||
{
|
||||
return apr_pool_userdata_set(data, key, cleanup, thread->pool);
|
||||
return fspr_pool_userdata_set(data, key, cleanup, thread->pool);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd,
|
||||
apr_thread_t *thd)
|
||||
APR_DECLARE(fspr_status_t) fspr_os_thread_get(fspr_os_thread_t **thethd,
|
||||
fspr_thread_t *thd)
|
||||
{
|
||||
*thethd = thd->td;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd,
|
||||
apr_os_thread_t *thethd,
|
||||
apr_pool_t *pool)
|
||||
APR_DECLARE(fspr_status_t) fspr_os_thread_put(fspr_thread_t **thd,
|
||||
fspr_os_thread_t *thethd,
|
||||
fspr_pool_t *pool)
|
||||
{
|
||||
if (pool == NULL) {
|
||||
return APR_ENOPOOL;
|
||||
}
|
||||
|
||||
if ((*thd) == NULL) {
|
||||
(*thd) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t));
|
||||
(*thd) = (fspr_thread_t *)fspr_pcalloc(pool, sizeof(fspr_thread_t));
|
||||
(*thd)->pool = pool;
|
||||
}
|
||||
|
||||
@@ -306,17 +306,17 @@ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd,
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control,
|
||||
apr_pool_t *p)
|
||||
APR_DECLARE(fspr_status_t) fspr_thread_once_init(fspr_thread_once_t **control,
|
||||
fspr_pool_t *p)
|
||||
{
|
||||
static const pthread_once_t once_init = PTHREAD_ONCE_INIT;
|
||||
|
||||
*control = apr_palloc(p, sizeof(**control));
|
||||
*control = fspr_palloc(p, sizeof(**control));
|
||||
(*control)->once = once_init;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control,
|
||||
APR_DECLARE(fspr_status_t) fspr_thread_once(fspr_thread_once_t *control,
|
||||
void (*func)(void))
|
||||
{
|
||||
return pthread_once(&control->once, func);
|
||||
@@ -330,9 +330,9 @@ APR_POOL_IMPLEMENT_ACCESSOR(thread)
|
||||
#if !APR_HAS_THREADS
|
||||
|
||||
/* avoid warning for no prototype */
|
||||
APR_DECLARE(apr_status_t) apr_os_thread_get(void);
|
||||
APR_DECLARE(fspr_status_t) fspr_os_thread_get(void);
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_os_thread_get(void)
|
||||
APR_DECLARE(fspr_status_t) fspr_os_thread_get(void)
|
||||
{
|
||||
return APR_ENOTIMPL;
|
||||
}
|
||||
|
||||
@@ -14,18 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_portable.h"
|
||||
#include "apr_arch_threadproc.h"
|
||||
#include "fspr.h"
|
||||
#include "fspr_portable.h"
|
||||
#include "fspr_arch_threadproc.h"
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
|
||||
#if APR_HAVE_PTHREAD_H
|
||||
APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key,
|
||||
APR_DECLARE(fspr_status_t) fspr_threadkey_private_create(fspr_threadkey_t **key,
|
||||
void (*dest)(void *),
|
||||
apr_pool_t *pool)
|
||||
fspr_pool_t *pool)
|
||||
{
|
||||
(*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t));
|
||||
(*key) = (fspr_threadkey_t *)fspr_pcalloc(pool, sizeof(fspr_threadkey_t));
|
||||
|
||||
if ((*key) == NULL) {
|
||||
return APR_ENOMEM;
|
||||
@@ -37,8 +37,8 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key,
|
||||
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new,
|
||||
apr_threadkey_t *key)
|
||||
APR_DECLARE(fspr_status_t) fspr_threadkey_private_get(void **new,
|
||||
fspr_threadkey_t *key)
|
||||
{
|
||||
#ifdef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS
|
||||
if (pthread_getspecific(key->key,new))
|
||||
@@ -49,10 +49,10 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new,
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv,
|
||||
apr_threadkey_t *key)
|
||||
APR_DECLARE(fspr_status_t) fspr_threadkey_private_set(void *priv,
|
||||
fspr_threadkey_t *key)
|
||||
{
|
||||
apr_status_t stat;
|
||||
fspr_status_t stat;
|
||||
|
||||
if ((stat = pthread_setspecific(key->key, priv)) == 0) {
|
||||
return APR_SUCCESS;
|
||||
@@ -62,10 +62,10 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv,
|
||||
}
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key)
|
||||
APR_DECLARE(fspr_status_t) fspr_threadkey_private_delete(fspr_threadkey_t *key)
|
||||
{
|
||||
#ifdef HAVE_PTHREAD_KEY_DELETE
|
||||
apr_status_t stat;
|
||||
fspr_status_t stat;
|
||||
|
||||
if ((stat = pthread_key_delete(key->key)) == 0) {
|
||||
return APR_SUCCESS;
|
||||
@@ -77,36 +77,36 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key)
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key,
|
||||
apr_threadkey_t *threadkey)
|
||||
APR_DECLARE(fspr_status_t) fspr_threadkey_data_get(void **data, const char *key,
|
||||
fspr_threadkey_t *threadkey)
|
||||
{
|
||||
return apr_pool_userdata_get(data, key, threadkey->pool);
|
||||
return fspr_pool_userdata_get(data, key, threadkey->pool);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key,
|
||||
apr_status_t (*cleanup)(void *),
|
||||
apr_threadkey_t *threadkey)
|
||||
APR_DECLARE(fspr_status_t) fspr_threadkey_data_set(void *data, const char *key,
|
||||
fspr_status_t (*cleanup)(void *),
|
||||
fspr_threadkey_t *threadkey)
|
||||
{
|
||||
return apr_pool_userdata_set(data, key, cleanup, threadkey->pool);
|
||||
return fspr_pool_userdata_set(data, key, cleanup, threadkey->pool);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey,
|
||||
apr_threadkey_t *key)
|
||||
APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(fspr_os_threadkey_t *thekey,
|
||||
fspr_threadkey_t *key)
|
||||
{
|
||||
*thekey = key->key;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key,
|
||||
apr_os_threadkey_t *thekey,
|
||||
apr_pool_t *pool)
|
||||
APR_DECLARE(fspr_status_t) fspr_os_threadkey_put(fspr_threadkey_t **key,
|
||||
fspr_os_threadkey_t *thekey,
|
||||
fspr_pool_t *pool)
|
||||
{
|
||||
if (pool == NULL) {
|
||||
return APR_ENOPOOL;
|
||||
}
|
||||
|
||||
if ((*key) == NULL) {
|
||||
(*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t));
|
||||
(*key) = (fspr_threadkey_t *)fspr_pcalloc(pool, sizeof(fspr_threadkey_t));
|
||||
(*key)->pool = pool;
|
||||
}
|
||||
|
||||
@@ -119,9 +119,9 @@ APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key,
|
||||
#if !APR_HAS_THREADS
|
||||
|
||||
/* avoid warning for no prototype */
|
||||
APR_DECLARE(apr_status_t) apr_os_threadkey_get(void);
|
||||
APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(void);
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_os_threadkey_get(void)
|
||||
APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(void)
|
||||
{
|
||||
return APR_ENOTIMPL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user