2 static char sfs_getrpcport_id[] = "@(#)getrpcport.c 2.1 97/10/23";
4 /* @(#)getrpcport.c 2.1 88/07/29 4.0 RPCSRC */
5 #if !defined(lint) && defined(SCCSIDS)
6 static char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI";
9 * Copyright (c) 1992-1997,2001 by Standard Performance Evaluation Corporation
10 * All rights reserved.
11 * Standard Performance Evaluation Corporation (SPEC)
12 * 6585 Merchant Place, Suite 100
15 * This product contains benchmarks acquired from several sources who
16 * understand and agree with SPEC's goal of creating fair and objective
17 * benchmarks to measure computer performance.
19 * This copyright notice is placed here only to protect SPEC in the
20 * event the source is misused in any manner that is contrary to the
21 * spirit, the goals and the intent of SPEC.
23 * The source code is provided to the user or company under the license
24 * agreement for the SPEC Benchmark Suite for this product.
27 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
28 * unrestricted use provided that this legend is included on all tape
29 * media and as a part of the software program in whole or part. Users
30 * may copy or modify Sun RPC without charge, but are not authorized
31 * to license or distribute it to anyone else except as part of a product or
32 * program developed by the user.
34 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
35 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
36 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
38 * Sun RPC is provided with no support and without any obligation on the
39 * part of Sun Microsystems, Inc. to assist in its use, correction,
40 * modification or enhancement.
42 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
43 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
44 * OR ANY PART THEREOF.
46 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
47 * or profits or other special, indirect and consequential damages, even if
48 * Sun has been advised of the possibility of such damages.
50 * Sun Microsystems, Inc.
52 * Mountain View, California 94043
56 * Copyright (c) 1985 by Sun Microsystems, Inc.
63 #include "rpc/osdep.h"
65 getrpcport(host, prognum, versnum, proto)
68 struct sockaddr_in addr;
71 if ((hp = gethostbyname(host)) == NULL)
73 memmove((char *) &addr.sin_addr, hp->h_addr, hp->h_length);
74 addr.sin_family = AF_INET;
76 return (pmap_getport(&addr, prognum, versnum, proto));