Files
bind9/lib/isc/win32/os.c
Ondřej Surý cdef20bb66 Merge branch 'each-style-tweak' into 'master'
adjust clang-format options to get closer to ISC style

See merge request isc-projects/bind9!3061

(cherry picked from commit d3b49b6675)

0255a974 revise .clang-format and add a C formatting script in util
e851ed0b apply the modified style
2020-02-14 05:35:29 +00:00

40 lines
784 B
C

/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#include <windows.h>
#include <isc/os.h>
static BOOL bInit = FALSE;
static SYSTEM_INFO SystemInfo;
static void
initialize_action(void) {
if (bInit) {
return;
}
GetSystemInfo(&SystemInfo);
bInit = TRUE;
}
unsigned int
isc_os_ncpus(void) {
long ncpus;
initialize_action();
ncpus = SystemInfo.dwNumberOfProcessors;
if (ncpus <= 0) {
ncpus = 1;
}
return ((unsigned int)ncpus);
}