aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ares/Makefile.inc2
-rw-r--r--ares/ares_library_init.378
2 files changed, 79 insertions, 1 deletions
diff --git a/ares/Makefile.inc b/ares/Makefile.inc
index 95686c1c0..98c93f303 100644
--- a/ares/Makefile.inc
+++ b/ares/Makefile.inc
@@ -22,4 +22,4 @@ MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.3 \
ares_version.3 ares_cancel.3 ares_parse_aaaa_reply.3 ares_getnameinfo.3 \
ares_getsock.3 ares_parse_ns_reply.3 ares_dup.3 \
ares_destroy_options.3 ares_save_options.3 ares_gethostbyname_file.3 \
- ares_set_socket_callback.3
+ ares_set_socket_callback.3 ares_library_init.3
diff --git a/ares/ares_library_init.3 b/ares/ares_library_init.3
new file mode 100644
index 000000000..a505750ac
--- /dev/null
+++ b/ares/ares_library_init.3
@@ -0,0 +1,78 @@
+.\" $Id$
+.\"
+.\" Copyright 1998 by the Massachusetts Institute of Technology.
+.\" Copyright (C) 2004-2009 by Daniel Stenberg
+.\"
+.\" Permission to use, copy, modify, and distribute this
+.\" software and its documentation for any purpose and without
+.\" fee is hereby granted, provided that the above copyright
+.\" notice appear in all copies and that both that copyright
+.\" notice and this permission notice appear in supporting
+.\" documentation, and that the name of M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose. It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_LIBRARY_INIT 3 "19 May 2009"
+.SH NAME
+ares_library_init \- c-ares library initialization
+.SH SYNOPSIS
+.nf
+.B #include <ares.h>
+.PP
+.B int ares_library_init(int \fIflags\fP)
+.fi
+.SH DESCRIPTION
+.PP
+The
+.B ares_library_init
+function performs initializations internally required by the c-ares
+library that must take place before any other c-ares function can be
+used.
+.PP
+This function must be called one time within the life of a program
+before the program actually executes any other c-ares library function
+call. Initializations done by this function remain effective until a
+call to \fIares_library_cleanup(3)\fP is performed.
+.PP
+Successive calls to this function are ignored, only the first one with
+c-ares in an uninitialized state is effective.
+.PP
+The
+.I flags
+parameter is a bit pattern that tells c-ares exactly which features
+should be initialized, as described below. Set the desired bits by
+ORing the values together. In normal operation, you must specify
+.I ARES_LIB_INIT_ALL.
+Don't use any other value unless you are familiar with it and trying
+to control some internal c-ares features.
+.PP
+.B This function is not thread safe.
+You have to call it once the program
+has started but must be called before the program starts any other thread.
+Due to the fact that ares_library_init() might call functions from other
+libraries that are thread unsafe, it could conflict with any other thread
+that uses these other libraries.
+.SH FLAGS
+.TP 5
+.B ARES_LIB_INIT_ALL
+Initialize everything possible. This sets all known bits.
+.TP
+.B ARES_LIB_INIT_WIN32
+Initialize Win32 specific libraries.
+.TP
+.B ARES_LIB_INIT_NONE
+Initialize nothing extra. This sets no bit.
+.SH RETURN VALUE
+If this function returns non-zero, something went wrong and you cannot
+use the other c-ares functions.
+.SH NOTES
+This function was first introduced in c-ares version 1.6.1 along with
+the definition of preprocessor symbol CARES_HAVE_ARES_LIBRARY_INIT
+as an indication of the availability of this function.
+.SH SEE ALSO
+.BR ares_library_cleanup (3)
+.SH AUTHOR
+Yang Tse