This commit is contained in:
Shengliang Guan 2021-05-08 16:02:38 +08:00
parent a4f75510d7
commit eda9995add
15 changed files with 31 additions and 38 deletions

View File

@ -75,7 +75,7 @@ extern "C" {
#define TAOS_OS_FUNC_FILE_SENDIFLE #define TAOS_OS_FUNC_FILE_SENDIFLE
#define TAOS_OS_FUNC_SOCKET_SETSOCKETOPT #define TAOS_OS_FUNC_SOCKET_SETSOCKETOPT
#define TAOS_OS_FUNC_SYSINFO
#define TAOS_OS_FUNC_TIMERD #define TAOS_OS_FUNC_TIMERD
// specific // specific

View File

@ -111,8 +111,10 @@ extern "C" {
#define threadlocal __declspec( thread ) #define threadlocal __declspec( thread )
#endif #endif
#if !(defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)) #if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
#define PRIzu "ld" #define PRIzu "ld"
#else
#define PRIzu "zu"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -20,8 +20,6 @@
extern "C" { extern "C" {
#endif #endif
#include "os.h"
#include "taosdef.h"
#include <signal.h> #include <signal.h>
#ifndef SIGALRM #ifndef SIGALRM
@ -57,4 +55,4 @@ void taosDflSignal(int32_t signum);
} }
#endif #endif
#endif // TDENGINE_TTIME_H #endif // TDENGINE_OS_SIGNAL_H

View File

@ -20,7 +20,6 @@
extern "C" { extern "C" {
#endif #endif
// TAOS_OS_FUNC_SYSINFO
typedef struct { typedef struct {
int64_t tsize; int64_t tsize;
int64_t used; int64_t used;
@ -41,7 +40,6 @@ void taosKillSystem();
bool taosGetSystemUid(char *uid); bool taosGetSystemUid(char *uid);
char * taosGetCmdlineByPID(int pid); char * taosGetCmdlineByPID(int pid);
// TAOS_OS_FUNC_SYSINFO_CORE
void taosSetCoreDump(); void taosSetCoreDump();
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -23,9 +23,16 @@ extern "C" {
#include "os.h" #include "os.h"
#include "taosdef.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) #define MILLISECOND_PER_SECOND ((int64_t)1000L)
#endif #endif
#define MILLISECOND_PER_MINUTE (MILLISECOND_PER_SECOND * 60) #define MILLISECOND_PER_MINUTE (MILLISECOND_PER_SECOND * 60)
#define MILLISECOND_PER_HOUR (MILLISECOND_PER_MINUTE * 60) #define MILLISECOND_PER_HOUR (MILLISECOND_PER_MINUTE * 60)
#define MILLISECOND_PER_DAY (MILLISECOND_PER_HOUR * 24) #define MILLISECOND_PER_DAY (MILLISECOND_PER_HOUR * 24)

View File

@ -20,7 +20,6 @@
extern "C" { extern "C" {
#endif #endif
// TAOS_OS_FUNC_TIMER
int taosInitTimer(void (*callback)(int), int ms); int taosInitTimer(void (*callback)(int), int ms);
void taosUninitTimer(); void taosUninitTimer();

View File

@ -91,17 +91,6 @@ typedef SOCKET eventfd_t;
char *stpcpy (char *dest, const char *src); char *stpcpy (char *dest, const char *src);
char *stpncpy (char *dest, const char *src, size_t n); 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 // specific
typedef int (*__compar_fn_t)(const void *, const void *); typedef int (*__compar_fn_t)(const void *, const void *);
#define ssize_t int #define ssize_t int
@ -157,8 +146,6 @@ int gettimeofday(struct timeval *ptv, void *pTimeZone);
#define PATH_MAX 256 #define PATH_MAX 256
#endif #endif
#define TAOS_OS_FUNC_SIGNAL
typedef struct { typedef struct {
int we_wordc; int we_wordc;
char *we_wordv[1]; char *we_wordv[1];

View File

@ -15,11 +15,13 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
#include "taosdef.h"
#include "tconfig.h" #include "tconfig.h"
#include "tglobal.h" #include "tglobal.h"
#include "tulog.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); typedef void (*FLinuxSignalHandler)(int32_t signum, siginfo_t *sigInfo, void *context);
void taosSetSignal(int32_t signum, FSignalHandler sigfp) { void taosSetSignal(int32_t signum, FSignalHandler sigfp) {

View File

@ -20,7 +20,7 @@
#include "tulog.h" #include "tulog.h"
#include "taoserror.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 #define PROCESS_ITEM 12

View File

@ -18,7 +18,7 @@
#include "ttimer.h" #include "ttimer.h"
#include "tulog.h" #include "tulog.h"
#ifndef TAOS_OS_FUNC_TIMER #if !(defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32))
static void taosDeleteTimer(void *tharg) { static void taosDeleteTimer(void *tharg) {
timer_t *pTimer = tharg; timer_t *pTimer = tharg;