1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-07 08:14:58 +03:00

v4.23-9647-beta

This commit is contained in:
dnobori
2017-10-18 18:24:21 +09:00
parent acf49ad536
commit faee11ff09
301 changed files with 1695 additions and 2645 deletions

View File

@ -3,9 +3,9 @@
//
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
//
// Copyright (c) 2012-2016 Daiyuu Nobori.
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
// Copyright (c) 2012-2016 SoftEther Corporation.
// Copyright (c) Daiyuu Nobori, Ph.D..
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
// Copyright (c) SoftEther Corporation.
//
// All Rights Reserved.
//
@ -1010,6 +1010,63 @@ void UnixRestorePriority()
}
}
UINT UnixGetNumberOfCpuInner()
{
BUF *b;
UINT ret = 0;
b = ReadDump("/proc/cpuinfo");
if (b != NULL)
{
while (true)
{
char *line = CfgReadNextLine(b);
if (line == NULL)
{
break;
}
if (IsEmptyStr(line) == false)
{
TOKEN_LIST *t = ParseToken(line, ":");
if (t != NULL)
{
if (t->NumTokens >= 2)
{
char *key = t->Token[0];
char *value = t->Token[1];
Trim(key);
Trim(value);
if (StrCmpi(key, "processor") == 0)
{
if (IsNum(value))
{
UINT i = ToInt(value) + 1;
if (i >= 1 && i <= 128)
{
ret = MAX(ret, i);
}
}
}
}
FreeToken(t);
}
}
Free(line);
}
FreeBuf(b);
}
return ret;
}
// Get the product ID
char *UnixGetProductId()
{
@ -2859,7 +2916,3 @@ void UnixServiceMain(int argc, char *argv[], char *name, SERVICE_FUNCTION *start
}
#endif // UNIX
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
// Department of Computer Science has dozens of overly-enthusiastic geeks.
// Join us: http://www.tsukuba.ac.jp/english/admission/