Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
582
Issues
582
List
Boards
Labels
Service Desk
Milestones
Merge Requests
110
Merge Requests
110
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
BIND
Commits
6f766009
Commit
6f766009
authored
Aug 16, 2001
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
959. [port] freebsd: ncpus via sysctlbyname(). [RT
#1584
]
parent
63742a7f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
5 deletions
+33
-5
CHANGES
CHANGES
+2
-0
config.h.in
config.h.in
+7
-1
configure.in
configure.in
+3
-2
lib/isc/unix/os.c
lib/isc/unix/os.c
+21
-2
No files found.
CHANGES
View file @
6f766009
959. [port] freebsd: ncpus via sysctlbyname(). [RT #1584]
958. [port] ssize_t is not available on all platforms. [RT #1607]
957. [bug] sys/select.h inclusion was broken on older platforms.
...
...
config.h.in
View file @
6f766009
...
...
@@ -16,7 +16,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.h.in,v 1.4
6 2001/08/15 06:03:39
marka Exp $ */
/* $Id: config.h.in,v 1.4
7 2001/08/16 06:19:56
marka Exp $ */
/***
*** This file is not to be included by any public header files, because
...
...
@@ -66,6 +66,9 @@
/* define if sysconf() is available */
#undef HAVE_SYSCONF
/* define if sysctlbyname() is available */
#undef HAVE_SYSCTLBYNAME
/* define if catgets() is available */
#undef HAVE_CATGETS
...
...
@@ -150,6 +153,9 @@ int sigwait(const unsigned int *set, int *sig);
/* Define if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define if you have the <sys/sysctl.h> header file. */
#undef HAVE_SYS_SYSCTL_H
/* Define if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
...
...
configure.in
View file @
6f766009
...
...
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.2
89
$)
AC_REVISION($Revision: 1.2
90
$)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
...
...
@@ -194,10 +194,11 @@ AC_PROG_CC
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h)
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h
sys/sysctl.h
)
AC_C_CONST
AC_C_INLINE
AC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME),)
#
# UnixWare 7.1.1 with the feature supplement to the UDK compiler
...
...
lib/isc/unix/os.c
View file @
6f766009
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: os.c,v 1.1
0 2001/02/17 01:23:43 gson
Exp $ */
/* $Id: os.c,v 1.1
1 2001/08/16 06:19:58 marka
Exp $ */
#include <config.h>
...
...
@@ -54,6 +54,22 @@ hpux_ncpus(void) {
#endif
/* __hpux */
#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME)
#include <sys/types.h>
#include <sys/sysctl.h>
static
int
sysctl_ncpus
(
void
)
{
int
ncpu
,
result
;
size_t
len
;
len
=
sizeof
ncpu
;
result
=
sysctlbyname
(
"hw.ncpu"
,
&
ncpu
,
&
len
,
0
,
0
);
if
(
result
!=
-
1
)
return
(
ncpu
);
return
(
0
);
}
#endif
unsigned
int
isc_os_ncpus
(
void
)
{
...
...
@@ -64,7 +80,10 @@ isc_os_ncpus(void) {
#elif defined(HAVE_SYSCONF)
ncpus
=
sysconf_ncpus
();
#endif
#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTLBYNAME)
if
(
ncpus
<=
0
)
ncpus
=
sysctl_ncpus
();
#endif
if
(
ncpus
<=
0
)
ncpus
=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment