On Mon, Aug 19, 2013 at 08:43:30PM +0900, Hiroki Sato wrote:
> Pawel Jakub Dawidek <p...@freebsd.org> wrote
>   in <201308181038.r7iacxkm008...@svn.freebsd.org>:
> 
> pj> Author: pjd
> pj> Date: Sun Aug 18 10:38:59 2013
> pj> New Revision: 254484
> pj> URL: http://svnweb.freebsd.org/changeset/base/254484
> pj>
> pj> Log:
> pj>   Consistently use 'af' as an argument name for address family.
> pj>   Now both gethostbyname2(3) and gethostbyaddr(3) use the same argument 
> name.
> pj>   The same argument name is also used in implementations of those 
> functions.
> pj>
> pj> Modified:
> pj>   head/lib/libc/net/gethostbyname.3
> pj>
> pj> Modified: head/lib/libc/net/gethostbyname.3
> pj> 
> ==============================================================================
> pj> --- head/lib/libc/net/gethostbyname.3     Sun Aug 18 10:33:46 2013        
> (r254483)
> pj> +++ head/lib/libc/net/gethostbyname.3     Sun Aug 18 10:38:59 2013        
> (r254484)
> pj> @@ -51,7 +51,7 @@
> pj>  .Ft struct hostent *
> pj>  .Fn gethostbyname2 "const char *name" "int af"
> pj>  .Ft struct hostent *
> pj> -.Fn gethostbyaddr "const void *addr" "socklen_t len" "int type"
> pj> +.Fn gethostbyaddr "const void *addr" "socklen_t len" "int af"
> pj>  .Ft struct hostent *
> pj>  .Fn gethostent void
> pj>  .Ft void
> pj> @@ -107,7 +107,7 @@ in binary form
> pj>  .Tn ASCII
> pj>  form).
> pj>  The
> pj> -.Fa type
> pj> +.Fa af
> pj>  argument specifies the address family
> pj>  (e.g.\&
> pj>  .Dv AF_INET , AF_INET6 ,
> 
>  I do not think we need to change this for consistency between the
>  manual page and its implementation.  gethostbyaddr()'s "int type"
>  appears literally in POSIX and almost all systems have used that
>  definition for a long time.

The reason I noticed was that address family argument was named 'af' in
gethostbyname2() above, but 'type' in gethostbyaddr() - the same
argument, but two different names.

Originally I changed 'af' to 'type' for gethostbyname2(), but then
decided that 'type' is just too universal and that implementation is
using 'af', so I ended up changing 'type' in gethostbyaddr() to 'af'.

Is POSIX consistent with naming address family argument for
gethostbyaddr() and gethostbyname2()?

I'm happy to change those two to 'type', I just would like the name to
be consistent between those two functions.

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://mobter.com

Attachment: pgpgvlqZ8yMTg.pgp
Description: PGP signature

Reply via email to