Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
18fdb96a
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
18fdb96a
编写于
5月 08, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-4088
上级
15fc9ccb
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
54 addition
and
146 deletion
+54
-146
src/os/inc/os.h
src/os/inc/os.h
+0
-1
src/os/inc/osCommon.h
src/os/inc/osCommon.h
+0
-31
src/os/inc/osDef.h
src/os/inc/osDef.h
+4
-0
src/os/inc/osDir.h
src/os/inc/osDir.h
+4
-7
src/os/inc/osLinux32.h
src/os/inc/osLinux32.h
+0
-6
src/os/inc/osLz4.h
src/os/inc/osLz4.h
+16
-1
src/os/inc/osMath.h
src/os/inc/osMath.h
+28
-16
src/os/inc/osWindows.h
src/os/inc/osWindows.h
+0
-19
src/os/src/darwin/darwinFile.c
src/os/src/darwin/darwinFile.c
+0
-21
src/os/src/detail/osDir.c
src/os/src/detail/osDir.c
+2
-18
src/os/src/windows/wFile.c
src/os/src/windows/wFile.c
+0
-26
未找到文件。
src/os/inc/os.h
浏览文件 @
18fdb96a
...
...
@@ -58,7 +58,6 @@ extern "C" {
#include "osDef.h"
#include "osAtomic.h"
#include "osCommon.h"
#include "osDir.h"
#include "osFile.h"
#include "osLz4.h"
...
...
src/os/inc/osCommon.h
已删除
100644 → 0
浏览文件 @
15fc9ccb
/*
* 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/>.
*/
#ifndef TDENGINE_OS_COMMON_H
#define TDENGINE_OS_COMMON_H
#ifdef __cplusplus
extern
"C"
{
#endif
#ifndef TAOS_OS_DEF_ZU
#define PRIzu "zu"
#endif
#ifdef __cplusplus
}
#endif
#endif
src/os/inc/osDef.h
浏览文件 @
18fdb96a
...
...
@@ -111,6 +111,10 @@ extern "C" {
#define threadlocal __declspec( thread )
#endif
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
#define PRIzu "ld"
#endif
#ifdef __cplusplus
}
#endif
...
...
src/os/inc/osDir.h
浏览文件 @
18fdb96a
...
...
@@ -20,13 +20,10 @@
extern
"C"
{
#endif
#include <sys/types.h>
// TAOS_OS_FUNC_DIR
void
taosRemoveDir
(
char
*
rootDir
);
int
taosMkDir
(
const
char
*
pathname
,
mode_t
mode
);
void
taosRemoveOldLogFiles
(
char
*
rootDir
,
int32_t
keepDays
);
int32_t
taosRename
(
char
*
oldName
,
char
*
newName
);
void
taosRemoveDir
(
char
*
rootDir
);
int32_t
taosMkDir
(
const
char
*
pathname
,
mode_t
mode
);
void
taosRemoveOldLogFiles
(
char
*
rootDir
,
int32_t
keepDays
);
int32_t
taosRename
(
char
*
oldName
,
char
*
newName
);
int32_t
taosCompressFile
(
char
*
srcFileName
,
char
*
destFileName
);
#ifdef __cplusplus
...
...
src/os/inc/osLinux32.h
浏览文件 @
18fdb96a
...
...
@@ -79,12 +79,6 @@ extern "C" {
#include <math.h>
#include <poll.h>
#define TAOS_OS_FUNC_LZ4
#define BUILDIN_CLZL(val) __builtin_clzll(val)
#define BUILDIN_CTZL(val) __builtin_ctzll(val)
#define BUILDIN_CLZ(val) __builtin_clz(val)
#define BUILDIN_CTZ(val) __builtin_ctz(val)
#ifdef __cplusplus
}
#endif
...
...
src/os/inc/osLz4.h
浏览文件 @
18fdb96a
...
...
@@ -20,7 +20,22 @@
extern
"C"
{
#endif
#ifndef TAOS_OS_FUNC_LZ4
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
int32_t
BUILDIN_CLZL
(
uint64_t
val
);
int32_t
BUILDIN_CLZ
(
uint32_t
val
);
int32_t
BUILDIN_CTZL
(
uint64_t
val
);
int32_t
BUILDIN_CTZ
(
uint32_t
val
);
#elif defined (_TD_LINUX_32)
#define BUILDIN_CLZL(val) __builtin_clzll(val)
#define BUILDIN_CTZL(val) __builtin_ctzll(val)
#define BUILDIN_CLZ(val) __builtin_clz(val)
#define BUILDIN_CTZ(val) __builtin_ctz(val)
#elif defined (_TD_ARM_32)
#define BUILDIN_CLZL(val) __builtin_clzll(val)
#define BUILDIN_CTZL(val) __builtin_ctzll(val)
#define BUILDIN_CLZ(val) __builtin_clz(val)
#define BUILDIN_CTZ(val) __builtin_ctz(val)
#else
#define BUILDIN_CLZL(val) __builtin_clzl(val)
#define BUILDIN_CTZL(val) __builtin_ctzl(val)
#define BUILDIN_CLZ(val) __builtin_clz(val)
...
...
src/os/inc/osMath.h
浏览文件 @
18fdb96a
...
...
@@ -23,26 +23,38 @@ extern "C" {
#define POW2(x) ((x) * (x))
#define ABS(x) ((x) > 0 ? (x) : -(x))
#ifndef TAOS_OS_FUNC_MATH
#define SWAP(a, b, c) \
do { \
typeof(a) __tmp = (a); \
(a) = (b); \
(b) = __tmp; \
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
#define SWAP(a, b, c) \
do { \
c __tmp = (c)(a); \
(a) = (c)(b); \
(b) = __tmp; \
} while (0)
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#else
#define SWAP(a, b, c) \
do { \
typeof(a) __tmp = (a); \
(a) = (b); \
(b) = __tmp; \
} while (0)
#define MAX(a, b)
\
({
\
typeof(a) __a = (a); \
typeof(b) __b = (b); \
(__a > __b) ? __a : __b; \
#define MAX(a, b) \
({ \
typeof(a) __a = (a); \
typeof(b) __b = (b); \
(__a > __b) ? __a : __b; \
})
#define MIN(a, b)
\
({
\
typeof(a) __a = (a); \
typeof(b) __b = (b); \
(__a < __b) ? __a : __b; \
#define MIN(a, b) \
({ \
typeof(a) __a = (a); \
typeof(b) __b = (b); \
(__a < __b) ? __a : __b; \
})
#endif
...
...
src/os/inc/osWindows.h
浏览文件 @
18fdb96a
...
...
@@ -55,11 +55,6 @@
extern
"C"
{
#endif
#define TAOS_OS_FUNC_LZ4
int32_t
BUILDIN_CLZL
(
uint64_t
val
);
int32_t
BUILDIN_CLZ
(
uint32_t
val
);
int32_t
BUILDIN_CTZL
(
uint64_t
val
);
int32_t
BUILDIN_CTZ
(
uint32_t
val
);
#define TAOS_OS_FUNC_FILE
#define TAOS_OS_FUNC_FILE_ISREG
...
...
@@ -69,17 +64,6 @@ extern "C" {
#define TAOS_OS_FUNC_FILE_GETTMPFILEPATH
#define TAOS_OS_FUNC_FILE_FTRUNCATE
#define TAOS_OS_FUNC_DIR
#define TAOS_OS_FUNC_MATH
#define SWAP(a, b, c) \
do { \
c __tmp = (c)(a); \
(a) = (c)(b); \
(b) = __tmp; \
} while (0)
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define TAOS_OS_FUNC_SEMPHONE_PTHREAD
...
...
@@ -104,9 +88,6 @@ typedef SOCKET eventfd_t;
#define EPOLLWAKEUP (1u << 29)
#endif
#define TAOS_OS_DEF_ZU
#define PRIzu "ld"
#define TAOS_OS_FUNC_STRING_WCHAR
int
twcslen
(
const
wchar_t
*
wcs
);
#define TAOS_OS_FUNC_STRING_GETLINE
...
...
src/os/src/darwin/darwinFile.c
已删除
100644 → 0
浏览文件 @
15fc9ccb
/*
* 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/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "tulog.h"
src/os/src/detail/osDir.c
浏览文件 @
18fdb96a
...
...
@@ -28,7 +28,7 @@ void taosRemoveDir(char *rootDir) {
struct
dirent
*
de
=
NULL
;
while
((
de
=
readdir
(
dir
))
!=
NULL
)
{
if
(
strcmp
(
de
->
d_name
,
"."
)
==
0
||
strcmp
(
de
->
d_name
,
".."
)
==
0
)
continue
;
char
filename
[
1024
];
snprintf
(
filename
,
1023
,
"%s/%s"
,
rootDir
,
de
->
d_name
);
if
(
de
->
d_type
&
DT_DIR
)
{
...
...
@@ -51,27 +51,11 @@ int taosMkDir(const char *path, mode_t mode) {
return
code
;
}
#ifndef TAOS_OS_FUNC_DIR
int32_t
taosRename
(
char
*
oldName
,
char
*
newName
)
{
int32_t
code
=
rename
(
oldName
,
newName
);
if
(
code
<
0
)
{
uError
(
"failed to rename file %s to %s, reason:%s"
,
oldName
,
newName
,
strerror
(
errno
));
}
else
{
uTrace
(
"successfully to rename file %s to %s"
,
oldName
,
newName
);
}
return
code
;
}
#endif
void
taosRemoveOldLogFiles
(
char
*
rootDir
,
int32_t
keepDays
)
{
DIR
*
dir
=
opendir
(
rootDir
);
if
(
dir
==
NULL
)
return
;
int64_t
sec
=
taosGetTimestampSec
();
int64_t
sec
=
taosGetTimestampSec
();
struct
dirent
*
de
=
NULL
;
while
((
de
=
readdir
(
dir
))
!=
NULL
)
{
...
...
src/os/src/windows/wFile.c
已删除
100644 → 0
浏览文件 @
15fc9ccb
/*
* 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/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "osSocket.h"
#include "tglobal.h"
#include "tulog.h"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录