[PATCH 1/1] inet: add support for 64-bit network byte order

Collin Funk collin.funk1@gmail.com
Mon Mar 10 18:46:10 GMT 2025


Hi all,

Joseph Myers <josmyers@redhat.com> writes:

> I'd argue that the "network" byte order naming is not particularly 
> user-friendly (and nor, for that matter, is the "ll"/"l"/"s" naming).  
> Rather, we already have names such as htobe64 in <endian.h> as extensions 
> under __USE_MISC and those ought to suffice, without adding less-friendly 
> names such as these, unless some actual standard has those names.

I agree that the endian.h functions are more clear.

>> +@deftypefun {uint64_t} htonll (uint64_t @var{hostlonglong})
>> +@standards{BSD, netinet/in.h}
>
> Saying "BSD" is only appropriate for things that actually came from BSD 
> (which I think in this context means 4.4 BSD not anything more recent).  
> Did 4.4 BSD have the functions you are adding?

These functions did not exist in 4.4BSD-Lite 2. However, these functions
do exist in some places. In Gnulib maintainer tools [1]:

    ./show-portability ntohll
    ntohll
    libc                aix-5.1.0
    libc                aix-5.2.0
    libc                aix-5.3.0a
    libc                aix-6.1.0
    libc                aix-7.1.0
    libc                aix-7.2.0
    libc                aix-7.3.1
    libc                solaris-2.11-openindiana-20171031
    libc                solaris-2.11.0
    libc                solaris-2.11.3
    libc                solaris-2.11.4
    libc                solaris-2.11_2010_11

It also exists on Windows [2].

[1] https://git.savannah.gnu.org/cgit/gnulib/maint-tools.git
[2] https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-ntohll


More information about the Libc-alpha mailing list