]> granicus.if.org Git - apache/blob - os/tpf/os.h
Update the copyright year in all .c, .h and .xml files
[apache] / os / tpf / os.h
1 /* Copyright 1999-2006 The Apache Software Foundation or its licensors, as
2  * applicable.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * @file tpf/os.h
19  * @brief This file in included in all Apache source code. It contains definitions
20  * of facilities available on _this_ operating system (HAVE_* macros),
21  * and prototypes of OS specific functions defined in os.c or os-inline.c
22  *
23  * @defgroup APACHE_OS_TPF tpf
24  * @ingroup  APACHE_OS
25  * @{
26  */
27
28 #ifndef APACHE_OS_H
29 #define APACHE_OS_H
30
31 #define PLATFORM "TPF"
32
33 #ifdef errno
34 #undef errno
35 #endif
36
37 #include "apr.h"
38 #include "ap_config.h"
39 #include <strings.h>
40 #ifndef __strings_h
41
42 #define FD_SETSIZE    2048 
43  
44 typedef long fd_mask;
45
46 #define NBBY    8    /* number of bits in a byte */
47 #define NFDBITS (sizeof(fd_mask) * NBBY)
48 #define  howmany(x, y)  (((x)+((y)-1))/(y))
49
50 typedef struct fd_set { 
51         fd_mask fds_bits [howmany(FD_SETSIZE, NFDBITS)];
52 } fd_set; 
53
54 #define FD_CLR(n, p)((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
55 #define FD_ISSET(n, p)((p)->fds_bits[(n)/NFDBITS] & (1 <<((n) % NFDBITS)))
56 #define  FD_ZERO(p)   memset((char *)(p), 0, sizeof(*(p)))
57 #endif
58     
59 #ifdef FD_SET
60 #undef FD_SET
61 #define FD_SET(n, p) (0)
62 #endif
63
64 #include <i$netd.h>
65 struct apache_input {
66     INETD_SERVER_INPUT  inetd_server;
67     void                *scoreboard_heap;   /* scoreboard system heap address */
68     int                 scoreboard_fd;      /* scoreboard file descriptor */
69     int                 slot;               /* child number */
70     int                 generation;         /* server generation number */
71     int                 listeners[10];
72     time_t              restart_time;
73 };
74
75 typedef struct apache_input APACHE_TPF_INPUT;
76
77 extern int tpf_child;
78
79 struct server_rec;
80 pid_t os_fork(struct server_rec *s, int slot);
81 int os_check_server(char *server);
82
83 extern char *ap_server_argv0;
84 extern int scoreboard_fd;
85 #include <signal.h>
86 #ifndef SIGPIPE
87 #define SIGPIPE 14
88 #endif
89 #ifdef NSIG
90 #undef NSIG
91 #endif
92 #endif /*! APACHE_OS_H*/
93 /** @} */