[svn-commits] russell: branch 1.4 r48195 - /branches/1.4/include/asterisk/utils.h

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Dec 1 20:50:58 MST 2006


Author: russell
Date: Fri Dec  1 21:50:58 2006
New Revision: 48195

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48195
Log:
Backport the comment containing the warning regarding the limitations on the
usage of this function.  It is thread safe, but not technically reentrant.

Modified:
    branches/1.4/include/asterisk/utils.h

Modified: branches/1.4/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/utils.h?view=diff&rev=48195&r1=48194&r2=48195
==============================================================================
--- branches/1.4/include/asterisk/utils.h (original)
+++ branches/1.4/include/asterisk/utils.h Fri Dec  1 21:50:58 2006
@@ -218,6 +218,16 @@
 
 int test_for_thread_safety(void);
 
+/*!
+ * \brief thread-safe replacement for inet_ntoa().
+ *
+ * \note It is very important to note that even though this is a thread-safe
+ *       replacement for inet_ntoa(), it is *not* reentrant.  In a single
+ *       thread, the result from a previous call to this function is no longer
+ *       valid once it is called again.  If the result from multiple calls to
+ *       this function need to be kept or used at once, then the result must be
+ *       copied to a local buffer before calling this function again.
+ */
 const char *ast_inet_ntoa(struct in_addr ia);
 
 #ifdef inet_ntoa



More information about the svn-commits mailing list