• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-2023 Huawei Device Co., Ltd. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice, this list of
8  *    conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11  *    of conditions and the following disclaimer in the documentation and/or other materials
12  *    provided with the distribution.
13  *
14  * 3. Neither the name of the copyright holder nor the names of its contributors may be used
15  *    to endorse or promote products derived from this software without specific prior written
16  *    permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef XTS_IPC_H
32 #define XTS_IPC_H
33 
34 #include "xts_test.h"
35 #include <stdio.h>
36 #include <string.h>
37 #include <limits.h>
38 #include <pthread.h>
39 #include <time.h>
40 #include <unistd.h>
41 #include <sys/time.h>
42 #include <securec.h>
43 #include <semaphore.h>
44 #include <sys/resource.h>
45 #include <errno.h>
46 #include <stdlib.h>
47 #include <mqueue.h>
48 #include <fcntl.h>
49 #include <sys/stat.h>
50 #include <sys/types.h>
51 #include <sys/wait.h>
52 
53 #define NANO_S                          1000000000
54 #define NANO_MS                         1000000
55 #define TEN_CONT                        10
56 #define FIFTY_CONT                      50
57 #define HUNDRED_CONT                    100
58 #define TEST_INTP_SIZE                  10
59 #define TEST_SEEK_SIZE                  12
60 #define POSIX_IPC_NO_ERROR              0
61 #define KERNEL_NS_PER_SECOND            1000000000
62 #define SEM_VALUE_MAX                   0xFFFE
63 #define KERNEL_NS_PER_SECOND            1000000000
64 #define KERNEL_100MS_BY_NS              100000000
65 #define MQ_NAME_LEN                     64
66 #define MQ_TX_LEN                       64
67 #define MQ_RX_LEN                       64
68 #define MQ_MSG_SIZE                     64
69 #define MQ_MSG_PRIO                     0
70 #define MQ_MAX_MSG                      16
71 #define MQ_MAX_QN_LEN                   24
72 #define MAX_SIGNAL_NUMBER               64
73 #define MAX_PIPE_BUFFER                 1023
74 #define MAX_PIPE_NUMBER                 32
75 #define MAX_MQ_NUMBER                   LOSCFG_BASE_IPC_QUEUE_LIMIT
76 #define MAX_MQ_NAME_LEN                 2560
77 #define MAX_MQ_MSG_SIZE                 65530
78 #define MQ_MSG                          "MessageToSend"
79 #define MQ_MSG_LEN                      sizeof(MQ_MSG)
80 
81 #endif