mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-08 07:51:28 +12:00
Log maxfiles to file and stderr on *NIX
This commit is contained in:
parent
3571e6ef85
commit
37f24d8c1c
3 changed files with 28 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "stringapiset.h"
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
@ -358,6 +359,19 @@ std::string utils::get_OS_version()
|
|||
return output;
|
||||
}
|
||||
|
||||
int utils::get_maxfiles()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// Virtually unlimited on Windows
|
||||
return INT_MAX;
|
||||
#else
|
||||
struct rlimit limits;
|
||||
ensure(getrlimit(RLIMIT_NOFILE, &limits) == 0);
|
||||
|
||||
return limits.rlim_cur;
|
||||
#endif
|
||||
}
|
||||
|
||||
static constexpr ullong round_tsc(ullong val)
|
||||
{
|
||||
return utils::rounded_div(val, 1'000'000) * 1'000'000;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue