os.h revision 540bbdd4d087610fc0563f0dc3aab2fc5defbad9
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* ====================================================================
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Redistribution and use in source and binary forms, with or without
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * modification, are permitted provided that the following conditions
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * are met:
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * 1. Redistributions of source code must retain the above copyright
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * notice, this list of conditions and the following disclaimer.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * 2. Redistributions in binary form must reproduce the above copyright
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * notice, this list of conditions and the following disclaimer in
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * the documentation and/or other materials provided with the
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * distribution.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * 3. All advertising materials mentioning features or use of this
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * software must display the following acknowledgment:
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * "This product includes software developed by the Apache Group
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * for use in the Apache HTTP server project (http://www.apache.org/)."
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * 4. The names "Apache Server" and "Apache Group" must not be used to
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * endorse or promote products derived from this software without
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * prior written permission. For written permission, please contact
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * apache@apache.org.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * 5. Products derived from this software may not be called "Apache"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * nor may "Apache" appear in their names without prior written
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * permission of the Apache Group.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * 6. Redistributions of any form whatsoever must retain the following
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * acknowledgment:
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * "This product includes software developed by the Apache Group
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * for use in the Apache HTTP server project (http://www.apache.org/)."
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * OF THE POSSIBILITY OF SUCH DAMAGE.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * ====================================================================
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * This software consists of voluntary contributions made by many
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * individuals on behalf of the Apache Group and was originally based
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * on public domain software written at the National Center for
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Supercomputing Applications, University of Illinois, Urbana-Champaign.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * For more information on the Apache Group and the Apache HTTP server
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * project, please see <http://www.apache.org/>.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding *
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#ifndef APACHE_OS_H
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define APACHE_OS_H
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/*
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * Compile the server including all the Windows NT 4.0 header files by
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * default. We still want the server to run on Win95/98 so use
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * runtime checks before calling NT specific functions to verify we are
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * really running on an NT system.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define _WIN32_WINNT 0x0400
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include "apr_general.h"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include <windows.h>
51af95bb51b5084e883bad250b2afa2838e9ceebfielding#include <winsock2.h>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include <mswsock.h>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include <process.h>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include <malloc.h>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include <io.h>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include <fcntl.h>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define PLATFORM "Win32"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/*
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * This file in included in all Apache source code. It contains definitions
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * of facilities available on _this_ operating system (HAVE_* macros),
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * and prototypes of OS specific functions defined in os.c
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* temporarily replace crypt */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* char *crypt(const char *pw, const char *salt); */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define crypt(buf,salt) (buf)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* Although DIR_TYPE is dirent (see nt/readdir.h) we need direct.h for
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding chdir() */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include <direct.h>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define STATUS
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#ifndef STRICT
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define STRICT
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#endif
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define CASE_BLIND_FILESYSTEM
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define NO_WRITEV
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define NO_USE_SIGACTION
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* #undef HAVE_TIMES */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* #undef HAVE_GETTIMEOFDAY */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define USE_LONGJMP
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define HAVE_MMAP
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define USE_MMAP_SCOREBOARD
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define MULTITHREAD
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define HAVE_CANONICAL_FILENAME
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define HAVE_DRIVE_LETTERS
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define HAVE_SENDFILE
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtypedef int uid_t;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtypedef int gid_t;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtypedef int pid_t;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtypedef int mode_t;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtypedef char * caddr_t;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/*
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingDefine export types. API_EXPORT_NONSTD is a nasty hack to avoid having to declare
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingevery configuration function as __stdcall.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding*/
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#if 0 /* Handled by APR... */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#ifdef SHARED_MODULE
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# define API_VAR_EXPORT __declspec(dllimport)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# define API_EXPORT(type) __declspec(dllimport) type __stdcall
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# define API_EXPORT_NONSTD(type) __declspec(dllimport) type
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#else
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# define API_VAR_EXPORT __declspec(dllexport)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# define API_EXPORT(type) __declspec(dllexport) type __stdcall
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding# define API_EXPORT_NONSTD(type) __declspec(dllexport) type
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#endif
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#endif
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define MODULE_VAR_EXPORT __declspec(dllexport)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define strcasecmp(s1, s2) stricmp(s1, s2)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define lstat(x, y) stat(x, y)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define S_ISLNK(m) (0)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define S_ISREG(m) ((m & _S_IFREG) == _S_IFREG)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#ifndef S_ISDIR
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define S_ISDIR(m) (((m) & S_IFDIR) == S_IFDIR)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#endif
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#if 0
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#ifndef S_ISREG
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define S_ISREG(m) (((m)&(S_IFREG)) == (S_IFREG))
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#endif
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#endif
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define STDIN_FILENO 0
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define STDOUT_FILENO 1
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define STDERR_FILENO 2
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define JMP_BUF jmp_buf
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define O_CREAT _O_CREAT
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define O_RDWR _O_RDWR
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* Seems Windows is not a subgenius */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define NO_SLACK
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#include <stddef.h>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding__inline int ap_os_is_path_absolute(const char *file)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding{
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding /* For now, just do the same check that http_request.c and mod_alias.c
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * do.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding return file[0] == '/' || file[1] == ':';
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding}
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define _spawnv(mode,cmdname,argv) os_spawnv(mode,cmdname,argv)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define spawnv(mode,cmdname,argv) os_spawnv(mode,cmdname,argv)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define _spawnve(mode,cmdname,argv,envp) os_spawnve(mode,cmdname,argv,envp)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define spawnve(mode,cmdname,argv,envp) os_spawnve(mode,cmdname,argv,envp)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define _spawnle os_spawnle
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define spawnle os_spawnle
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* OS-dependent filename routines in util_win32.c */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingAPI_EXPORT(char *) ap_os_canonical_filename(ap_context_t *p, const char *file);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingAPI_EXPORT(char *) ap_os_case_canonical_filename(ap_context_t *pPool, const char *szFile);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingAPI_EXPORT(char *) ap_os_systemcase_filename(ap_context_t *pPool, const char *szFile);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingint ap_os_is_filename_valid(const char *file);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingint os_strftime(char *, size_t , const char *, const struct tm *);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* Abstractions for dealing with shared object files (DLLs on Win32).
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding * These are used by mod_so.c
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define ap_os_dso_handle_t HINSTANCE
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define ap_os_dso_init()
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define ap_os_dso_load(l) LoadLibraryEx(l, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define ap_os_dso_unload(l) FreeLibrary(l)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define ap_os_dso_sym(h,s) GetProcAddress(h,s)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define ap_os_dso_error() "" /* for now */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* Other ap_os_ routines not used by this platform */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define ap_os_kill(pid, sig) kill(pid, sig)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding/* Moved from multithread.h. Axe this stuff when APR comes online... */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define MULTI_OK (0)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define MULTI_TIMEOUT (1)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#define MULTI_ERR (2)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtypedef void mutex;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtypedef void semaphore;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtypedef void thread;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtypedef void event;
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingthread *create_thread(void (thread_fn) (void *thread_arg), void *thread_arg);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingint kill_thread(thread *thread_id);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingint await_thread(thread *thread_id, int sec_to_wait);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingvoid exit_thread(int status);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingvoid free_thread(thread *thread_id);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingsemaphore *create_semaphore(int initial);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingint acquire_semaphore(semaphore *semaphore_id);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingint release_semaphore(semaphore *semaphore_id);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingvoid destroy_semaphore(semaphore *semaphore_id);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingevent *create_event(int manual, int initial, char *name);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingevent *open_event(char *name);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingint acquire_event(event *event_id);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingint set_event(event *event_id);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingint reset_event(event *event_id);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingvoid destroy_event(event *event_id);
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding#endif /* ! APACHE_OS_H */
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding