TD-4088
This commit is contained in:
parent
a4f75510d7
commit
eda9995add
|
@ -75,7 +75,7 @@ extern "C" {
|
|||
#define TAOS_OS_FUNC_FILE_SENDIFLE
|
||||
|
||||
#define TAOS_OS_FUNC_SOCKET_SETSOCKETOPT
|
||||
#define TAOS_OS_FUNC_SYSINFO
|
||||
|
||||
#define TAOS_OS_FUNC_TIMERD
|
||||
|
||||
// specific
|
||||
|
|
|
@ -111,8 +111,10 @@ extern "C" {
|
|||
#define threadlocal __declspec( thread )
|
||||
#endif
|
||||
|
||||
#if !(defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32))
|
||||
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
|
||||
#define PRIzu "ld"
|
||||
#else
|
||||
#define PRIzu "zu"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "os.h"
|
||||
#include "taosdef.h"
|
||||
#include <signal.h>
|
||||
|
||||
#ifndef SIGALRM
|
||||
|
@ -57,4 +55,4 @@ void taosDflSignal(int32_t signum);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif // TDENGINE_TTIME_H
|
||||
#endif // TDENGINE_OS_SIGNAL_H
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
// TAOS_OS_FUNC_SYSINFO
|
||||
typedef struct {
|
||||
int64_t tsize;
|
||||
int64_t used;
|
||||
|
@ -28,20 +27,19 @@ typedef struct {
|
|||
} SysDiskSize;
|
||||
|
||||
int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize);
|
||||
void taosGetSystemInfo();
|
||||
bool taosGetProcIO(float *readKB, float *writeKB);
|
||||
bool taosGetBandSpeed(float *bandSpeedKb);
|
||||
void taosGetDisk();
|
||||
bool taosGetCpuUsage(float *sysCpuUsage, float *procCpuUsage) ;
|
||||
bool taosGetProcMemory(float *memoryUsedMB) ;
|
||||
bool taosGetSysMemory(float *memoryUsedMB);
|
||||
void taosPrintOsInfo();
|
||||
int taosSystem(const char * cmd) ;
|
||||
void taosKillSystem();
|
||||
bool taosGetSystemUid(char *uid);
|
||||
char *taosGetCmdlineByPID(int pid);
|
||||
void taosGetSystemInfo();
|
||||
bool taosGetProcIO(float *readKB, float *writeKB);
|
||||
bool taosGetBandSpeed(float *bandSpeedKb);
|
||||
void taosGetDisk();
|
||||
bool taosGetCpuUsage(float *sysCpuUsage, float *procCpuUsage);
|
||||
bool taosGetProcMemory(float *memoryUsedMB);
|
||||
bool taosGetSysMemory(float *memoryUsedMB);
|
||||
void taosPrintOsInfo();
|
||||
int taosSystem(const char *cmd);
|
||||
void taosKillSystem();
|
||||
bool taosGetSystemUid(char *uid);
|
||||
char * taosGetCmdlineByPID(int pid);
|
||||
|
||||
// TAOS_OS_FUNC_SYSINFO_CORE
|
||||
void taosSetCoreDump();
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -23,9 +23,16 @@ extern "C" {
|
|||
#include "os.h"
|
||||
#include "taosdef.h"
|
||||
|
||||
#ifndef TAOS_OS_FUNC_TIME_DEF
|
||||
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
|
||||
#ifdef _TD_GO_DLL_
|
||||
#define MILLISECOND_PER_SECOND (1000LL)
|
||||
#else
|
||||
#define MILLISECOND_PER_SECOND (1000i64)
|
||||
#endif
|
||||
#else
|
||||
#define MILLISECOND_PER_SECOND ((int64_t)1000L)
|
||||
#endif
|
||||
|
||||
#define MILLISECOND_PER_MINUTE (MILLISECOND_PER_SECOND * 60)
|
||||
#define MILLISECOND_PER_HOUR (MILLISECOND_PER_MINUTE * 60)
|
||||
#define MILLISECOND_PER_DAY (MILLISECOND_PER_HOUR * 24)
|
||||
|
@ -85,7 +92,7 @@ int32_t parseAbsoluteDuration(char* token, int32_t tokenlen, int64_t* ts);
|
|||
int32_t parseNatualDuration(const char* token, int32_t tokenLen, int64_t* duration, char* unit);
|
||||
|
||||
int32_t taosParseTime(char* timestr, int64_t* time, int32_t len, int32_t timePrec, int8_t dayligth);
|
||||
void deltaToUtcInitOnce();
|
||||
void deltaToUtcInitOnce();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
// TAOS_OS_FUNC_TIMER
|
||||
int taosInitTimer(void (*callback)(int), int ms);
|
||||
void taosUninitTimer();
|
||||
|
||||
|
|
|
@ -91,17 +91,6 @@ typedef SOCKET eventfd_t;
|
|||
char *stpcpy (char *dest, const char *src);
|
||||
char *stpncpy (char *dest, const char *src, size_t n);
|
||||
|
||||
#define TAOS_OS_FUNC_SYSINFO
|
||||
|
||||
#define TAOS_OS_FUNC_TIME_DEF
|
||||
#ifdef _TD_GO_DLL_
|
||||
#define MILLISECOND_PER_SECOND (1000LL)
|
||||
#else
|
||||
#define MILLISECOND_PER_SECOND (1000i64)
|
||||
#endif
|
||||
|
||||
#define TAOS_OS_FUNC_TIMER
|
||||
|
||||
// specific
|
||||
typedef int (*__compar_fn_t)(const void *, const void *);
|
||||
#define ssize_t int
|
||||
|
@ -157,8 +146,6 @@ int gettimeofday(struct timeval *ptv, void *pTimeZone);
|
|||
#define PATH_MAX 256
|
||||
#endif
|
||||
|
||||
#define TAOS_OS_FUNC_SIGNAL
|
||||
|
||||
typedef struct {
|
||||
int we_wordc;
|
||||
char *we_wordv[1];
|
||||
|
|
|
@ -15,11 +15,13 @@
|
|||
|
||||
#define _DEFAULT_SOURCE
|
||||
#include "os.h"
|
||||
#include "taosdef.h"
|
||||
#include "tconfig.h"
|
||||
#include "tglobal.h"
|
||||
#include "tulog.h"
|
||||
|
||||
#ifndef TAOS_OS_FUNC_SIGNAL
|
||||
#if !(defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32))
|
||||
|
||||
typedef void (*FLinuxSignalHandler)(int32_t signum, siginfo_t *sigInfo, void *context);
|
||||
|
||||
void taosSetSignal(int32_t signum, FSignalHandler sigfp) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "tulog.h"
|
||||
#include "taoserror.h"
|
||||
|
||||
#ifndef TAOS_OS_FUNC_SYSINFO
|
||||
#if !(defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) || defined (_TD_DARWIN_64))
|
||||
|
||||
#define PROCESS_ITEM 12
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "ttimer.h"
|
||||
#include "tulog.h"
|
||||
|
||||
#ifndef TAOS_OS_FUNC_TIMER
|
||||
#if !(defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32))
|
||||
|
||||
static void taosDeleteTimer(void *tharg) {
|
||||
timer_t *pTimer = tharg;
|
||||
|
|
Loading…
Reference in New Issue