mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 14:50:18 +00:00
LibCore: Implement Core::System::hardware_concurrency()
This commit is contained in:
parent
9f31a83c2e
commit
9c9a378455
Notes:
sideshowbarker
2024-07-16 20:12:13 +09:00
Author: https://github.com/shannonbooth
Commit: 9c9a378455
Pull-request: https://github.com/SerenityOS/serenity/pull/23856
2 changed files with 7 additions and 0 deletions
|
@ -1739,6 +1739,11 @@ ErrorOr<void> posix_fallocate(int fd, off_t offset, off_t length)
|
|||
// the distinction between these libraries moot.
|
||||
static constexpr StringView INTERNAL_DEFAULT_PATH_SV = "/usr/local/sbin:/usr/local/bin:/usr/bin:/bin"sv;
|
||||
|
||||
unsigned hardware_concurrency()
|
||||
{
|
||||
return sysconf(_SC_NPROCESSORS_ONLN);
|
||||
}
|
||||
|
||||
ErrorOr<String> resolve_executable_from_environment(StringView filename, int flags)
|
||||
{
|
||||
if (filename.is_empty())
|
||||
|
|
|
@ -276,6 +276,8 @@ ErrorOr<AddressInfoVector> getaddrinfo(char const* nodename, char const* servnam
|
|||
ErrorOr<void> posix_fallocate(int fd, off_t offset, off_t length);
|
||||
#endif
|
||||
|
||||
unsigned hardware_concurrency();
|
||||
|
||||
ErrorOr<String> resolve_executable_from_environment(StringView filename, int flags = 0);
|
||||
|
||||
ErrorOr<ByteString> current_executable_path();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue