X-Spam-Check-By: sourceware.org
Subject: Re: Problem with sunrpc
From: Sam Robb <sam.robb@timesys.com>
To: Zahir Koradia <zahir.koradia@gmail.com>
Cc: cygwin@cygwin.com
In-Reply-To: <f0d10dd60606121637p41bdd413q587a99ea08e8606e@mail.gmail.com>
References: <f0d10dd60606121637p41bdd413q587a99ea08e8606e@mail.gmail.com>
Content-Type: text/plain
Date: Wed, 14 Jun 2006 13:41:53 -0400
Message-Id: <1150306913.21484.142.camel@localhost.localdomain>
Mime-Version: 1.0
X-Mailer: Evolution 2.2.3 (2.2.3-4.fc4)
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Tue, 2006-06-13 at 05:07 +0530, Zahir Koradia wrote:
> Hi,
> This message might be specifically for Sam Robb but am sending to the
> whole list as others may be able to help. I installed the binaries and
> downloaded the source of sunrpc while installing cygwin. I intended to
> use the function clnttcp_create present in clnt.h header. The anamoly
> I see is that in the header file the signature has no parameters and
> in the source code the function definition has parameters.

This should be OK, believe it or not - the sunrpc headers use older
(K&R) style function prototypes.  Some information if you're interested:
http://en.wikipedia.org/wiki/C_programming_language#K.26R_C


> and the source code (clnt_tcp.c) definition had the line
<snip>
> This code does not compile.

It shouldn't.  This is part of the sunrpc library - you shouldn't have
to rebuild it.

Instead, you should be able to use the clnttcp_create() function from
the library by including <rpc/rpc.h> in your source file, and linking to
the rpc libraries by using -lrpc.  For example:

/*
  Compile: gcc -o rpc-example.exe rpc-example.c -lrpc
*/

#include <rpc/rpc.h>

int main(int argc, char** argv) {
    clnttcp_create(NULL, 0, 0, NULL, 0, 0);
    return 0;
}

Note that the above doesn't actually do anything useful - it just shows
you how to include the rpc headers, and compile and link to the rpc
libraries.

-Samrobb





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

