[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hostent - Data structure error?



Frank,

Yes, you're connect. I'm surprised that I never noticed this before -- I guess I must never have used those two fields!

(The other fields are correct -- since pointer are always aligned on 16 byte boundaries, changing the integers doesn't affect the position of the pointers after them.)

I'll update it in my copy... thanks!



On 11/1/2016 9:43 AM, ffleer@xxxxxxxxxx wrote:
    Hi whoever reads this. Just a minor thing.
    Below data structure should have both int(5) fields defined as int(10)
    I believe.
    With int(5) the gethostbyname API returns 0 for h_addrtype and 2 for
    h_length. When I change the integer fields to int(10) I get resp. 2 and
    4, the correct values.
         **
         **           #define h_addr   h_addr_list[0]
         **
         D p_hostent       S               *
         D hostent         DS                  Based(p_hostent)
         D   h_name                        *
         D   h_aliases                     *
         D   h_addrtype                   5I 0
         D   h_length                     5I 0
         D   h_addrlist                    *
         D p_h_addr        S               *   Based(h_addrlist)
         D h_addr          S             10U 0 Based(p_h_addr)
    Best regards,
    Frank Fleer.
      __________________________________________________________________

    "PLEASE NOTE: The preceding information may be confidential or
    privileged. It only should be used or disseminated for the purpose of
    conducting business with Parker. If you are not an intended recipient,
    please notify the sender by replying to this message and then delete
    the information from your system. Thank you for your cooperation."



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------