Apache HTTPD
testshmconsumer.c
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. 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#include "apr_shm.h"
18#include "apr_errno.h"
19#include "apr_general.h"
20#include "apr_lib.h"
21#include "apr_strings.h"
22#include "apr_time.h"
23#include "testshm.h"
24#include "apr.h"
25
26#if APR_HAVE_STDLIB_H
27#include <stdlib.h>
28#endif
29
30
31#if APR_HAS_SHARED_MEMORY
32
33int main(void)
34{
35 apr_status_t rv;
38 int recvd;
39
41
43 exit(-1);
44 }
45
47 if (rv != APR_SUCCESS) {
48 exit(-2);
49 }
50
52
53 /* consume messages on all of the boxes */
54 recvd = msgwait(MSG, N_MESSAGES, 30, 1);
55
56 rv = apr_shm_detach(shm);
57 if (rv != APR_SUCCESS) {
58 exit(-3);
59 }
60
61 return recvd;
62}
63
64#else /* APR_HAS_SHARED_MEMORY */
65
66int main(void)
67{
68 /* Just return, this program will never be called, so we don't need
69 * to print a message
70 */
71 return 0;
72}
73
74#endif /* APR_HAS_SHARED_MEMORY */
75
APR Error Codes.
APR Miscellaneous library routines.
APR general purpose library routines.
APR Shared Memory Routines.
APR Strings library.
APR Time Library.
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
#define apr_pool_create(newpool, parent)
Definition apr_pools.h:322
apr_shm_t * shm
return NULL
Definition mod_so.c:359
#define MSG
Definition testshm.h:37
mbox * boxes
Definition testshm.h:31
#define SHARED_FILENAME
Definition testshm.h:36
#define N_MESSAGES
Definition testshm.h:34
int main(void)