diff --git a/include/os/osSysinfo.h b/include/os/osSysinfo.h index 1ebad370b5d1d9dee443d105f7201cdb96fd4cd5..54a3cfef7be19beb58e927b6eec616895c27065e 100644 --- a/include/os/osSysinfo.h +++ b/include/os/osSysinfo.h @@ -33,6 +33,7 @@ typedef struct { SDiskSize size; } SDiskSpace; +bool taosCheckSystemIsSmallEnd(); void taosGetSystemInfo(); int32_t taosGetEmail(char *email, int32_t maxLen); int32_t taosGetOsReleaseName(char *releaseName, int32_t maxLen); diff --git a/source/dnode/mgmt/daemon/src/dmnMain.c b/source/dnode/mgmt/daemon/src/dmnMain.c index df705898ca4532759ff083810f98546f2af206f8..7ba272453ca247600024411c106af17a1dc6cd25 100644 --- a/source/dnode/mgmt/daemon/src/dmnMain.c +++ b/source/dnode/mgmt/daemon/src/dmnMain.c @@ -97,6 +97,11 @@ int32_t dmnRunDnode() { } int main(int argc, char const *argv[]) { + if (!taosCheckSystemIsSmallEnd()) { + uError("TDengine does not run on non-small-end machines."); + return -1; + } + if (dmnParseOption(argc, argv) != 0) { return -1; } diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index ff9d5fb71b95b74b744f60f1abf9716717263cf6..02d7e6c0e901e7f8fb16285059b5f0bbf8dc4a55 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -16,6 +16,15 @@ #define _DEFAULT_SOURCE #include "os.h" +bool taosCheckSystemIsSmallEnd() { + union check{ + int16_t i; + char ch[2]; + }c; + c.i=1; + return c.ch[0]==1; +} + #if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) /*