Date: Mon, 28 Aug 1995 17:57:19 -0700 (PDT) From: Archie Cobbs <archie@tribe.com> To: archie@tribe.tribe.com (Archie Cobbs) Cc: questions@freebsd.org Subject: Re: getservbyport() bug Message-ID: <199508290057.RAA29895@bubba.tribe.com> In-Reply-To: <199508290027.RAA29720@bubba.tribe.com> from "Archie Cobbs" at Aug 28, 95 05:27:19 pm
next in thread | previous in thread | raw e-mail | index | archive | help
I wrote:
> Why does getservbyport() return NULL in the following program?
> 
> 
>     #include <stdio.h>
>     #include <stdlib.h>
>     #include <netdb.h>
> 
>     main()
>     {
>         printf("by port -> 0x%x\n", (int) getservbyport(21, NULL));
>         printf("by name -> 0x%x\n", (int) getservbyname("ftp", NULL));
>     }
Ah, nevermind, the port number must be specified in network order.
Sorry to bother...
-Archie
_______________________________________________________________________________
Archie L. Cobbs, archie@tribe.com  *  Tribe Computer Works http://www.tribe.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508290057.RAA29895>
