ares_init.3 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. .\"
  2. .\" Copyright 1998 by the Massachusetts Institute of Technology.
  3. .\" Copyright (C) 2004-2010 by Daniel Stenberg
  4. .\"
  5. .\" Permission to use, copy, modify, and distribute this
  6. .\" software and its documentation for any purpose and without
  7. .\" fee is hereby granted, provided that the above copyright
  8. .\" notice appear in all copies and that both that copyright
  9. .\" notice and this permission notice appear in supporting
  10. .\" documentation, and that the name of M.I.T. not be used in
  11. .\" advertising or publicity pertaining to distribution of the
  12. .\" software without specific, written prior permission.
  13. .\" M.I.T. makes no representations about the suitability of
  14. .\" this software for any purpose. It is provided "as is"
  15. .\" without express or implied warranty.
  16. .\"
  17. .TH ARES_INIT 3 "5 March 2010"
  18. .SH NAME
  19. ares_init \- Initialize a resolver channel
  20. .SH SYNOPSIS
  21. .nf
  22. #include <ares.h>
  23. int ares_init(ares_channel *\fIchannelptr\fP)
  24. .fi
  25. .SH DESCRIPTION
  26. The \fBares_init(3)\fP function initializes a communications channel for name
  27. service lookups. If it returns successfully, \fBares_init(3)\fP will set the
  28. variable pointed to by \fIchannelptr\fP to a handle used to identify the name
  29. service channel. The caller should invoke \fIares_destroy(3)\fP on the handle
  30. when the channel is no longer needed.
  31. The \fIares_init_options(3)\fP function is provide to offer more init
  32. alternatives.
  33. .SH RETURN VALUES
  34. \fIares_init(3)\fP can return any of the following values:
  35. .TP 14
  36. .B ARES_SUCCESS
  37. Initialization succeeded.
  38. .TP 14
  39. .B ARES_EFILE
  40. A configuration file could not be read.
  41. .TP 14
  42. .B ARES_ENOMEM
  43. The process's available memory was exhausted.
  44. .TP 14
  45. .B ARES_ENOTINITIALIZED
  46. c-ares library initialization not yet performed.
  47. .SH NOTES
  48. When initializing from
  49. .B /etc/resolv.conf,
  50. .BR ares_init (3)
  51. reads the
  52. .I domain
  53. and
  54. .I search
  55. directives to allow lookups of short names relative to the domains
  56. specified. The
  57. .I domain
  58. and
  59. .I search
  60. directives override one another. If more that one instance of either
  61. .I domain
  62. or
  63. .I search
  64. directives is specified, the last occurrence wins. For more information,
  65. please see the
  66. .BR resolv.conf (5)
  67. manual page.
  68. .SH SEE ALSO
  69. .BR ares_init_options(3),
  70. .BR ares_destroy(3),
  71. .BR ares_dup(3),
  72. .BR ares_library_init(3),
  73. .BR ares_set_servers(3)
  74. .SH AUTHOR
  75. Greg Hudson, MIT Information Systems
  76. .br
  77. Copyright 1998 by the Massachusetts Institute of Technology.
  78. .br
  79. Copyright (C) 2004-2010 by Daniel Stenberg.