unixd.h revision 9d129b55f5a43abf43865c6b0eb6dd19bc22aba8
/* Copyright 1999-2005 The Apache Software Foundation or its licensors, as
* applicable.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file unixd.h
* @brief common stuff that unix MPMs will want
*
* @addtogroup APACHE_OS_UNIX
* @{
*/
#ifndef UNIXD_H
#define UNIXD_H
#include "httpd.h"
#include "http_config.h"
#include "ap_listen.h"
#ifdef HAVE_SYS_TIME_H
#endif
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
#include "apr_hooks.h"
#include "apr_thread_proc.h"
#include "apr_proc_mutex.h"
#include "apr_global_mutex.h"
#include <pwd.h>
#include <grp.h>
#ifdef APR_HAVE_SYS_TYPES_H
#endif
#ifdef HAVE_SYS_IPC_H
#endif
typedef struct {
int userdir;
/* Default user name and group name. These may be specified as numbers by
* placing a # before a number */
#ifndef DEFAULT_USER
#define DEFAULT_USER "#-1"
#endif
#ifndef DEFAULT_GROUP
#define DEFAULT_GROUP "#-1"
#endif
typedef struct {
const char *user_name;
int suexec_enabled;
AP_DECLARE(int) unixd_setup_child(void);
const char *arg);
const char *arg);
#if defined(RLIMIT_CPU) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS)
#endif
/**
* One of the functions to set mutex permissions should be called in
* the parent process on platforms that switch identity when the
* server is started as root.
* If the child init logic is performed before switching identity
* (e.g., MPM setup for an accept mutex), it should only be called
* for SysV semaphores. Otherwise, it is safe to call it for all
* mutex types.
*/
#ifdef HAVE_KILLPG
#define unixd_killpg(x, y) (killpg ((x), (y)))
#define ap_os_killpg(x, y) (killpg ((x), (y)))
#else /* HAVE_KILLPG */
#define unixd_killpg(x, y) (kill (-(x), (y)))
#define ap_os_killpg(x, y) (kill (-(x), (y)))
#endif /* HAVE_KILLPG */
#define UNIX_DAEMON_COMMANDS \
"Effective user id for this server"), \
"Effective group id for this server")
#endif
/** @} */