From owner-freebsd-questions Mon Aug 28 17:58:01 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id RAA03199 for questions-outgoing; Mon, 28 Aug 1995 17:58:01 -0700 Received: from bubba.tribe.com ([205.184.207.7]) by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id RAA03192 for ; Mon, 28 Aug 1995 17:57:57 -0700 Received: (from archie@localhost) by bubba.tribe.com (8.6.11/8.6.9) id RAA29895; Mon, 28 Aug 1995 17:57:19 -0700 From: Archie Cobbs Message-Id: <199508290057.RAA29895@bubba.tribe.com> Subject: Re: getservbyport() bug To: archie@tribe.tribe.com (Archie Cobbs) Date: Mon, 28 Aug 1995 17:57:19 -0700 (PDT) Cc: questions@freebsd.org In-Reply-To: <199508290027.RAA29720@bubba.tribe.com> from "Archie Cobbs" at Aug 28, 95 05:27:19 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 590 Sender: questions-owner@freebsd.org Precedence: bulk I wrote: > Why does getservbyport() return NULL in the following program? > > > #include > #include > #include > > 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