Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
386a52a5
Commit
386a52a5
authored
Jun 22, 2000
by
Brian Wellington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add isc/unix/os.c, which has isc_os_ncpus()
parent
7005cfed
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
4 deletions
+74
-4
lib/isc/Makefile.in
lib/isc/Makefile.in
+2
-1
lib/isc/include/isc/Makefile.in
lib/isc/include/isc/Makefile.in
+1
-1
lib/isc/include/isc/os.h
lib/isc/include/isc/os.h
+34
-0
lib/isc/unix/Makefile.in
lib/isc/unix/Makefile.in
+2
-2
lib/isc/unix/os.c
lib/isc/unix/os.c
+35
-0
No files found.
lib/isc/Makefile.in
View file @
386a52a5
...
...
@@ -33,7 +33,8 @@ UNIXOBJS = @ISC_ISCIPV6_O@ \
unix/app.@O@ unix/dir.@O@ unix/entropy.@O@
\
unix/errno2result.@O@ unix/file.@O@ unix/fsaccess.@O@
\
unix/interfaceiter.@O@ unix/keyboard.@O@ unix/net.@O@
\
unix/socket.@O@ unix/time.@O@ unix/stdio.@O@ unix/stdtime.@O@
unix/os.@O@ unix/socket.@O@ unix/time.@O@
\
unix/stdio.@O@ unix/stdtime.@O@
NLSOBJS
=
nls/msgcat.@O@
...
...
lib/isc/include/isc/Makefile.in
View file @
386a52a5
...
...
@@ -27,7 +27,7 @@ HEADERS = assertions.h base64.h bitstring.h boolean.h buffer.h \
file.h formatcheck.h fsaccess.h heap.h interfaceiter.h
\
@ISC_IPV6_H@ lang.h lex.h
\
lfsr.h lib.h list.h log.h magic.h md5.h mem.h msgcat.h
\
mutexblock.h netaddr.h ondestroy.h platform.h
\
mutexblock.h netaddr.h ondestroy.h
os.h
platform.h
\
print.h quota.h random.h ratelimiter.h region.h
\
result.h resultclass.h rwlock.h serial.h sha1.h sockaddr.h
\
socket.h stdio.h string.h symtab.h task.h taskpool.h timer.h
\
...
...
lib/isc/include/isc/os.h
0 → 100644
View file @
386a52a5
/*
* Copyright (C) 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#ifndef ISC_OS_H
#define ISC_OS_H 1
#include <isc/lang.h>
ISC_LANG_BEGINDECLS
unsigned
int
isc_os_ncpus
(
void
);
/*
* Return the number of CPUs available on the system, or 1 if this cannot
* be determined.
*/
ISC_LANG_ENDDECLS
#endif
/* ISC_OS_H */
lib/isc/unix/Makefile.in
View file @
386a52a5
...
...
@@ -30,13 +30,13 @@ CWARNINGS =
OBJS
=
@ISC_IPV6_O@
\
app.@O@ dir.@O@ entropy.@O@ errno2result.@O@ file.@O@
\
fsaccess.@O@ interfaceiter.@O@ keyboard.@O@ net.@O@
\
socket.@O@ stdio.@O@ stdtime.@O@ time.@O@
os.@O@
socket.@O@ stdio.@O@ stdtime.@O@ time.@O@
# Alphabetically
SRCS
=
@ISC_IPV6_C@
\
app.c dir.c entropy.c errno2result.c file.c
\
fsaccess.c interfaceiter.c keyboard.c net.c
\
socket.c stdio.c stdtime.c time.c
os.c
socket.c stdio.c stdtime.c time.c
SUBDIRS
=
include
TARGETS
=
${OBJS}
...
...
lib/isc/unix/os.c
0 → 100644
View file @
386a52a5
/*
* Copyright (C) 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#include <config.h>
#include <unistd.h>
#include <isc/os.h>
unsigned
int
isc_os_ncpus
(
void
)
{
#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
long
ncpus
;
ncpus
=
sysconf
(
_SC_NPROCESSORS_ONLN
);
if
(
ncpus
<=
0
)
return
(
1
);
#else
return
(
1
);
#endif
}
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