scoreboard.c revision f289872b1e18c01d5cfb7df8afacebbfcdaa99fb
85816edcdb4137f90186cb437949a4dbcbf46ab5jim/* ====================================================================
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * The Apache Software License, Version 1.1
182f52731de370a91a76b08ff73a43d1ea7bb4e8nd * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * reserved.
031b91a62d25106ae69d4693475c79618dd5e884fielding * Redistribution and use in source and binary forms, with or without
031b91a62d25106ae69d4693475c79618dd5e884fielding * modification, are permitted provided that the following conditions
031b91a62d25106ae69d4693475c79618dd5e884fielding * 1. Redistributions of source code must retain the above copyright
031b91a62d25106ae69d4693475c79618dd5e884fielding * notice, this list of conditions and the following disclaimer.
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * 2. Redistributions in binary form must reproduce the above copyright
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * notice, this list of conditions and the following disclaimer in
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * the documentation and/or other materials provided with the
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * distribution.
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * 3. The end-user documentation included with the redistribution,
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * if any, must include the following acknowledgment:
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * "This product includes software developed by the
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * Apache Software Foundation (http://www.apache.org/)."
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * Alternately, this acknowledgment may appear in the software itself,
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * if and wherever such third-party acknowledgments normally appear.
ee5db395bc3723609919edfa96af387eea37c491jim * 4. The names "Apache" and "Apache Software Foundation" must
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * not be used to endorse or promote products derived from this
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * software without prior written permission. For written
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * permission, please contact apache@apache.org.
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * 5. Products derived from this software may not be called "Apache",
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * nor may "Apache" appear in their name, without prior written
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * permission of the Apache Software Foundation.
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
ee5db395bc3723609919edfa96af387eea37c491jim * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
dfa73086d0dbdce20b24181dd127f5dd952367d4sf * SUCH DAMAGE.
dfa73086d0dbdce20b24181dd127f5dd952367d4sf * ====================================================================
dfa73086d0dbdce20b24181dd127f5dd952367d4sf * This software consists of voluntary contributions made by many
dfa73086d0dbdce20b24181dd127f5dd952367d4sf * individuals on behalf of the Apache Software Foundation. For more
dfa73086d0dbdce20b24181dd127f5dd952367d4sf * information on the Apache Software Foundation, please see
dfa73086d0dbdce20b24181dd127f5dd952367d4sf * Portions of this software are based upon public domain software
7087ccb939b4146f850f4d482fd8ab13de6335dchumbedooh * originally written at the National Center for Supercomputing Applications,
85816edcdb4137f90186cb437949a4dbcbf46ab5jim * University of Illinois, Urbana-Champaign.
typedef struct sb_handle {
int child_num;
int thread_num;
} sb_handle;
return APR_SUCCESS;
static void calc_scoreboard_size(void)
static void init_scoreboard(void)
char *more_storage;
for (i = 0; i < server_limit; i++) {
const char *fname;
return rv;
return APR_EGENERAL;
return APR_SUCCESS;
return APR_SUCCESS;
return APR_SUCCESS;
int running_gen = 0;
if (ap_scoreboard_image)
if (rv) {
void ap_sync_scoreboard_image(void)
#ifdef SCOREBOARD_FILE
void update_scoreboard_global(void)
#ifdef SCOREBOARD_FILE
#ifdef HAVE_TIMES
int max_daemons_limit;
for (i = 0; i < max_daemons_limit; ++i)
int old_status, i;
if (child_num < 0)
for (i = 0; i < thread_limit; i++) {
if (ap_extended_status) {
return old_status;
status, r);
if (child_num < 0)
if (((x < 0) || (server_limit < x)) ||
((y < 0) || (thread_limit < y))) {
if ((x < 0) || (server_limit < x)) {