inet_ntop reentrant?

This is a discussion on inet_ntop reentrant? within the Networking/Device Communication forums, part of the General Programming Boards category; I have been trying to find out if inet_ntop is reentrant or not. I seem to get varying responses on ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    inet_ntop reentrant?

    I have been trying to find out if inet_ntop is reentrant or not. I seem to get varying responses on the different sites I found when googling.

    I am sure versions of the library matter but I am not exactly sure what version I have and am not sure how to tell. If someone can tell me how to find out the library version I can provide that info as well.

    Thanks for the help.

  2. #2
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,274
    Quote Originally Posted by stevfletchcom View Post
    I have been trying to find out if inet_ntop is reentrant or not. I seem to get varying responses on the different sites I found when googling.

    I am sure versions of the library matter but I am not exactly sure what version I have and am not sure how to tell. If someone can tell me how to find out the library version I can provide that info as well.

    Thanks for the help.
    Unlike inet_ntoa, inet_ntop takes a pointer to the result buffer. The reason this was done was almost certainly to provide re-entrancy.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    17
    Thanks for the reply. That helps out a lot. It eliminates a large possible area of bugs for me in the code.

  4. #4
    Registered User
    Join Date
    Oct 2008
    Posts
    17
    Another related question.

    Is there an easy way to tell if a library function is threadsafe and or reentrant?

    I have some callback functions that need to be thread safe and reentrant, apparently there is a difference between the two, and I am not sure if I can use some standard library functions within the callback functions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reentrant Message Processing (WndProc)
    By phantomotap in forum Windows Programming
    Replies: 7
    Last Post: 04-28-2009, 11:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21