os.h 2.3 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>
H
Hongze Cheng 已提交
30
#include <libgen.h>
31
#include <sched.h>
H
Hongze Cheng 已提交
32
#include <unistd.h>
33 34
#include <wordexp.h>

35
#include <sys/ioctl.h>
H
Hongze Cheng 已提交
36 37 38
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/shm.h>
39
#include <sys/stat.h>
H
Hongze Cheng 已提交
40
#include <sys/statvfs.h>
41 42
#include <sys/time.h>
#include <sys/types.h>
H
Hongze Cheng 已提交
43
#include <sys/utsname.h>
S
shm  
Shengliang Guan 已提交
44
#include <sys/wait.h>
H
Hongze Cheng 已提交
45
#include <termios.h>
46 47 48 49

#if defined(DARWIN)
#else
#include <argp.h>
H
Hongze Cheng 已提交
50
#include <sys/prctl.h>
51
#include <cpuid.h>
52
#endif
wafwerar's avatar
wafwerar 已提交
53 54
#else

wafwerar's avatar
wafwerar 已提交
55
#ifndef __func__
H
Hongze Cheng 已提交
56
#define __func__ __FUNCTION__
wafwerar's avatar
wafwerar 已提交
57
#endif
wafwerar's avatar
wafwerar 已提交
58
#include <malloc.h>
wafwerar's avatar
wafwerar 已提交
59 60 61 62 63 64
#include <time.h>
#ifndef TD_USE_WINSOCK
#include <winsock2.h>
#else
#include <winsock.h>
#endif
65 66
#endif

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

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

H
Hongze Cheng 已提交
92 93
#include "osThread.h"

H
refact  
Hongze Cheng 已提交
94 95
#include "osAtomic.h"
#include "osDef.h"
96
#include "osDir.h"
H
refact  
Hongze Cheng 已提交
97
#include "osEndian.h"
H
Hongze Cheng 已提交
98
#include "osEnv.h"
99
#include "osFile.h"
S
locale  
Shengliang Guan 已提交
100
#include "osLocale.h"
S
Shengliang Guan 已提交
101
#include "osLz4.h"
102
#include "osMath.h"
H
refact  
Hongze Cheng 已提交
103
#include "osMemory.h"
S
Shengliang Guan 已提交
104
#include "osRand.h"
105
#include "osSemaphore.h"
H
Hongze Cheng 已提交
106
#include "osSignal.h"
S
Shengliang Guan 已提交
107
#include "osSleep.h"
108 109
#include "osSocket.h"
#include "osString.h"
S
Shengliang Guan 已提交
110 111
#include "osSysinfo.h"
#include "osSystem.h"
S
Shengliang Guan 已提交
112 113
#include "osTime.h"
#include "osTimer.h"
S
Shengliang Guan 已提交
114
#include "osTimezone.h"
H
Hongze Cheng 已提交
115
#include "taoserror.h"
S
Shengliang Guan 已提交
116 117 118 119 120

#ifdef __cplusplus
}
#endif

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