2 * (c) Copyright 1992 by Panagiotis Tsirigotis
3 * (c) Sections Copyright 1998-2001 by Rob Braun
4 * All rights reserved. The file named COPYRIGHT specifies the terms
5 * and conditions for redistribution.
12 * $Id: state.h,v 1.3 2005/03/30 23:15:28 bbraun Exp $
17 #include <sys/types.h>
19 #ifdef HAVE_SYS_RESOURCE_H
20 #include <sys/resource.h>
22 #include "libportable.h"
24 #ifdef HAVE_SYS_SELECT_H
25 #include <sys/select.h>
33 struct read_only_state
35 rlim_t orig_max_descriptors ; /* original soft rlimit */
36 rlim_t max_descriptors ; /* original hard rlimit or OPEN_MAX */
37 rlim_t process_limit ; /* if 0, there is no limit */
38 int cc_interval ; /* # of seconds the cc gets invoked. */
39 const char *pid_file ; /* where the pidfile is located */
40 const char *config_file ;
49 struct service_config *def_settings ;
51 bool_int def_log_creation_failed ;
55 struct read_write_state
57 int descriptors_free ; /* may be negative (reserved) */
58 int available_services ; /* # of available services */
59 int active_services ; /* services with descriptors set */
63 pset_h servers ; /* table of running servers */
64 pset_h retries ; /* table of servers to retry */
65 pset_h services ; /* table of services */
66 struct service *logging ;
67 struct defaults defs ;
70 bool_int env_is_valid ;
78 struct read_only_state ros ;
79 struct read_write_state rws ;
82 #define DEFAULTS( ps ) (ps).rws.defs.def_settings
83 #define DEFAULT_LOG( ps ) (ps).rws.defs.def_log
84 #define DEFAULT_LOG_ERROR( ps ) (ps).rws.defs.def_log_creation_failed
85 #define LOG_SERVICE( ps ) (ps).rws.logging
86 #define SERVICES( ps ) (ps).rws.services
87 #define SERVERS( ps ) (ps).rws.servers
88 #define RETRIES( ps ) (ps).rws.retries