ares_init (3)
Leading comments
Copyright 1998 by the Massachusetts Institute of Technology. Copyright (C) 2004-2010 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 o...
NAME
ares_init - Initialize a resolver channelSYNOPSIS
#include <ares.h> int ares_init(ares_channel *channelptr)
DESCRIPTION
The ares_init(3) function initializes a communications channel for name service lookups. If it returns successfully, ares_init(3) will set the variable pointed to by channelptr to a handle used to identify the name service channel. The caller should invoke ares_destroy(3) on the handle when the channel is no longer needed.The ares_init_options(3) function is provide to offer more init alternatives.
RETURN VALUES
ares_init(3) can return any of the following values:- ARES_SUCCESS
- Initialization succeeded.
- ARES_EFILE
- A configuration file could not be read.
- ARES_ENOMEM
- The process's available memory was exhausted.
- ARES_ENOTINITIALIZED
- c-ares library initialization not yet performed.
NOTES
When initializing from /etc/resolv.conf, ares_init(3) reads the domain and search directives to allow lookups of short names relative to the domains specified. The domain and search directives override one another. If more that one instance of either domain or search directives is specified, the last occurrence wins. For more information, please see the resolv.conf(5) manual page.SEE ALSO
ares_init_options(3), ares_destroy(3), ares_dup(3), ares_library_init(3), ares_set_servers(3)AUTHOR
Greg Hudson, MIT Information SystemsCopyright 1998 by the Massachusetts Institute of Technology.
Copyright (C) 2004-2010 by Daniel Stenberg.