This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH [BZ #156] Update gethostbyname2_r documentation.


Thanks for the reply Ondra. Let me include the patch inline. Any more
comments/suggestions for improvement?

diff --git a/ChangeLog b/ChangeLog
index c2249b2..ce089b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-05-17  Yogesh Chaudhari  <mr.yogesh@gmail.com>
+
+ [BZ #156]
+ * manual/socket.texi: Added statement about buffer
+ for gethostbyname2_r.
+
 2013-05-13  Joseph Myers  <joseph@codesourcery.com>

  * math/libm-test.inc (struct test_fi_f_data): New type.
diff --git a/manual/socket.texi b/manual/socket.texi
index e187402..c3f82d9 100644
--- a/manual/socket.texi
+++ b/manual/socket.texi
@@ -1290,14 +1290,17 @@ pointer and the size of the buffer in the
@var{buf} and @var{buflen}
 parameters.

 A pointer to the buffer, in which the result is stored, is available in
-@code{*@var{result}} after the function call successfully returned.  If
-an error occurs or if no entry is found, the pointer @code{*@var{result}}
-is a null pointer.  Success is signalled by a zero return value.  If the
-function failed the return value is an error number.  In addition to the
-errors defined for @code{gethostbyname} it can also be @code{ERANGE}.
-In this case the call should be repeated with a larger buffer.
-Additional error information is not stored in the global variable
-@code{h_errno} but instead in the object pointed to by @var{h_errnop}.
+@code{*@var{result}} after the function call successfully returned. The
+buffer passed as the @var{buf} parameter can be freed only once the caller
+has finished with the result hostent struct, or has copied it including all
+the other memory that it points to. If an error occurs or if no entry is
+found, the pointer @code{*@var{result}} is a null pointer. Success is
+signalled by a zero return value.  If the function failed the return value
+is an error number.  In addition to the errors defined for
+@code{gethostbyname} it can also be @code{ERANGE}. In this case the call
+should be repeated with a larger buffer. Additional error information is
+not stored in the global variable @code{h_errno} but instead in the object
+pointed to by @var{h_errnop}.

 Here's a small example:
 @smallexample



On 17 May 2013 16:25, OndÅej BÃlka <neleai@seznam.cz> wrote:
> Hi,
>
> Patches should be send inline.
>
> Please use more descriptive subject like
> [PATCH] [BZ #156] Update gethostbyname2_r documentation.
>
> More information what you should do is at:
>  http://sourceware.org/glibc/wiki/Contribution%20checklist
>
> On Fri, May 17, 2013 at 03:56:33PM +0530, Yogesh Chaudhari wrote:
>> Hello,
>>
>> This patch adds the statement about freeing the buffer for
>> gethostbyname2_r in accordance with BZ156.
>>
>> http://sourceware.org/bugzilla/attachment.cgi?id=7029
>>
>> As this is my first patch, there may be many comments/suggestions and
>> resulting corrections. I was wondering if there is a utility similar
>> to the "patchcheck" used by the cpython project that would test for
>> 'basic' syntax/contribution corrections/completeness in a patch?
>> (http://hg.python.org/cpython/file/1babfb6261fa/Tools/scripts/patchcheck.py)
>>
> It would be usefull but nobody had time to write it yet.
>
> Ondra



--
DREAM IT, CODE IT


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]