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
23ac3060
Commit
23ac3060
authored
Sep 01, 2004
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1709. [port] solaris: add SMF support from Sun.
parent
d6fe7ba9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
213 additions
and
34 deletions
+213
-34
CHANGES
CHANGES
+1
-1
bin/named/main.c
bin/named/main.c
+94
-1
config.h.in
config.h.in
+4
-1
configure
configure
+108
-30
configure.in
configure.in
+6
-1
No files found.
CHANGES
View file @
23ac3060
1709. [p
laceholder] rt12404
1709. [p
ort] solaris: add SMF support from Sun.
1708. [cleanup] Replaced dns_fullname_hash() with dns_name_fullhash()
for conformance to the name space convention. Binary
...
...
bin/named/main.c
View file @
23ac3060
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: main.c,v 1.13
8
2004/0
7
/01 0
2:0
3:5
4
marka Exp $ */
/* $Id: main.c,v 1.13
9
2004/0
9
/01 0
7:2
3:5
1
marka Exp $ */
#include <config.h>
...
...
@@ -47,6 +47,10 @@
#include <dst/result.h>
#ifdef HAVE_LIBSCF
#include <libscf.h>
#endif
/*
* Defining NS_MAIN provides storage declarations (rather than extern)
* for variables in named/globals.h.
...
...
@@ -684,6 +688,91 @@ ns_main_setmemstats(const char *filename) {
strcpy
(
memstats
,
filename
);
}
#ifdef HAVE_LIBSCF
/*
* Get FMRI for the current named process
*/
static
char
*
scf_get_ins_name
(
void
)
{
scf_handle_t
*
h
=
NULL
;
int
namelen
;
char
*
ins_name
;
if
((
h
=
scf_handle_create
(
SCF_VERSION
))
==
NULL
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"scf_handle_create() failed: %s"
,
scf_strerror
(
scf_error
()));
return
(
NULL
);
}
if
(
scf_handle_bind
(
h
)
==
-
1
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"scf_handle_bind() failed: %s"
,
scf_strerror
(
scf_error
()));
scf_handle_destroy
(
h
);
return
(
NULL
);
}
if
((
namelen
=
scf_myname
(
h
,
NULL
,
0
))
==
-
1
)
{
isc_log_write
(
ns_g_lctx
,
NS_LOGCATEGORY_GENERAL
,
NS_LOGMODULE_MAIN
,
ISC_LOG_INFO
,
"scf_myname() failed: %s"
,
scf_strerror
(
scf_error
()));
scf_handle_destroy
(
h
);
return
(
NULL
);
}
if
((
ins_name
=
malloc
(
namelen
+
1
))
==
NULL
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"scf_get_ins_named() memory "
"allocation failed: %s"
,
isc_result_totext
(
ISC_R_NOMEMORY
));
scf_handle_destroy
(
h
);
return
(
NULL
);
}
if
(
scf_myname
(
h
,
ins_name
,
namelen
+
1
)
==
-
1
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"scf_myname() failed: %s"
,
scf_strerror
(
scf_error
()));
scf_handle_destroy
(
h
);
free
(
ins_name
);
return
(
NULL
);
}
scf_handle_destroy
(
h
);
isc_log_write
(
ns_g_lctx
,
NS_LOGCATEGORY_GENERAL
,
NS_LOGMODULE_MAIN
,
ISC_LOG_INFO
,
"instance name:%s"
,
ins_name
);
return
(
ins_name
);
}
static
void
scf_cleanup
(
void
)
{
char
*
s
;
char
*
ins_name
;
if
((
ins_name
=
scf_get_ins_name
())
!=
NULL
)
{
if
((
s
=
smf_get_state
(
ins_name
))
!=
NULL
)
{
if
((
strcmp
(
SCF_STATE_STRING_ONLINE
,
s
)
==
0
)
||
(
strcmp
(
SCF_STATE_STRING_DEGRADED
,
s
)
==
0
))
{
if
(
smf_disable_instance
(
ins_name
,
0
)
!=
0
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"smf_disable_instance() failed: %s"
,
scf_strerror
(
scf_error
()));
}
}
free
(
s
);
}
else
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"smf_get_state() failed: %s"
,
scf_strerror
(
scf_error
()));
}
free
(
ins_name
);
}
}
#endif
int
main
(
int
argc
,
char
*
argv
[])
{
isc_result_t
result
;
...
...
@@ -762,6 +851,10 @@ main(int argc, char *argv[]) {
}
}
while
(
result
!=
ISC_R_SUCCESS
);
#ifdef HAVE_LIBSCF
scf_cleanup
();
#endif
cleanup
();
if
(
want_stats
)
{
...
...
config.h.in
View file @
23ac3060
...
...
@@ -16,7 +16,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.h.in,v 1.6
1
2004/0
5/21 08:15:36
marka Exp $ */
/* $Id: config.h.in,v 1.6
2
2004/0
9/01 07:25:51
marka Exp $ */
/***
*** This file is not to be included by any public header files, because
...
...
@@ -161,6 +161,9 @@ int sigwait(const unsigned int *set, int *sig);
/* Define to 1 if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD
/* Define to 1 if you have the `scf' library (-lscf). */
#undef HAVE_LIBSCF
/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
...
...
configure
View file @
23ac3060
...
...
@@ -14,7 +14,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# $Id: configure,v 1.34
5
2004/0
8
/2
8
0
6:20
:1
3
marka Exp $
# $Id: configure,v 1.34
7
2004/0
9
/2
4
0
4:37
:1
8
marka Exp $
#
# Portions Copyright (C) 1996-2001 Nominum, Inc.
#
...
...
@@ -29,7 +29,7 @@
# 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.
# From configure.in Revision: 1.36
1
.
# From configure.in Revision: 1.36
2
.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
...
...
@@ -6632,6 +6632,84 @@ fi
ISC_THREAD_DIR=$thread_dir
#
# In solaris 10, SMF can manage named service
#
echo "$as_me:$LINENO: checking for smf_enable_instance in -lscf" >&5
echo $ECHO_N "checking for smf_enable_instance in -lscf... $ECHO_C" >&6
if test "${ac_cv_lib_scf_smf_enable_instance+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lscf $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char smf_enable_instance ();
int
main ()
{
smf_enable_instance ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_scf_smf_enable_instance=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_scf_smf_enable_instance=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_scf_smf_enable_instance" >&5
echo "${ECHO_T}$ac_cv_lib_scf_smf_enable_instance" >&6
if test $ac_cv_lib_scf_smf_enable_instance = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBSCF 1
_ACEOF
LIBS="-lscf $LIBS"
fi
#
# flockfile is usually provided by pthreads, but we may want to use it
# even if compiled with --disable-threads. getc_unlocked might also not
...
...
@@ -7842,7 +7920,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 7
845
"configure"' > conftest.$ac_ext
echo '#line 7
923
"configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
...
...
@@ -8832,7 +8910,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:8
835
:" \
echo "$as_me:8
913
:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
...
...
@@ -9870,11 +9948,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:9
873
: $lt_compile\"" >&5)
(eval echo "\"\$as_me:9
951
: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:9
877
: \$? = $ac_status" >&5
echo "$as_me:9
955
: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
...
...
@@ -10103,11 +10181,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:101
06
: $lt_compile\"" >&5)
(eval echo "\"\$as_me:101
84
: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:101
10
: \$? = $ac_status" >&5
echo "$as_me:101
88
: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
...
...
@@ -10163,11 +10241,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:10
166
: $lt_compile\"" >&5)
(eval echo "\"\$as_me:10
244
: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:10
170
: \$? = $ac_status" >&5
echo "$as_me:10
248
: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
...
...
@@ -12347,7 +12425,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 12
350
"configure"
#line 12
428
"configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
...
...
@@ -12445,7 +12523,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 12
448
"configure"
#line 12
526
"configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
...
...
@@ -14628,11 +14706,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:14
631
: $lt_compile\"" >&5)
(eval echo "\"\$as_me:14
709
: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:14
635
: \$? = $ac_status" >&5
echo "$as_me:14
713
: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
...
...
@@ -14688,11 +14766,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:1469
1
: $lt_compile\"" >&5)
(eval echo "\"\$as_me:14
7
69: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:14
695
: \$? = $ac_status" >&5
echo "$as_me:14
773
: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
...
...
@@ -16049,7 +16127,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 16
052
"configure"
#line 16
130
"configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
...
...
@@ -16147,7 +16225,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 16
150
"configure"
#line 16
228
"configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
...
...
@@ -16974,11 +17052,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:1
6977
: $lt_compile\"" >&5)
(eval echo "\"\$as_me:1
7055
: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:1
6981
: \$? = $ac_status" >&5
echo "$as_me:1
7059
: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
...
...
@@ -17034,11 +17112,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:17
037
: $lt_compile\"" >&5)
(eval echo "\"\$as_me:17
115
: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:17
041
: \$? = $ac_status" >&5
echo "$as_me:17
119
: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
...
...
@@ -19072,11 +19150,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:19
075
: $lt_compile\"" >&5)
(eval echo "\"\$as_me:19
153
: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:19
079
: \$? = $ac_status" >&5
echo "$as_me:19
157
: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
...
...
@@ -19305,11 +19383,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:193
0
8: $lt_compile\"" >&5)
(eval echo "\"\$as_me:1938
6
: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:193
12
: \$? = $ac_status" >&5
echo "$as_me:193
90
: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
...
...
@@ -19365,11 +19443,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:19
368
: $lt_compile\"" >&5)
(eval echo "\"\$as_me:19
446
: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:19
372
: \$? = $ac_status" >&5
echo "$as_me:19
450
: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
...
...
@@ -21549,7 +21627,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 21
552
"configure"
#line 21
630
"configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
...
...
@@ -21647,7 +21725,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 21
650
"configure"
#line 21
728
"configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
...
...
configure.in
View file @
23ac3060
...
...
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.36
1
$)
AC_REVISION($Revision: 1.36
2
$)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
...
...
@@ -856,6 +856,11 @@ AC_SUBST(ISC_PLATFORM_USETHREADS)
ISC_THREAD_DIR=$thread_dir
AC_SUBST(ISC_THREAD_DIR)
#
# In solaris 10, SMF can manage named service
#
AC_CHECK_LIB(scf, smf_enable_instance)
#
# flockfile is usually provided by pthreads, but we may want to use it
# even if compiled with --disable-threads. getc_unlocked might also not
...
...
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