os.h 2.4 KB
Newer Older
S
Shengliang Guan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

S
os  
Shengliang Guan 已提交
16 17
#ifndef _TD_OS_H_
#define _TD_OS_H_
S
Shengliang Guan 已提交
18 19 20 21 22

#ifdef __cplusplus
extern "C" {
#endif

H
refact  
Hongze Cheng 已提交
23
#include <assert.h>
S
Shengliang Guan 已提交
24
#include <ctype.h>
25

26 27
#include <regex.h>

28
#if !defined(WINDOWS)
dengyihao's avatar
dengyihao 已提交
29
#include <dirent.h>
sangshuduo's avatar
sangshuduo 已提交
30 31

#if !defined(_ALPINE)
S
Shengliang Guan 已提交
32
#include <execinfo.h>
sangshuduo's avatar
sangshuduo 已提交
33 34
#endif

H
Hongze Cheng 已提交
35
#include <libgen.h>
36
#include <sched.h>
H
Hongze Cheng 已提交
37
#include <unistd.h>
38 39
#include <wordexp.h>

40
#include <sys/ioctl.h>
H
Hongze Cheng 已提交
41 42 43
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/shm.h>
44
#include <sys/stat.h>
H
Hongze Cheng 已提交
45
#include <sys/statvfs.h>
46 47
#include <sys/time.h>
#include <sys/types.h>
H
Hongze Cheng 已提交
48
#include <sys/utsname.h>
S
shm  
Shengliang Guan 已提交
49
#include <sys/wait.h>
H
Hongze Cheng 已提交
50
#include <termios.h>
51 52 53 54

#if defined(DARWIN)
#else
#include <argp.h>
H
Hongze Cheng 已提交
55
#include <sys/prctl.h>
sangshuduo's avatar
sangshuduo 已提交
56
#if defined(_TD_X86_)
57
#include <cpuid.h>
58
#endif
sangshuduo's avatar
sangshuduo 已提交
59
#endif
wafwerar's avatar
wafwerar 已提交
60 61
#else

wafwerar's avatar
wafwerar 已提交
62
#ifndef __func__
H
Hongze Cheng 已提交
63
#define __func__ __FUNCTION__
wafwerar's avatar
wafwerar 已提交
64
#endif
wafwerar's avatar
wafwerar 已提交
65
#include <malloc.h>
wafwerar's avatar
wafwerar 已提交
66 67 68 69 70 71
#include <time.h>
#ifndef TD_USE_WINSOCK
#include <winsock2.h>
#else
#include <winsock.h>
#endif
72 73
#endif

74
#include <errno.h>
H
fix  
Hongze Cheng 已提交
75
#include <fcntl.h>
S
Shengliang Guan 已提交
76
#include <float.h>
77
#include <inttypes.h>
H
more  
Hongze Cheng 已提交
78
#include <limits.h>
S
Shengliang Guan 已提交
79 80
#include <locale.h>
#include <math.h>
S
Shengliang Guan 已提交
81
#include <setjmp.h>
S
Shengliang Guan 已提交
82 83
#include <signal.h>
#include <stdarg.h>
H
refact  
Hongze Cheng 已提交
84
#include <stdbool.h>
S
Shengliang Guan 已提交
85
#include <stddef.h>
H
refact  
Hongze Cheng 已提交
86
#include <stdint.h>
H
refact  
Hongze Cheng 已提交
87
#include <stdio.h>
H
refact  
Hongze Cheng 已提交
88 89
#include <stdlib.h>
#include <string.h>
dengyihao's avatar
dengyihao 已提交
90 91
#include <wchar.h>
#include <wctype.h>
H
Haojun Liao 已提交
92 93 94 95 96 97

#if __AVX__
#include <immintrin.h>
#elif __SSE4_2__
#include <nmmintrin.h>
#endif
dengyihao's avatar
dengyihao 已提交
98

H
Hongze Cheng 已提交
99 100
#include "osThread.h"

H
refact  
Hongze Cheng 已提交
101 102
#include "osAtomic.h"
#include "osDef.h"
103
#include "osDir.h"
H
refact  
Hongze Cheng 已提交
104
#include "osEndian.h"
H
Hongze Cheng 已提交
105
#include "osEnv.h"
106
#include "osFile.h"
S
locale  
Shengliang Guan 已提交
107
#include "osLocale.h"
S
Shengliang Guan 已提交
108
#include "osLz4.h"
109
#include "osMath.h"
H
refact  
Hongze Cheng 已提交
110
#include "osMemory.h"
S
Shengliang Guan 已提交
111
#include "osRand.h"
112
#include "osSemaphore.h"
H
Hongze Cheng 已提交
113
#include "osSignal.h"
S
Shengliang Guan 已提交
114
#include "osSleep.h"
115 116
#include "osSocket.h"
#include "osString.h"
S
Shengliang Guan 已提交
117 118
#include "osSysinfo.h"
#include "osSystem.h"
S
Shengliang Guan 已提交
119 120
#include "osTime.h"
#include "osTimer.h"
S
Shengliang Guan 已提交
121
#include "osTimezone.h"
H
Hongze Cheng 已提交
122
#include "taoserror.h"
X
xinsheng Ren 已提交
123
#include "tlog.h"
S
Shengliang Guan 已提交
124 125 126 127 128

#ifdef __cplusplus
}
#endif

S
os  
Shengliang Guan 已提交
129
#endif /*_TD_OS_H_*/